/* REXX _portsin */ /* By Francis*/ call zocsynctime 250 call zocsend "i" call zocwait "Trader Name" call zocwait "Current Sector :" s1=getnum("^M") call zocwait "Total Holds" holds=getnum("=") call zocwait "elp)" call zocsend "d" call zocwait "?=Help)" call zocwait ":" buy1=zocrequest("Buy What in this sector? (1=Ore, 2=Org, 3=Equ)","1","2","3") s2=zocask("Enter Other Sector") buy2=zocrequest("Buy What in other sector? (1=Ore, 2=Org, 3=Equ)","1","2","3") ntim=zocask("How many times to repeat?","10") x=ntim*2 do while x>0 x=x-1 CALL ZOCSEND "P" ANS=zocwaitmux("[T]","There is no port") SELECT when ANS=0 THEN DO CALL ZOCSEND "t" if ZOCWAITmUX("Docking.","You don't have any")=2 then EXIT END /*do*/ when ANS=1 then EXIT end /*select*/ call zocwait "of max OnBoard" do forever ANS=zocwaitmux("We are buy","We are sel","?=Help)","You don't have any","Shutdown Autopilot") select when ANS=0 then do call zocwait "]?" call zocsend "^M" call haggle 1 end /*do*/ when ANS=1 then do t2=zocwaitmux("Fuel Ore","Organics","Equipment") t2=t2+1 if t2=buy1 then do call zocwait "[" t1=getnum("]") call zocsend "^M" call haggle -1 end /*do*/ else do call zocsend "0^M" end end /*do*/ when ANS=2 then leave OTHERWISE exit end /*select*/ end /*do*/ if t1 0 then numb=numb||char end /*do*/ return numb haggle: q1=arg(1) temp=0 call zocwait "offer [" num1=getnum("]") if num1 < 25000 then do g1=q1*(num1*85%1000)+num1 end else do g1=q1*(num1*20%1000)+num1 end call zocwait "? " call zocsend g1||"^M" DO forever ans=zocwaitmux("final ","empty cargo","We'll buy them for","We'll sell them for") SELECT WHEN ans=0 then do temp=num1 call zocwait "offer [" num1=getnum("]") g1=num1-(temp-g1)+((temp-num1)*35%10)-(q1*4) end WHEN ans=1 then leave OTHERWISE do temp=num1 call zocwait "offer [" num1=getnum("]") g1=g1+((temp-num1)*2)-q1 end end call zocwait "? " call zocsend g1||"^M" end /*do*/ return