# Script Name : The Cabal's Probe Script # Author : Traitor # Description : Ether Probe script for mapping. # What it does : This script is an advanced Ether Probe Script. It is configurable so # : you can probe sectors from your unexplored, or from a file. It also # : has options to ignore sectors with your deployed figs, or sectors # : with visible ports (from your CIM). It also is smart enough to # : not probe sectors it's already seen. You can probe the a 5000 # : sector universe from start to finish for less than 8 mill if you # : do the dead ends first. (assuming a stockish bang) This will get # : you 99.98% of the sectors probed on a clear board. Much cheaper # : than if you probed from 1 to 5000 (15 mil!) This is also good for # : keeping tabs on sectors with no ports, likely places for bases. # Notes : You must be at SD for this to work. # : IF YOU ARE RUNNING SWATH OR A SIMILAR HELPER, YOU *MUST* TURN OFF THE # : HELPER FEATURE!!! Otherwise, you may end up going on a wild goose # : chase. You were warned :-) # : TURN OFF ANIMATIONS!! (CN2) # : Turn of ANSI. Runs faster. (CN1) # : Silence messages! (|) Have a corpie on-line with you to be sure # : some joker doesn't surround SD with figs while you are probing. # : The script doesn't check for that. # : When you selsect to pull sectors from file, the file must be named # : probesec.txt (or whatever you call it) and be in the TWX directory. # : Use only one sector per line in probesec.txt # : While the script is building the array, it may appear that it isn't # : doing anything. The array can take a few minutes to build. Give it # : time, especially if there are more than 5000 sectors in the universe. # : Also, when probing, it may appear to pause between probes. This is # : normal, as it is walking down the array to determine if a probe is # : needed. This script can take up to 15-30 min to run from start to # : finish if you are probing every sector, or if you have a slow PC or # : slow connection. Be patient, and get some coffee. :-) # : You can change the total number of sectors by adjusting the value of # : $totalsec below. Follow the instructions. # : This script creates a bunch of voids. You may need to clear them out # : when you are done probing. The voided sectors will be tracked by the # : date-p_dest.txt file if you need to look them up. # About the : date-enemy.txt is the list of all sectors that it could either not # files it : probe, or where the probe was destroyed in the destination sector. # makes. : This is handy for when you are probing dead-ends, and it's the file # : that I check first. Most enemy bases will show up in this file. # : date-p_dest.txt is the list of all sectors where a probe was destroyed # : as well as what sector you were trying to probe when it was destroyed. # : This is sometimes handy when you are looking for enemy bases too. # : date-planet.txt is the list of all sectors that have planets in them. # : You will get some duplicates, but you can use a database or spread- # : sheet to eliminate the dupes. # : date-trader.txt is the list of all visible traders (players). # : You will get some duplicates, but you can use a database or spread- # : sheet to eliminate the dupes. # : date-ship.txt is the list of all visible empty ships. # : You will get some duplicates, but you can use a database or spread- # : sheet to eliminate the dupes. # : date-mine.txt is the list of all visible mines. # : You will get some duplicates, but you can use a database or spread- # : sheet to eliminate the dupes. # : date-skipsec.txt is the list of all sectors skipped by the script. # : This is for debugging. Shows you how efficient the script is. # : date-probed.txt is the list of all sectors probes. # : This is for debugging. # : date-ignorefig.txt and date-ignoreport.txt is the list of all figged # : sectors (yours) and all visible ports that the script ignored. # : This is for debugging. # ----====[ TOTAL SECTORS ]====---- # Here is where you change the total number of sectors. # Make $totalsec = Total Number of Sectors in the game setvar $totalsec 5000 # ----====[ Prompt Checks! ]====---- # Checks to make sure you are starting at the Command Prompt # It's pretty standard fare for most scripts. # In my corp, it's known as the 'Dreaded Moron Prompt'. :) cutText CURRENTLINE $location 1 7 if ($location <> "Command") echo ANSI_12 "***Must be run from the command menu, moron!**" halt end # ====[ Check to see if at SD, and get SD sector number ]==== # This checks to be sure that you are at the Stardock. gettext CURRENTLINE $sdsector "]:[" "] (" if $sdsector = STARDOCK goto :turnonlog else echo "**" ANSI_15 "YOU MUST BE AT STARDOCK!!" halt end # ----====[ Turn on Logging ]====---- # Turning on TWX logging. It's on by default, but I put it in here # just to be sure. :turnonlog logging on # ----====[ show EGO banner :-) ]====---- echo "**" ANSI_1 " --" ANSI_9 "===| " ANSI_11 "The Cabal's Probe Script v3.0.1" ANSI_9 " |===" ANSI_1 "--*" echo ANSI_1 " --" ANSI_9 "===| " ANSI_11 "Last edited June 26, 2003" ANSI_9 " |===" ANSI_1 "--*" echo ANSI_1 " --" ANSI_9 "===| " ANSI_11 "By " ANSI_12 "Traitor" ANSI_9 " |===" ANSI_1 "--**" echo ANSI_10 " This script is freeware and may be distributed.*" echo "*" ANSI_13 "!!! Please read the Notes and Warnings at the top of the script before using !!!*" echo ANSI_10 "*** NOW TWX V2.X compatable!!**" ANSI_7 # ----====[ Get Timestamp Info ]====---- # I use replacetext because I want dashes instead of slashes in the # file names. getdate $date gettime $time replacetext $date "/" "-" # ----====[ BEGINNING OF MENU SECTION ]====---- # Sets up key variables based on input from the user. # This menu system is here to show you how menus work. It could be # more streamlined, but I have chosen to make it more complicated so # you can see some of the things you can do with menus. Please note # how I use getMenuValue to check for the use file option, but I use # more traditional methods for the fig and port options. This was # done on purpose to show you how to use getMenuValue. echo "**" :getuserinfo # ====[ Initialize Starting Variables ]==== setvar $usefile "y" setvar $avoidfigs "y" setvar $avoidports "y" setvar $filename "probesec.txt" # ====[ Create the Menu]==== # This creates the menu "Probe". The selections A, C, & D are toggles # for either 'y' or 'n'. Selection B brings up a prompt where you can # change the name of the file. It checks to make sure the file exists. # The FALSE statements at the end of most of the menu lines tell TWX that # I want to keep using the menu. If you set them to TRUE, the menu will # close out after you select an item. Only use TRUE when you are done # with the menu. # NOTE: you have to have some kind of hotkey for ALL menu entries. # This is why I used "." for the hotkey for "Probe". addMenu "" "Probe" "Probe Setup" "." "" "Probe" FALSE addMenu "Probe" "Execute" "Start Probing!" "Z" :Menu_Exec "" TRUE addMenu "Probe" "usefile" "Probe from File" "A" :Menu_Usefile "" FALSE addMenu "Probe" "figs" "Ignore sectors with figs" "C" :Menu_Figs "" FALSE addMenu "Probe" "ports" "Ignore visible ports" "D" :Menu_Ports "" FALSE addMenu "Probe" "filename" "Change Current Filename" "B" :Menu_changefile "" FALSE # ====[ Set the menu values ]==== # Note how I can use either variables OR text to set the menu values # You can also use numbers if you want. setmenuvalue "usefile" $usefile setmenuvalue "figs" "y" setmenuvalue "ports" $avoidports setmenuvalue "filename" $filename # ====[ Set the menu options ]==== # This is the proper syntax for the setMenuOptions command. There are # no examples for it. I don't really need it here, I just put it in so # you can see how it's supposed to look. In this case, I am turning off # the ? (command list). No big deal. setmenuoptions "Probe" TRUE FALSE TRUE # ====[ Set the menu HELP ]==== # The help must all fit on one line. There may or may not be a limit to # the length of a help item. I have gone over 500 characters on my W2K # box without any problems, so it's big enough for most things. setmenuhelp "Probe" "This menu configures the Probe Script Settings." setmenuhelp "Execute" "This starts the script!" setmenuhelp "Usefile" "When this is set to ON, it will pull the sector numbers to be probed from a file, probesec.txt When set to OFF, the script will probe your unexplored sectors." setmenuhelp "Figs" "If this is set to ON, it will ignore sectors with your personal or corp figs in them. When it's set to OFF, it will probe sectors that contain your personal or corp figs." setmenuhelp "ports" "if this is set to ON, it will ignore sectors with visible ports. This info is pulled from your CIM. When it's set to OFF, it will probe sectors with visible ports." setmenuhelp "filename" "This is where you set the file name for the script to use for probing, if you are pulling sectors from a file." # ====[ Open the menu ]==== # this actually activates the menu. openMenu "Probe" # ====[ Menu_exec, when you press "Z", you go here ]==== :Menu_Exec echo "*Usefile: " & $usefile echo "*File Name: " & $filename echo "*Avoid Figs: " & $avoidfigs echo "*Avoid Ports: " & $avoidports goto :definearray # ====[ Menu_Usefile, when you press "A", you go here ]==== :Menu_Usefile getmenuvalue "usefile" $usefile if $usefile = "y" setmenuvalue "usefile" "n" openmenu "Probe" else setmenuvalue "usefile" "y" openmenu "Probe" end # ====[ Menu_changefile, when you press "B", you go here ]==== :Menu_changefile getinput $filename "Enter the new file name: " setmenuvalue "filename" $filename fileexists $test $filename if $test = FALSE echo "***" ANSI_15 $filename " not found, try again.**" openmenu "Probe" else echo "***file exists, using: " $filename "**" openmenu "probe" end # ====[ Menu_figs, when you press "C", you go here ]==== :Menu_Figs if $avoidfigs = "y" setvar $avoidfigs "n" setmenuvalue "figs" $avoidfigs openmenu "Probe" else setvar $avoidfigs "y" setmenuvalue "figs" $avoidfigs openmenu "Probe" end # ====[ Menu_ports, when you press "D", you go here ]==== :Menu_Ports if $avoidports = "y" setvar $avoidports "n" setmenuvalue "ports" $avoidfigs openmenu "Probe" else setvar $avoidports "y" setmenuvalue "ports" $avoidfigs openmenu "Probe" end # ----====[ END OF MENU SECTION ]====---- # ----====[ Setup the Array ]====---- :definearray setarray $sector $totalsec getmenuvalue "usefile" $usefile if $usefile = "y" goto :makearrayfile else goto :makearrayunex end # ====[ Setup Array ($sector[]) to probe from Unexplored Sectors ]==== # this is my klugey way of pulling in the unexplored sector list. # there is probably a better way of doing it, but since this works, # I have found no reason to change it. # Since the unexplored list always has 11 numbers per line, I count # to 11, then go to the next line. :makearrayunex send "cku" waitfor "sectors" :getuexarray setvar $wordnum 1 # echo "**" ANSI_15 "At :getuexarray*" settexttrigger 30 :parseunexdone "Computer command" settextlinetrigger 31 :parseunex " " pause :parseunex killalltriggers getword CURRENTLINE $unexsec $wordnum if $unexsec = 0 goto :getuexarray end setvar $sector[$unexsec] 1 if $wordnum = 11 goto :getuexarray end add $wordnum 1 goto :parseunex :parseunexdone echo "**" ANSI_15 "*At :parseunexdone*" killalltriggers send "qd" waitfor "Command" goto :makelogs # ====[ Make Array ($sector[]) to probe from File ]==== :makearrayfile echo "**" ANSI_15 "At :makearrayfile*" echo "*Please wait while the script reads the file and builds the array*" setvar $fileline 1 :fileloop read $filename $probesec $fileline if $probesec = EOF echo "**" ANSI_15 "Array built!*" goto :makelogs else setvar $sector[$probesec] 1 add $fileline 1 goto :fileloop # ====[ Setup Logging Files ]==== # This is where I create the log files. They will appear in # the LOGS subdirectory under the TWX directory. Each of these # files is date and time stamped. They are lists of sector # numbers that you can use the TWX database ($DS) to display # the sector. :makelogs echo "**" ANSI_15 "At :makelogs*" # The following line creates the date-enemy.txt file setvar $enemyfile "logs\" & $date & "-enemy.txt" write $enemyfile $time # The following line creates the date-skipsec.txt file setvar $skipfile "logs\" & $date & "-skipsec.txt" write $skipfile $time # The following line creates the date-p_dest.txt file setvar $pdestfile "logs\" & $date & "-p_dest.txt" write $pdestfile $time # The following line creates the date-planet.txt file setvar $planetfile "logs\" & $date & "-planet.txt" write $planetfile $time # The following line creates the date-trader.txt file setvar $traderfile "logs\" & $date & "-trader.txt" write $traderfile $time # The following line creates the date-ship.txt file setvar $shipfile "logs\" & $date & "-ship.txt" write $shipfile $time # The following line creates the date-mine.txt file setvar $minefile "logs\" & $date & "-mine.txt" write $minefile $time # The following line creates the date-probed.txt file setvar $probedfile "logs\" & $date & "-probed.txt" write $probedfile $time # The following line creates the date-ignorefig.txt file setvar $ignorefig "logs\" & $date & "-ignorefig.txt" write $ignorefig $time # The following line creates the date-ignoreport.txt file setvar $ignoreport "logs\" & $date & "-ignoreport.txt" write $ignoreport $time # ====[ Skipping figs and visible ports? ]==== if $avoidfigs = "y" gosub :getfigs end if $avoidports = "y" gosub :getports end # ====[ Set other Vars ]==== # Sets the costs for buying more probes. IF they cost more, or # your ship holds more or less than usual, set those values here! :setothervars # $probecost is equal to the cost for one probe. setvar $probecost 3000 # $maxprobes is equal to the total number of probes you ship can hold. setvar $maxprobes 25 setvar $maxprobecost $probecost multiply $maxprobecost $maxprobes # This makes sure you don't try to probe the SD sector, # by zeroing out the value of $sector[Stardock] setvar $sector[$sdsector] 0 # ====[ Getting user & ship info ]==== send "/" settextlinetrigger 11 :getprobeqty "Prb" pause :getprobeqty killtrigger 11 gettext CURRENTLINE $probeqty "Prb " #179 & "MDis" if $probeqty = 0 gosub :getmoreprobes end # ----====[ Main Probing Routine ]====---- :probing killalltriggers echo "**" ANSI_15 "At :probing*" setvar $count 1 :launch if $count > $totalsec goto :alldone end if $sector[$count] = 0 write $skipfile $count add $count 1 goto :launch elseif $sector[$count] = 2 add $count 1 goto :launch elseif $sector[$count] = 3 add $count 1 goto :launch elseif $sector[$count] = 1 send "e" settexttrigger 20 :noprobe "You do not have any Ether Probes" settexttrigger 21 :haveprobe "Please enter a destination" pause :noprobe killtrigger 20 killtrigger 21 gosub :getmoreprobes goto :launch :haveprobe killtrigger 20 killtrigger 21 write $probedfile $count send $count "*" :probetriggers settexttrigger 22 :probeenter "Probe entering sector" settexttrigger 23 :noroute "Error" pause :probeenter getword CURRENTLINE $currsec 5 killtrigger 22 killtrigger 23 killtrigger 26 killtrigger 28 killtrigger 40 killtrigger 41 killtrigger 42 killtrigger 43 settexttrigger 25 :probedestroyed "Probe Destroyed!" settexttrigger 27 :probecontinue "Sector" pause :probedestroyed killtrigger 25 killtrigger 27 setvar $sector[$currsec] 2 if $currsec = $count write $enemyfile $count end write $pdestfile "Trying to probe: " & $count & " but probe destroyed here: " & $currsec send "cv" $currsec "*q" goto :launch :probecontinue killtrigger 25 killtrigger 27 setvar $sector[$currsec] 0 settexttrigger 40 :seeplanet "Planets :" settexttrigger 41 :seetrader "Traders :" settexttrigger 42 :seeship "Ships :" settexttrigger 43 :seemine "Mines :" settexttrigger 26 :probecby "Probe Self Destructs" settexttrigger 28 :probeenter "Probe entering sector" pause :seeplanet killalltriggers write $planetfile $currsec goto :probecontinue :seetrader killalltriggers write $traderfile $currsec goto :probecontinue :seeship killalltriggers write $shipfile $currsec goto :probecontinue :seemine killalltriggers write $minefile $currsec goto :probecontinue :probecby killalltriggers setvar $sector[$currsec] 0 waitfor "Command" add $count 1 goto :launch :noroute killtrigger 22 killtrigger 23 write $enemyfile $count send "n*" add $count 1 goto :launch end # ====[ All Done ]==== :alldone echo "**" ANSI_10 "ALL DONE!!*" ANSI_7 echo "*Start Time: " $time "*" gettime $time echo "*End Time: " $time "**" send "d" halt # ====[ Get More Probes from SD sub-routine ]==== :getmoreprobes echo "**" ANSI_15 "At :getmoreprobes*" send "/" settextlinetrigger 90 :getcredits "Creds" pause :getcredits killtrigger 90 gettext CURRENTLINE $credits "Creds " #179 & "Figs" striptext $credits "," if $maxprobecost > $credits echo "**" ANSI_15 "NOT ENOUGH CASH TO CONTINUE, Halting script" halt end send "pshe" $maxprobes "*qq" return # ----====[ Build Figs into Array sub-routine ]====---- # Putting in "0" in array for all sectors that have figs :getfigs send "g" WaitFor "===" SetTextLineTrigger 51 :makefigarray "Toll" SetTextLineTrigger 54 :makefigarray "Defensive" SetTextLineTrigger 55 :makefigarray "Offensive" SetTextTrigger 53 :gotfigs "Command" Pause :makefigarray KillTrigger 51 KillTrigger 54 KillTrigger 55 GetWord CURRENTLINE $figsec 1 write $ignorefig $figsec setvar $sector[$figsec] 0 SetTextLineTrigger 51 :makefigarray "Toll" SetTextLineTrigger 54 :makefigarray "Defensive" SetTextLineTrigger 55 :makefigarray "Offensive" pause :gotfigs killtrigger 53 killtrigger 51 killtrigger 54 killtrigger 55 return # ----====[ Build visible ports into Array sub-routine ]====---- # Putting in "0" in array for all sectors that have visible ports :getports # send "d" # waitfor "Command" send "^" waitfor ":" setdelaytrigger 66 :getreport 1000 pause :getreport killtrigger 66 send "r" settextlinetrigger 61 :addportarray "%" pause :addportarray killtrigger 61 killtrigger 62 getword CURRENTLINE $portsec 1 write $ignoreport $portsec setvar $sector[$portsec] 0 settextlinetrigger 61 :addportarray "%" settexttrigger 62 :gotports ":" pause :gotports killtrigger 61 killtrigger 62 echo "*got ports*" send "q" waitfor "Command" return halt