-+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+ X ! wrong password X when error in X if valid_override = 1 then X pr::date(1)=0 X goto 611`20 X end if X use X end when X X if fake_id = 0 then X input "Do you want to DELETE this saved game? (y/n)";a$ X if a$="y" or a$="Y" then X delete #4% X free #4% X print "Saved Game DELETED. Re-run GT to start a new game." `20 X end if X end if X close #4% X goto 10000 X X611 ! success revival from su X delete #4% X close #4% X ! turn on scanner if player is in space X if pr::rpos=1 then scanner_on=1\new_smg=1 end if X revived$="OK" X Xinit_planet: X get #1%, key #0 eq name$(pr::planet), wait 60\free #1% X gosub 1900 X gosub restore_options X call display(2,)`09`09 `09 ! initialize screens X call display(22,)`09`09`09 ! display input window X if revived$<>"OK" then X gosub 7800 ! initial display X call display(18,) X gosub 6000 ! ship selection X else X call display(18,) X end if X call display(4,) X op=pr X gosub 1700 `09`09`09 ! display status X gosub timestamp X put #2`09`09`09`09 ! update timestamp X free #2`20 X sender$="GPHQ" X if revived$="OK" then X m$=pr::username+ " has just been revived from suspended animation." X else X m$=pr::username+" has just been granted a trading license." X end if X chan=0 X gosub broadcast_message X free #1% X`20 X ! ---------------------------------------------------------------- X ! Main Input Loop X ! ---------------------------------------------------------------- X a%= CTRLC X while 1=1 X get #2%, key #0% eq pr::username, wait 60\free #2% X if mid$(op::message,1,1)<>" " then`09`09! process incoming X gosub 1200 X end if X menumode$="main" X720 option$="MAIN> "\call display(1,option$) X sender$=pr::username X select option$ X`09 case "?","help" X gosub help X case "q" X gosub 900 X if quit=1 then X a$="You retire." X call display(23,a$) X goto 8000 X end if X case "su" X if pr::on_ground<>1 then X call display(33,"You have to land to suspend.") X else X! if pr::date(1)=0 then X! a = noecho(0%) X! a$="Enter password> " X!`09`09 call display(1,a$) X!`09`09 a$=edit$(a$,32%) X! a = echo(0%) X ! now encrypt X! pr::date(1) = 0 X! for i=1 to len(a$) X! pr::date(1)=pr::date(1)+ascii(mid$(a$,i,1))*i X! next i X! end if X gosub 5100 X end if X case "ba" X if pr::on_ground<>1 then X call display(33,"You have to land to bank.") X else X gosub 1800 X end if X case "w" X gosub 1300 X case "p" X gosub 2100 X`09 call display(17,) X`09 call display(31,) X case "c" X gosub 2200 X case "j" X gosub 2300 X case "l" X gosub 2400 X case "t" X gosub 2500 X case "o" X gosub 2800 X case "s" X gosub 1000 X case "b" X gosub 1100 X`09 case "tu" X`09 gosub tune_comlink X`09 case "" X`09`09! do nothing X case else X call display(33,"Invalid Command - Enter '?' for help") X goto 720 X end select X for i=1 to ntrank X if pr::score>=points(i) then X pr::rank=i X end if X next i X get #2%, key #0% eq pr::username, wait 60 X gosub timestamp X pr::timestamp(1) = op::timestamp(1) X pr::timestamp(2) = op::timestamp(2) X op::legal=pr::legal\op::rank=pr::rank\op::kills=pr::kills X op::credits=pr::credits\op::planet=pr::planet\op::score=pr::score X op::shiptype=pr::shiptype X update #2%\free #2% X next ! end main loop X XTimestamp: X ! ----------------------- Timestamp --------------------------- X call sys$gettim(op::timestamp(1)) X return X XChecktime: X ! ----------------------- Check time -------------------------- X when error in X call sys$gettim(timebuffer) X ! if time is up, then remove offending record X if abs((fill1-op::timestamp(2)))>timelimit then X`09if op::username<>pr::username then X`09 get #2%, key #0% eq op::username, wait 60% X`09 expired_planet=op::planet X`09 gosub other_save`09`09! try to save player X`09 delete #2% X`09 get #3%, key#0% eq name$(expired_planet), wait 60% X`09 for i=1 to maxships X`09 if t(i)::username=op::username then X`09 t(i)::ship=-1 X`09 t(i)::sintent=-1 X`09 t(i)::player=0 X`09 t(i)::username="t up" X`09 end if X`09 next i X`09 update #3% X`09end if X end if X use X end when X free #2%\free #3% `20 X return X Xtune_comlink: X ! -------------- Tune comlink radio channels ------------------ X a$="Channel 1 setting (01 to 99) `5B"+str$(pr::chan1)+"`5D> " X call display(1,a$) X a = val(a$) X if a<0 or a>99 or a<>int(a) then X call display(33,"Invalid Channel Number") X goto tune_comlink X end if X if a<>0 then X pr::chan1 = a X end if Xtune_second: X a$="Channel 2 setting (01 to 99) `5B"+str$(pr::chan2)+"`5D> " X call display(1,a$) X a = val(a$) X if a<0 or a>99 or a<>int(a) then X call display(33,"Invalid Channel Number") X goto tune_second X end if X if a<>0 then X pr::chan2 = a X end if X X! update channels and mode in the player record Xupdate_player:`20 X get #2%, key# 0% eq pr::username, wait 60% X op::chan1 = pr::chan1 X op::chan2 = pr::chan2 X op::pmode = pr::pmode X update #2%\free #2% X X return X X900 ! ------------------------------------------------------------- X ! Quit X ! ------------------------------------------------------------- X p$= "REALLY QUIT? (Y/N) "\call display(1,p$) X if p$="y" then X quit=1\m$=pr::username+" has retired."\sender$="GPHQ" X chan=0 X gosub broadcast_message X else quit=0 X end if X return X`20 X1000 ! ------------------------------------------------------------ X ! Send X ! ------------------------------------------------------------ X sender$=pr::username X1020 if last_recipient = "" then X`09u$="SEND TO> " X else X`09u$="SEND TO ("+last_recipient+") " X end if X call display(1,u$) X u$=edit$(u$,32%) X if u$="" and last_recipient <> "" then X`09u$=last_recipient X end if X if pr::on_ground = 0 then X for i=1 to noship X if u$=edit$(t(i)::username,128%) and t(i)::player=0 then X goto send_valid X end if X next i X end if X if valid_id(u$)=0 then`20 X return X end if Xsend_valid: X last_recipient = u$ X X m$="MESSAGE> " X call display(34,m$) X X if m$ = "" then return end if X if super_user_mode%=0 then X if instr(1%,m$,"%%")<>0 or instr(1%,m$,"@")<>0 then`20 X call display(33,"Control Characters not allowed.") X goto 1020 X end if X end if X if u$="GPHQ" then X if left$(m$,3)="who" then`20 X goto 1300 X X`09! police mode for Public Safety`20 X else`20 X if left$(m$,5)=policemode then X`09 police_mode%=1 X`09 %IF (%SECURITY = 0 or %SECURITY = 1) X %THEN X`09`09! Super user mode for "testing" X`09 else`20 X if left$(m$,8)=superusermode then X`09 if len(m$)>9 then`09`09`09! get mode bits`09`09`09 X pr::pmode = val(mid$(m$,10,5)) X else X pr::pmode = 0 X end if X`09 super_user_mode%=1 X gosub update_player X`09 else`09`09`09`09`09! else, clear it all X police_mode%=0 X super_user_mode%=0 X pr::pmode = 0 X gosub update_player X end if X`09 %END %IF X end if X sender$="GPHQ"\u$=pr::username X m$="Insufficient authorization - Get lost." X end if X end if X if pr::on_ground =0 then X for i=1 to noship X if u$=edit$(t(i)::username,128%) and t(i)::player=0 then X gosub 1400 X if u$="" then`20 X`09 return X end if X end if X next i X end if X m$ = " "+m$ X Xsend_message: X when error in X get #2%, key #0% eq u$, wait 60 X if mid$(op::message,1,1)=" " then X op::message=sender$+":"+m$+"@" X else X`09 op::message=left$(op::message,instr(1,op::message,"@ "))+sender$ & X`09 +":"+m$+"@" X end if X update #2%\free #2% X use X call display(33,"The trader id "+u$+" is invalid.") X free #2% X end when X return X`20 X1100 ! ------------------------------------------------------------- X ! Broadcast X ! ------------------------------------------------------------- `20 X m$= "CHANNEL (RETURN for public)> " X call display(34,m$) X chan=val(m$) X if chan<0 or chan>99 or chan<>int(chan) then X call display(33,"Invalid channel Number.") X goto 1100 X end if X if chan<> 0 then X m$="MESSAGE`5B"+str$(chan)+"`5D> " X else X m$="MESSAGE> " X end if X call display(34,m$) X if police_mode%=1 then X sender$="GPHQ" X else`20 X sender$=pr::username X end if X if m$="" then return end if X if super_user_mode%=0 then X if instr(1%,m$,"%%")<>0 or instr(1%,m$,"@")<>0 then X call display(33,"Control Characters not allowed.") X return X end if X end if X Xbroadcast_message: X restore #2% X u$="0000" X if chan<>0 then X m$="`5B"+str$(chan)+"`5D '"+m$+"'" X else X m$ = " '"+m$+"'" X end if X when error in X for j=1 to maxplayers X get #2%, key #0 gt u$, wait 60 X u$=op::username X if (op::chan1=chan or op::chan2=chan) or (chan=0) or (op::pmode>1)t Vhen X`09 gosub checktime X gosub send_message X end if X free #2% X next j X use X end when X return X`20 X1200 ! ------------------------------------------------------------- X ! Print Messages X ! ------------------------------------------------------------- X i% = 1 X Xprint_loop: X e% = instr(i%,op::message,"@") X if e%=0 then X`09goto done_print X else X if mid$(op::message,i%+5,2)="%%" then ! decode event + enqueue V it X if numevents<20 then numevents=numevents+1 end if X ev(numevents)::event=mid$(op::message,i%+7,2) X ev(numevents)::source=mid$(op::message,i%,4) X select ev(numevents)::event X case "ab" X case "eb" X case "mi","la","mo" X ev(numevents)::dest=mid$(op::message,i%+9,4) X`09 ev(numevents)::p1=val(mid$(op::message,i%+13,e%-i%-14)) X end select X else`09`09`09`09`09! not event, show it X`09call display(23,mid$(op::message,i%,e%-i%)) X end if X end if X i% = e%+1`09`09`09`09`09! i points to start of next X goto print_loop X Xdone_print:`09`09`09`09`09! all done, clear incoming X op::message = "" X find #2%, key #0% eq pr::username, wait 60% X update #2% X free #2% X return X`20 X X1300 ! ------------------------------------------------------------- X ! Galactic Report X ! ------------------------------------------------------------- X if scanner_on=1 then call display(12,) end if X call display(4,)`20 X if pr::legal>1 then X a$="Surrender to the nearest Galactic Police ship immediately." X`09call display(24,a$) X else X u$="0000" X a$="Galactic Police Status Report as of "+time$(0%)+" GST" X call display(23,a$) X a$="Trader ID Commander Legal Status Rank" & X`09`09+" Kills Planet" X call display(24,a$) X call display(24,"") X when error in X for j=1 to maxplayers X get #2%, key #0 gt u$, wait 60 X free #2%\u$=op::username\a$=op::personalname X m$=u$+space$(16-len(u$))+a$+space$(16-len(a$)) X a$=legal$(op::legal) X if(op::pmode>100) then X`09 b$ = "**GOD**" X else X b$=rank$(op::rank) X end if X`09 c$=str$(op::kills) X m$=m$+a$+space$(17-len(a$))+b$+ & X space$(14-len(b$))+c$+space$(8-len(c$))+name$(op::planet) X call display(24,m$) X next j X use X free #2% X`09 continue 1320 X end when X end if X1320 if scanner_on=1 then X`09new_smg=1 X`09gosub 3000 X end if X return X`20 X1400 ! --------------------------------------------------------------- X ! Computer Controlled Ship Replies X ! --------------------------------------------------------------- X sender$=t(i)::username\u$=pr::username X if t(i)::ship<>1 then X if rnd>.6 and t(i)::ship<>10 then X m$="Shut up or I'll E-Bomb you." X else u$="" X end if X return X end if X if pr::legal=1 then m$="ComLink Abuse is a Galactic Offense." end if X if pr::legal=2 then X if (left$(m$,1)="a" or left$(m$,1)="A") then X if menumode$="manual" then X m$="Good. I'm glad you've decided to cooperate. Stand by for" X m$=m$+" boarding." X get #3%, key #0% eq name$(pr::planet), wait 60 X t(i)::sintent=15 +-+-+-+-+-+-+-+- END OF PART 4 +-+-+-+-+-+-+-+-