/* This is a paired port trading utility */ /* This script is very easy to use all you need to do is go to a pair */ /* and start the script. You can start the loop with nothing on your */ /* ship or something that the first port will buy. If, however, you */ /* start the loop with something on your ship the first port wont buy */ /* you should expect it to fail! Set up is easy, go to the pair, run */ /* this script, answer the questions, read a book! the questions are */ /* very straight forward. The first question is "What is the first */ /* port number?" This is a number from 1 to 5000 (this is the sector */ /* the ship is sitting in.) The second question is "What do you want */ /* to buy there? (f,o,e)" Just type in f for Fuel Ore, o for Organics */ /* or e for Equipment. The third and fourth questions are the same */ /* except they ask information about the second port. The last */ /* question asks "How many times do you want to run this loop?", all */ /* you have to do is put in the number of times you want it to run. */ /* A convenient way of determining the number of times the loop should */ /* be run is to look at the reports for both ports and divide the */ /* lowest number by the number of holds your ship has. and just type in */ /* the number. Or you can just put in a real high number like 100 and */ /* let the script tell you when the pair dries up. One last reminder, */ /* make sure to have enough cash on your ship to buy a full holds worth */ /* of the most expensive item you intend to trade! This script strives */ /* to give you 2 experience points per trade, but it takes two or three */ /* cycles to get warmed up. So be patient, and have fun. */ init: test$ = "off" productone$ = "" producttwo$ = "" porttwo$ = "" sellone = 103 buyone = 97 selltwo = 103 buytwo = 97 totalexp = 0 gosub invalidmode onmouse goto finishtwo gosub parseinfo portone$ = str$(cursect) setfirstport: getstring "What is the first port number?" , portone$ portone = val(portone$) if portone != cursect beep tpen = 3 print local print local "You must start out over the first port." tpen = 1 goto finishtwo endif getstring "What do you want to buy there? (f,o,e)" , productone$ productone$ = left$(productone$ , 1) setsecondport: getstring "What is the second port number?" , porttwo$ porttwo = val(porttwo$) if porttwo < 1 gosub validport goto setsecondport endif if porttwo > 5000 gosub validport goto setsecondport endif setsecondprod: getstring "What do you want to buy there? (f,o,e)" , producttwo$ producttwo$ = left$(producttwo$ , 1) if portone == porttwo beep print local "You need two different port numbers!" goto setsecondport endif if productone$ == producttwo$ beep print local "You can't trade the same product!" goto setsecondprod endif counttimes = 0 loopturns = (turnstowarp + 1) * 2 numtimes = (turns - 40) / loopturns maxtimes = turns / loopturns if numtimes < 1 numtimes = 0 endif getint "How many time do you want to run this loop?" , numtimes , 0 , maxtimes if numtimes < 1 goto finishtwo endif gosub builddat goto partone validport: beep print local print local "This must be a number from 1 to 5000!" return partone: send "pt" wait "OnBoard" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "(?" wait ") :" goto drypair endif tradeone: buycheck$ = getline$(row) buycheck$ = left$(buycheck$ , 13) if buycheck$ == "We are buying" send "^m" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "]?" /* ship is mega holded */ goto tradeone endif if findout$ == "(?" /* ship is mega holded */ wait ") :" goto movetotwo endif makeofferone: gosub hackprice counter = offer * sellone / 100 command$ = str$(counter) + "^m" send command$ findoutone: wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == " ?" /* did not accept price (too high) */ sellone = sellone - 1 goto makeofferone endif if findout$ == "(?" /* did not accept price (way too high) */ wait ") :" sellone = sellone - 1 goto partone endif if findout$ == "]?" /* dont know if accept or not */ notinterested$ = trim$(getline$(row - 2)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 pointline = 4 gosub expdetect sellone = sellone + adjust goto tradeone else sellone = sellone - 1 gosub enterzero goto partone endif endif goto findoutone endif if buycheck$ == "We are sellin" checksell$ = lower$(mid$(getline$(row + 1) , 19 , 1)) if checksell$ == productone$ send "^m" else send "0^m" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "(?" wait ") :" goto drypair endif if findout$ == "]?" goto tradeone endif goto fallout endif wait "] ?" makeoffertwo: gosub hackprice counter = offer * buyone / 100 command$ = str$(counter) + "^m" send command$ findouttwo: wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == " ?" /* did not accept price (too low) */ buyone = buyone + 1 goto makeoffertwo endif if findout$ == "(?" /* don't know if accepted or not! */ wait ") :" notinterested$ = trim$(getline$(row - 1)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 buyone = buyone + 1 /* not accepted, way too low */ goto partone else pointline = 3 gosub expdetect buyone = buyone - adjust goto movetotwo endif endif if findout$ == "]?" /* dont know if accept or not */ notinterested$ = trim$(getline$(row - 2)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 buyone = buyone + 1 /* not accepted, way too low */ gosub enterzero goto partone else pointline = 4 gosub expdetect buyone = buyone - adjust gosub enterzero goto movetotwo endif endif goto findouttwo endif beep goto fallout movetotwo: tpen = 3 print local print local "This loop has run " ; counttimes ; ".5 time(s)." print local "You have gained " ; totalexp ; " experience points." tpen = 1 print local "Command [TL=??:??:??] (?=Help)?" ; command$ = str$(porttwo) if porttwo < 600 command$ = command$ + "^m" endif send command$ wait ") :" goto parttwo parttwo: send "pt" wait "OnBoard" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "(?" wait ") :" goto drypair endif tradetwo: buycheck$ = getline$(row) buycheck$ = left$(buycheck$ , 13) if buycheck$ == "We are buying" send "^m" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "]?" /* ship is mega holded */ goto tradetwo endif if findout$ == "(?" /* ship is mega holded */ wait ") :" goto goagain endif makeofferthree: gosub hackprice counter = offer * selltwo / 100 command$ = str$(counter) + "^m" send command$ findoutthree: wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == " ?" /* did not accept price (too high) */ selltwo = selltwo - 1 goto makeofferthree endif if findout$ == "(?" /* did not accept price (way too high) */ wait ") :" selltwo = selltwo - 1 goto parttwo endif if findout$ == "]?" /* dont know if accept or not */ notinterested$ = trim$(getline$(row - 2)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 pointline = 4 gosub expdetect selltwo = selltwo + adjust goto tradetwo else selltwo = selltwo - 1 gosub enterzero goto parttwo endif endif goto findoutthree endif if buycheck$ == "We are sellin" checksell$ = lower$(mid$(getline$(row + 1) , 19 , 1)) if checksell$ == producttwo$ send "^m" else send "0^m" wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == "(?" wait ") :" goto drypair endif if findout$ == "]?" goto tradetwo endif goto fallout endif wait "] ?" makeofferfour: gosub hackprice counter = offer * buytwo / 100 command$ = str$(counter) + "^m" send command$ findoutfour: wait "?" findout$ = right$(trim$(getline$(row + 1)) , 2) if findout$ == " ?" /* did not accept price (too low) */ buytwo = buytwo + 1 goto makeofferfour endif if findout$ == "(?" /* don't know if accepted or not! */ wait ") :" notinterested$ = trim$(getline$(row - 1)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 buytwo = buytwo + 1 /* not accepted, way too high */ goto parttwo else pointline = 3 gosub expdetect buytwo = buytwo - adjust goto goagain endif endif if findout$ == "]?" /* did accept price */ notinterested$ = trim$(getline$(row - 2)) posofand = instr(notinterested$ , "and") notinterested$ = right$(notinterested$ , len(notinterested$) - posofand - 3) if val(notinterested$) > 0 buytwo = buytwo + 1 /* not accepted, way too high */ gosub enterzero goto parttwo else pointline = 4 gosub expdetect buytwo = buytwo - adjust gosub enterzero goto goagain endif endif goto findoutfour endif goto fallout goagain: counttimes = counttimes + 1 if counttimes < numtimes goto movetoone endif goagain$ = "yes" getstring "do you wish to continue?" , goagain$ if goagain$ == "yes" goto movetoone else goto finishtwo endif movetoone: tpen = 3 print local print local "This loop has run " ; counttimes ; " time(s)." print local "You have gained " ; totalexp ; " experience points." tpen = 1 print local "Command [TL=??:??:??] (?=Help)?" ; command$ = str$(portone) if portone < 600 command$ = command$ + "^m" endif send command$ wait ") :" goto partone drypair: print local tpen = 3 print local "This pair is now dry! Exiting loop!" goto finish fallout: beep tpen = 3 print local print local "Fell through! I don't know what to do!" finish: tpen = 1 print local "Command [TL=??:??:??] (?=Help)?" ; finishtwo: end hackprice: offer$ = getline$(row + 1) offer$ = trim$(offer$) posofcomma = instr(offer$ , ",") if posofcomma > 1 lftoffer$ = left$(offer$ , posofcomma - 1) rghtoffer$ = right$(offer$ , len(offer$) - posofcomma) offer$ = lftoffer$ + rghtoffer$ endif offer$ = right$(offer$ , len(offer$) - 12) offer = val(offer$) return validport: beep print local print local "This must be a number from 1 to 5000!" return invalidmode: cmdlne$ = left$(getline$(row + 1) , 7) if cmdlne$ != "Command" beep tpen = 3 print local print local "You need to be at the main command prompt to run this script!" tpen = 1 goto finishtwo endif return expdetect: point$ = trim$(getline$(row - pointline)) pointtest$ = left$(point$ , 8) if pointtest$ == "You have" pointline = pointline + 1 point$ = trim$(getline$(row - pointline)) endif if point$ == "For your great trading you receive 2 experience point(s)." totalexp = totalexp + 2 adjust = 1 else if point$ == "For your good trading you receive 1 experience point(s)." totalexp = totalexp + 1 adjust = 2 else if point$ == "For your excellent trading you receive 5 experience point(s)." totalexp = totalexp + 5 else adjust = 3 endif endif endif return enterzero: send "0^m" wait "?" wait ") :" return parseinfo: send "i" wait "Alignm" experience$ = trim$(getline$(row + 1)) experience$ = right$(experience$ , len(experience$) - 16) experience = val(experience$) wait "Current" turnstowarp$ = trim$(getline$(row)) turnstowarp$ = right$(turnstowarp$ , len(turnstowarp$) - 16) turnstowarp = val(turnstowarp$) wait " left " cursect$ = trim$(getline$(row)) cursect$ = right$(cursect$ , len(cursect$) - 16) cursect = val(cursect$) wait "Total Ho" turns$ = trim$(getline$(row)) turns$ = right$(turns$ , len(turns$) - 16) turns = val(turns$) wait "?" wait ") :" if test$ == "on" print local print local "experience = " ; experience print local "current sector = " ; cursect print local "turns = " ; turns endif return builddat: fuelstat = 0 orgstat = 0 equstat = 0 repsect = portone gosub scanport repsect = porttwo gosub scanport if fuelstat == 1 if orgstat == 1 if equstat == 1 goon$ = "Yes" getstring "This pair can be triple traded, continue?" , goon$ if goon$ != "Yes" goto finish endif endif endif endif return scanport: send "c" wait "Computer" command$ = "r" + str$(repsect) + "^m" send command$ when 1 "have" goto noscan wait "%" wait "%" gosub findstat fuelstat = fuelstat + stat wait "%" gosub findstat orgstat = orgstat +stat wait "%" gosub findstat equstat = equstat + stat wait "Computer" send "q" wait "Command" wait "?" wait ") :" return noscan: wait "." beep tpen = 3 print local print local "I couldn't get a report on one of these ports, aborting..." send "q" wait "Command" goto finishtwo findstat: stat$ = getline$(row + 1) stat$ = mid$(stat$ , 12 , 1) if stat$ == "B" stat = 1 else stat = 0 endif return