-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X case 31 X ! remove planet info window X rs=smg$unpaste_virtual_display(planet_id,new_pid) X case 32 X ! clear planet info window X rs=smg$erase_display(planet_id,,,,) X case 33 X`09 ! display a line in error window X`09 rs=smg$ring_bell(error_id,1)`09 `20 X rs=smg$put_line(error_id,dtext,,,,,,) X`09 pending_error = 1 X`09 case 34 X ! get long input + return in dtext X`09 rs=smg$repaste_virtual_display(io_id,new_pid,23,1) X rs=smg$erase_display(io_id,,,,) X rs=smg$set_cursor_abs(io_id,1,1) X rs=smg$put_line(io_id,dtext,,,,,,) X`09 prompt_len = len(dtext) + 1 X`09 text_len = prompt_len X`09 dtext="" X rs=smg$set_cursor_abs(io_id,1,text_len) X`09 rs=smg$read_keystroke(keyboard_id,keycode,,,io_id,,) X`09 while (keycode<>13 and text_len<80) X`09 call handle_key(keycode,dtext,text_len,prompt_len) X`09 rs=smg$read_keystroke(keyboard_id,keycode,,,io_id,,) X`09 next X dtext=edit$(dtext,152%) ! remove excess spaces, tab X`09 re=smg$repaste_virtual_display(error_id,new_pid,23,40) X scroll_ok=0 X end select X end sub X X ! routine to handle keystroke X sub handle_key(long keycode, string text_buffer, long text_len, prompt_l Ven) X %include "common.h" X %include "display.e" X X select keycode X case 127 X if text_len > prompt_len then X`09 text_len = text_len - 1 X`09 text_buffer = left$(text_buffer,(text_len-prompt_len)) X`09 rs = smg$put_chars(io_id," ",1,text_len,,,,) X`09 rs = smg$put_chars(io_id,"",1,text_len,,,,) X end if X case else X`09text_buffer = text_buffer + chr$(keycode) X rs=smg$put_chars(io_id,chr$(keycode),1,text_len,,,,) X`09text_len = text_len + 1 X end select X end sub X X ! ast_refresh routine to asynchrounously refresh screen.`20 X sub ast_refresh(long a,b,c,d,e by ref) X X %include "display.e" X %include "common.h" X declare integer rs X X rs = smg$repaint_screen(new_pid) X rs = smg$repaint_line(new_pid,23,1) X end sub X X ! display unsolicited input X sub ast_broadcast(long a,b,c,d,e by ref) X X %include "display.e" X %include "common.h" X declare word m_len X declare string m_text X rs = smg$get_broadcast_message(new_pid, m_text, m_len,) X rs = smg$set_cursor_abs(io_id,2,1) X rs = smg$put_line(io_id,m_text,,,,,,) X `20 X end sub $ CALL UNPACK DISPLAY.BAS;1 2047544030 $ create 'f' X`09! ------------------- display.e ---------------------------- X`09 X`09external long ast_refresh X external long ast_broadcast X`09external long function smg$erase_pasteboard(long by ref) X`09external long function smg$repaint_line(long by ref, long by ref, & X`09`09long by ref) X external long function smg$create_pasteboard(LONG by ref, & X STRING by desc, LONG by ref, LONG by ref, LONG by ref) X external long function smg$create_virtual_display(LONG by ref, & X LONG by ref, LONG by ref, LONG by ref, LONG by ref, & X LONG by ref) X external long function smg$paste_virtual_display(LONG by ref, & X LONG by ref, LONG by ref, LONG by ref) X external long function smg$put_line(LONG by ref, STRING by desc, & X LONG by ref, LONG by ref, LONG by ref, LONG by ref, & X LONG by ref, LONG by ref) X external long function smg$return_cursor_pos(LONG,LONG,LONG) X external long function smg$erase_display(LONG, LONG, LONG, LONG, LON VG) X external long function smg$unpaste_virtual_display(LONG, LONG) X external long function smg$repaste_virtual_display(LONG,LONG,LONG,LO VNG) X external long function smg$repaint_screen(LONG by ref) X external long function smg$set_display_scroll_region(LONG, LONG, LON VG) X external long function smg$delete_pasteboard (LONG by ref, LONG by r Vef) X external long constant smg$m_border, smg$m_reverse, smg$m_bold, & X smg$m_blink X external long function smg$label_border(LONG,STRING by desc, LONG, & X LONG, LONG, LONG) X external long function smg$put_line(LONG,STRING by desc, LONG, LONG, V & X LONG, LONG, LONG, LONG) X external long function smg$put_with_scroll(LONG,STRING by desc,LONG) X external long function smg$set_cursor_abs(LONG,LONG,LONG) X external long function smg$set_cursor_rel(LONG,LONG,LONG) X external long function smg$set_display_scroll_region(LONG,LONG,LONG) X external long function smg$put_chars(LONG,STRING by desc,LONG,LONG, V & X `09LONG,LONG,LONG,LONG) X external long function smg$ring_bell(LONG,LONG) X X`09! ast functions X`09external long function smg$enable_unsolicited_input(LONG,LONG,LONG) X`09external long function smg$set_broadcast_trapping(long by ref, & X`09`09long by ref, long by value) X external long function smg$set_out_of_band_asts(long by ref, & X`09`09long by ref, long by ref, long by value) X`09external long function smg$get_broadcast_message(long by ref, & X`09`09string by desc, word by ref, word by ref) X X ! virtual keyboard stuff X external long function smg$create_virtual_keyboard(LONG) X external long function smg$delete_virtual_keyboard(LONG) X external long function smg$read_string(LONG,STRING by desc,STRING & X `09by desc,LONG,LONG,LONG,STRING by desc,LONG,LONG,LONG) X external long function smg$read_keystroke(LONG by ref,long by ref, & X`09`09string by desc, long by ref, long by ref, long by ref, & X`09`09long by ref) X `20 X ! constants X external long constant smg$m_blink,smg$m_bold,smg$m_reverse $ CALL UNPACK DISPLAY.E;1 1263759743 $ create 'f' Xmain XThe following options are available from the main (MAIN>) menu. X(b)roadcast Sends a message to all the current players in the galaxy. X(ba)ank Pay a visit to the local Galactic Bank branch office. X(c)heck status Displays information about yourself and your ship. X(j)ump Engage your hyperspace drive and travel to another world. X(l)and When orbiting a world, activate your Delison drive to land V. X(o)ptions Toggle default settings. X(p)lanet Display information on the current planet. X(q)uit Retire from galactic trading immediately. X(s)end Send a message to a specified player in the galaxy. X(su)spend Place your character in suspended animation. X(t)rade Pay a visit to the trading center on the current planet. X(tu)ne`09`09 Tune comLink channels. X(w)ho Ask the Galactic Police for a list of all free traders. X `20 X `20 X `20 X `20 X `20 X `20 X `20 Xtrade XThe following options are available from the trade (TRADE>) menu. X(b)uy Buy cargo from the trading center. X(c)heck status Displays information about yourself and your ship. X(e)quipment Purchase equipment for your ship. X(f)uel Buy fuel for your ship. X(p)rices Get a list of the current trading prices. X(s)ell Sell cargo you have in your ship to the trading center. X(u)se computer Activate your trading computer (if fitted.) X(x)change ship Visit the used ship dealer and see what he has to offer. X(q)uit trading Leave the trading center and return to the main menu. X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 Xcomp XThe following options are available from the trading computer (COMP>) menu. X(i)tem View the prices by planet for a given commodity. X(p)rices View the trading computer's estimated prices for a planet. X(pl)anets View the list of planets on which the computer has data. X(q)uit Stop using the trading computer and return to trade menu. X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 X `20 Xmanual X(a)head full,+ Advance in your current direction as fast as your drives go. X(ah)ead slow Advance in your current direction at a slower speed. X(ab)andon Abandon your ship (if you have an escape capsule.) X(bo)ard Board an abandonned ship or starbase specified. X(b)oadcast Send a message to all players in the galaxy. X(c)heck status Displays information about yourself and your ship. X(cl)oak (ls)j Activate/Deactivate your cloaking device/LSJ. X(d)odge Take evasive action to reduce the chance of being hit. X(e)energy bomb Use an energy bomb (if fitted.) X(ec)m Activate/Deactivate your electronic counter measures. X(f)orward Fire your forward laser (if fitted.) X(fl)ush Open your cargo doors and flush your cargo hold. X(j)ump Attempt to reactivate your jump drive and leave the planet. X(m)issile Fire a single (or multiple if MFMR fitted) missile. X(o)ptions Toggle default settings. X(r)ear Fire your rear laser (if fitted.) X(s)end Send a message to a single player in the galaxy. X(sa)nd Use your sandblaster to produce a cloud of sand (if fitted.) X(st)op, - Stop motion. Leaves ship swung through 180 degrees X(lt)eft turn, `5B Rotate left 45 degrees X(rt)ight turn,`5D Rotate right 45 degrees X `20 X `20 X `20 X $ CALL UNPACK GAL-HELP.DAT;1 1010082469 $ create 'f' X ! --------------------------- gal-trader4.h ----------------------------- V- X record event_type X SINGLE p1 X STRING source = 4 X STRING dest = 4 X STRING event = 2 X end record event_type X X record planetinfo_type X SINGLE zone X SINGLE law X SINGLE population X SINGLE tech X SINGLE xp X STRING pname = 15 X SINGLE yp X SINGLE government X SINGLE trade X END RECORD planetinfo_type X X record score_type X STRING sname = 10 X SINGLE ships X INTEGER score X STRING rank = 12 X SINGLE legal X SINGLE money X END RECORD score_type X X record equip_type X SINGLE eprice X STRING ename =20 X INTEGER usedeprice X END RECORD equip_type X X record cargo_type X SINGLE ttech X SINGLE qtrade X SINGLE tprice X STRING unit X SINGLE pprice X SINGLE bprice X STRING trade = 20 X END RECORD cargo_type X X record shipstats_type X SINGLE soldhere X SINGLE mmissile X`09 INTEGER temperature X STRING sname = 40 X SINGLE slaser X SINGLE mlaser X SINGLE mcargo X SINGLE mfuel X SINGLE cargo(2) X SINGLE mdrive X SINGLE rarity X SINGLE reliability X SINGLE resale X SINGLE cost X`09 INTEGER neg_cost X SINGLE menergy X END RECORD shipstats_type X `20 X record targets_type X STRING username=4 X SINGLE others(2) X SINGLE sintent X SINGLE spos X`09 SINGLE special X SINGLE senergy X SINGLE cargo(2) X SINGLE smissile X SINGLE player X SINGLE ship X SINGLE starget X END RECORD targets_type X X record player_type X SINGLE score X SINGLE moves X SINGLE credits X SINGLE legal X SINGLE date(2) X SINGLE hash X SINGLE interest X`09 STRING username=4 X SINGLE due X SINGLE pmode X SINGLE rank X SINGLE planet X SINGLE kills X SINGLE equip(ntequip) X LONG timestamp(2) X SINGLE chan2 X SINGLE escapes X SINGLE debt X SINGLE maxenergy X SINGLE rpos X SINGLE direction X SINGLE time_owned X SINGLE fshield X SINGLE scanrange X SINGLE shiptype X SINGLE fuel X SINGLE thargoid X SINGLE shipnum X`09 INTEGER lsj X SINGLE energy X STRING personalname = 13 X SINGLE maxfuel X SINGLE chan1 X SINGLE maxcargo X SINGLE ban X SINGLE maxmissile X SINGLE totcargo X STRING message=bufsize X SINGLE cargo(ntcargo) X SINGLE on_ground X SINGLE dodge X SINGLE speed X SINGLE random_key X`09 INTEGER cloak X END RECORD player_type $ CALL UNPACK GAL-TRADER.H;1 388759627 $ create 'f' X1 ! ---------------------------------------------------------------------- X ! Galactic Trader v. 4.55 by Stephan Meier 8/87 X ! (c) Copyright 1989,1990,1991 by Stephan Meier. All rights reserved V. X ! ---------------------------------------------------------------------- X %IDENT "GT V4.55" X X %LET %SECURITY = %VARIANT X %IF (%SECURITY = 0) %THEN`20 X %PRINT "0 : LOW SECURITY (superuser,override, debug)" X %ELSE %IF (%SECURITY = 1) %THEN X %PRINT "1 : MEDIUM SECURITY (superuser,no override, no debug)" X %ELSE %IF (%SECURITY = 2) %THEN X %PRINT "2 : HIGH SECURITY (no superuser, no override, no debug)" X %ELSE`20 X`09%ABORT "Invalid Security Level specified" X %END %IF X %END %IF X %END %IF X X a%=NOCTRLC X option angle=degrees X randomize X`20 X ! ----------------------- Constants ------------------------------- X declare string constant superusermode="10203040" ! must be 8 chars X declare string constant policemode="54321" ! must be 5 chars X declare string constant overridemode="xxxyyy" `20 X declare integer constant ntequip=24 X declare integer constant ntcargo=10 X declare integer constant ntships=23 X declare integer constant maxships=200 X declare integer constant maxscores=10 X declare integer constant ntrank=10 X declare integer constant ntlegal=5 X declare integer constant bufsize=2000 X declare integer constant maxplayers=4 X declare integer constant maxevents=20 X declare integer constant startmoney=200150 +-+-+-+-+-+-+-+- END OF PART 2 +-+-+-+-+-+-+-+-