| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| M()m Questions.... https://mail.black-squirrel.com/viewtopic.php?f=15&t=19975 |
Page 1 of 1 |
| Author: | NjoY [ Sat Nov 03, 2007 1:50 pm ] |
| Post subject: | |
Hiya all. M()mbot.. A few quick questions for you all. If i wanted M()mbot to load scripts and/or a few lines of code after loading or relogging where's the best place to put them?? Obviously i dont want to do anything that will alter the Mode i was in. (Relogging only) Also, i want to edit some scripts to make them work better with m()mbot. In that i want to bypass any menu and/or imputs required. Im thinking of adding the variables needed to the script instead of the script asking for them. Am i on the right lines or am i missing something obvious?? Thanx for your time. NjoY |
|
| Author: | Mind Dagger [ Sat Nov 03, 2007 11:03 pm ] |
| Post subject: | |
There is no way currently to automatically run a script or code lines after startup or relog. Some scripts will automatically restart after a relog, but not all have this ability. If you are at the keys when you are relogging, you can have a set of scripts set to hot keys by pressing TAB-q. Here is the explanation from the manual: Code: [SCRIPT HOT KEYS] If you are going to use script hot keys, in your TWX directory you will need the following file: _MOM_HOTKEYSCRIPTS.TXT This file allows you to set paths for quick script loading. The file should be formatted something like this on each line: [path] [script name] Example: scripts/MOM/MOM_PDrop1_88.ts ""PDROP"" scripts/MOM/MOM_UnlimitedGridder2_07.ts ""UNLIM GRIDDER"" scripts/MOM/MOM_LoginKiller.ts ""LOGIN KILLER"" scripts/MOM/MOM_PlanetGridder1_25.ts ""PLANET GRIDDER"" scripts/MOM/MD_PlanetStripper.ts ""STRIPPER"" scripts/MOM/World_Planet_Stripper.ts ""WORLD PLANET STRIPPER"" scripts/2_WorldTrade.ts ""WORLD TRADE"" scripts/MOM/phx_SectorList.ts ""PHX SECTOR LIST"" scripts/MOM/MOM_GridClearing1_5.ts ""LIMP GRID"" When you download the bot, there is a manual and an example script showing how to modify a normal script into a bot module. Here is the code that is included: Code: # MD Planet Stripper #Turn off logging to speed up script while running logging off ###STEP 1 - LOAD any bot variables that your bot module will need.### #User's bot name# loadVar $bot_name #TRUE/FALSE Whether bot is loaded in an unlimited turns game# loadVar $unlimitedGame &nbs p; #Number of turns that user has put turn limit to# loadVar $bot_turn_limit &nb sp; #The entire command line as entered by the user ex. "strip all f"# loadVar $user_command_line #The first parameter of the command line ex. "all"# loadVar $parm1 #The second parameter of the command line# loadVar $parm2 #and so on...# loadVar $parm3 loadVar $parm4 loadVar $parm5 loadVar $parm6 loadVar $parm7 loadVar $parm8 ###END STEP 1### #QUIKSTATS grabs current prompt as well as all stats from the / key# gosub :quikstats setVar $startingLocation $CURRENT_PROMPT if (($startingLocation <> "Citadel") AND ($startingLocation <> "Planet")) send "'{" $bot_name "} - Planet Stripper must be started from Citadel or Planet prompt*" halt end ###STEP 2 - REPLACE menu - Take out any menu code from old script, and replace with bot parameters.### ###PRE-BOT CODE### # ;:menu_info # ;loadVar $MDProductMoverSaved # ;if ($MDProductMoverSaved) # ; loadVar $emptyFuel # ; loadVar $emptyOrganics # ; loadVar $emptyEquipment # ; loadVar $emptyFuelColonists # ; loadVar $emptyOrganicColonists # ; loadVar $emptyEquipmentColonists # ;else # ; setVar $emptyFuel FALSE # ; setVar $emptyOrganics FALSE # ; setVar $emptyEquipment FALSE # ; setVar $emptyFuelColonists FALSE # ; setVar $emptyOrganicColonists FALSE # ; setVar $emptyEquipmentColonists FALSE # ; # ; saveVar $emptyFuel # ; saveVar $emptyOrganics # ; saveVar $emptyEquipment # ; saveVar $emptyFuelColonists # ; saveVar $emptyOrganicColonists # ; saveVar $emptyEquipmentColonists # ; # ; setVar $MDProductMoverSaved TRUE # ; saveVar $MDProductMoverSaved # ;end # # ;addMenu "" "MDProductMover" ANSI_14&"MD Planet Stripper Options"&ANSI_7 "." "" "Main" FALSE # ;addMenu "MDProductMover" "Go" ANSI_15&"Start Mover" "G" :Menu_Go "" TRUE # ;addMenu "MDProductMover" "Fill" ANSI_15&"Planet to Fill &n bsp; " "1" :Menu_Fill "" False # ;addMenu "MDProductMover" "Empty" ANSI_15&"Planet(s) to Empty " "2" :Menu_Empty "" False # ;addMenu "MDProductMover" "Fuel" ANSI_15&" Fuel &n bsp; &n bsp; " "3" :Menu_Fuel "" FALSE # ;addMenu "MDProductMover" "Organics" ANSI_15&" Organics &nbs p; " "4" :Menu_Organics "" FALSE # ;addMenu "MDProductMover" "Equipment" ANSI_15&" Equipment &nb sp; " "5" :Menu_Equipment "" FALSE # ;addMenu "MDProductMover" "FuelColonists" ANSI_15&" Fuel Colonists &nb sp; " "6" :Menu_FuelColonists "" FALSE # ;addMenu "MDProductMover" "OrganicColonists" ANSI_15&" Organic Colonists " "7" :Menu_OrganicColonists "" FALSE # ;addMenu "MDProductMover" "EquipmentColonists" ANSI_15&" Equipment Colonists " "8" :Menu_EquipmentColonists "" FALSE # ; # ;setMenuHelp "Go" "Starts the script." # ;setVar $fillIndex 1 # ;setVar $emptyIndex 0 # ;gosub :sub_setmenu # ;setMenuOptions "MDProductMover" FALSE FALSE FALSE # ;echo ANSI_13 # ;openMenu "MDProductMover" # # ;:Menu_Fill # ; gosub :clearScreen # ; if ($fillIndex < $planetCount) # ; ;add $fillIndex 1 # ; else # ; ;setVar $fillIndex 1 # ; end # ; if ($emptyIndex = $fillIndex) # ; add $fillIndex 1 # ; if ($fillIndex > $planetCount) # ; ;setVar $fillIndex 1 # ; end # ;end # ;gosub :sub_setmenu # ;gosub :clearScreen # ;openMenu "MDProductMover" # # .....Etc. # Another 50 lines of old menu code would follow this. # I commented the old code out for illustrative purposes, feel free to delete it. ###END PRE-BOT CODE### ###BOT COMMAND LINE CODE### #If planet number is not a number or the keyword 'all' then quit# isNumber $test $parm1 if (($test = FALSE) AND ($parm1 <> "all")) send "'{" $bot_name "} - Invalid planet. Please enter a planet number or 'all'.*" halt end #Determines if a keyword exists in a user command line# getWordPos " "&$user_command_line&" " $pos " f " if ($pos > 0) setVar $emptyFuel TRUE else setVar $emptyFuel FALSE end getWordPos " "&$user_command_line&" " $pos " o " if ($pos > 0) setVar $emptyOrganics TRUE else setVar $emptyOrganics FALSE end getWordPos " "&$user_command_line&" " $pos " e " if ($pos > 0) setVar $emptyEquipment TRUE else setVar $emptyEquipment FALSE end getWordPos " "&$user_command_line&" " $pos " c1 " if ($pos > 0) setVar $emptyFuelColonists TRUE else setVar $emptyFuelColonists FALSE end getWordPos " "&$user_command_line&" " $pos " c2 " if ($pos > 0) setVar $emptyOrganicColonists TRUE else setVar $emptyOrganicColonists FALSE end getWordPos " "&$user_command_line&" " $pos " c3 " if ($pos > 0) setVar $emptyEquipmentColonists TRUE else setVar $emptyEquipmentColonists FALSE end getWordPos " "&$user_command_line&" " $pos " fc " if ($pos > 0) setVar $emptyFuelColonists TRUE else setVar $emptyFuelColonists FALSE end getWordPos " "&$user_command_line&" " $pos " oc " if ($pos > 0) setVar $emptyOrganicColonists TRUE else setVar $emptyOrganicColonists FALSE end getWordPos " "&$user_command_line&" " $pos " ec " if ($pos > 0) setVar $emptyEquipmentColonists TRUE else setVar $emptyEquipmentColonists FALSE end ###END BOT COMMAND LINE CODE### ### The rest of this script is essentially the same code as the standalone script. I added the bot name ### ### to all the subspace messages just because I like the bot to be consistent. It is by no means ### ### necessary. &n bsp; &n bsp; &n bsp; &n bsp; &n bsp; &n bsp; &n bsp; &n bsp; &n bsp; ### ### All you need to do to make your script a bot module/command is compile it and name it whatever you want it's ### ### command to be. ex. strip.cts for the command to be strip. Then place it within whatever category folder ### ### makes the most sense. In this case I put it in MOMBot/Modes/Resource &nb sp; &nb sp; &nb sp; &nb sp; ### if ($startingLocation = "Citadel") send "q " end gosub :getPlanetInfo send "q ** " gosub :quikstats if (SECTOR.PLANETCOUNT[$CURRENT_SECTOR] <= 1) send "'{" $bot_name "} - This script must be run with at least two planets in the sector*" send "l "&$planet&"* " if ($startingLocation = "Citadel") send "c " end halt end gosub :countPlanets :startUpMessage setVar $planetToFill $PLANET if ($parm1 <> "all") setVar $planetCount 1 setVar $planets[1] $parm1 end send "'{" $bot_name "} - Planet Stripper Powering Up! Filling Planet "&$planetToFill&"*" :startFilling setVar $i 1 setVar $countFuel 0 setVar $countOrganics 0 setVar $countEquipment 0 setVar $countColonists 0 setVar $coloType 1 :lookUpPlanetStats send "l "&$planetToFill&"*" killAllTriggers setTextLineTrigger wrongPlanet :badPlanet "That planet is not in this sector." setTextLineTrigger badPlanet :badPlanet "Invalid registry number, landing aborted." setTextLineTrigger goodPlanet :goodPlanet "Claimed by:" pause :badPlanet killAllTriggers send "q*" send "'{" $bot_name "} - Planet #"&$planetToFill&" is not valid for this sector*" halt :goodPlanet killAllTriggers waiton "Fuel Ore" getWord CURRENTLINE $currentFuelColos 3 stripText $currentFuelColos "," setVar $currentFuel $planet_fuel waiton "Organics" getWord CURRENTLINE $currentOrganicColos 2 stripText $currentOrganicColos "," setVar $currentOrganics $planet_organics waiton "Equipment" getWord CURRENTLINE $currentEquipmentColos 2 stripText $currentEquipmentColos "," setVar $currentEquipment $planet_equipment send "q " while ($i <= $planetCount) if ($planetToFill <> $planets[$i]) :tryFuel killAllTriggers if ($emptyFuel) send "l j"&$planets[$i]&"* jt*jt1* x q l j"&$planetToFill&"* jt*jl1* x q " setTextTrigger fuelSuccess :tryFuel "You load the " ; ; setTextTrigger fuelEmpty :tryOrganics "There aren't that many " setTextTrigger fuelFull :emptyFuel "They don't have room for that many " pause end :emptyFuel send "jy " :tryOrganics killAllTriggers if ($emptyOrganics) send "l j"&$planets[$i]&"* jt*jt2* x q l j"&$planetToFill&"* jt*jl2* x q " setTextTrigger success :tryOrganics "You load the " setTextTrigger emptyEmpty :tryEquipment "There aren't that many " setTextTrigger fullFill :emptyOrganics "They don't have room for that many " pause end :emptyOrganics send "jy " :tryEquipment killAllTriggers if ($emptyEquipment) send "l j"&$planets[$i]&"* jt*jt3* x q l j"&$planetToFill&"* jt*jl3* x q " setTextTrigger success :tryEquipment "You load the " setTextTrigger emptyEmpty :tryFuelColonists "There aren't that many " setTextTrigger fullFill :emptyEquipment "They don't have room for that many " pause end :emptyEquipment send "jy " :tryFuelColonists killAllTriggers if ($emptyFuelColonists) send "l j"&$planets[$i]&"* js*jt1* x q l j"&$planetToFill&"* js*jl"&$coloType&"* x q " setTextTrigger success :tryFuelColonists "The Colonists disembark to " setTextTrigger emptyEmpty :switchFuel "There isn't room on the planet" setTextTrigger fullFill :tryOrganicColonists "They don't have room for that many " setTextTrigger empty :emptyFColonists "There aren't that many on the planet!" pause :switchFuel killAllTriggers add $coloType 1 if ($coloType >= 4) goto oneWithThisPlanet end goto :tryFuelColonists end :emptyFColonists send "jy " :tryOrganicColonists killAllTriggers if ($emptyOrganicColonists) send "l j"&$planets[$i]&"* js*jt2* x q l j"&$planetToFill&"* js*jl"&$coloType&"* x q " setTextTrigger success :tryOrganicColonists "The Colonists disembark to " setTextTrigger emptyEmpty :switchOrganics "There isn't room on the planet" setTextTrigger fullFill :tryEquipmentColonists "They don't have room for that many " setTextTrigger empty :emptyOColonists "There aren't that many on the planet!" pause :switchOrganics killAllTriggers add $coloType 1 if ($coloType >= 4) goto oneWithThisPlanet end goto :tryOrganicColonists end :emptyOColonists send "jy " :tryEquipmentColonists killAllTriggers if ($emptyEquipmentColonists) send "l j"&$planets[$i]&"* js*jt3* x q l j"&$planetToFill&"* js*jl"&$coloType&"* x q " setTextTrigger success :tryEquipmentColonists "The Colonists disembark to " setTextTrigger emptyEmpty :switchEquipment "There isn't room on the planet" setTextTrigger fullFill oneWithThisPlanet "They don't have room for that many " setTextTrigger empty oneWithThisPlanet "There aren't that many on the planet!" pause :switchEquipment killAllTriggers add $coloType 1 if ($coloType >= 4) goto oneWithThisPlanet end goto :tryEquipmentColonists end oneWithThisPlanet end add $i 1 end :lookUpPlanetStats2 send "l "&$planetToFill&"*" killAllTriggers setTextLineTrigger wrongPlanet :badPlanet2 "That planet is not in this sector." setTextLineTrigger badPlanet :badPlanet2 "Invalid registry number, landing aborted." setTextLineTrigger goodPlanet :goodPlanet2 "Claimed by:" pause :badPlanet2 killAllTriggers send "q*" send "'{" $bot_name "} - Planet #"&$planetToFill&" is not valid for this sector*" halt :goodPlanet2 killAllTriggers waiton "Fuel Ore" getWord CURRENTLINE $newFuelColos 3 stripText $newFuelColos "," getWord CURRENTLINE $newFuel 6 stripText $newFuel "," waiton "Organics" getWord CURRENTLINE $newOrganicColos 2 stripText $newOrganicColos "," getWord CURRENTLINE $newOrganics 5 stripText $newOrganics "," waiton "Equipment" getWord CURRENTLINE $newEquipmentColos 2 stripText $newEquipmentColos "," getWord CURRENTLINE $newEquipment 5 stripText $newEquipment "," send "q " gosub :endReport send "/" waitOn #179 send "'{" $bot_name "} - Planet Stripper Shutting Down*" halt :clearScreen echo #27 & "[2J" return :countPlanets setVar $planetCount 0 killalltriggers setTextLineTrigger planetGrabber lanetline " <" setTextLineTrigger beDone one "Land on which planet " send "lq*" pause lanetline killalltriggers setVar $line CURRENTLINE replacetext $line "<" " " replacetext $line ">" " " striptext $line "," add $planetCount 1 getWord $line $planets[$planetCount] 1 setTextLineTrigger getLine2 lanetline " <" setTextLineTrigger getEnd one "Land on which planet " pause one return :quikstats setVar $CURRENT_PROMPT "Undefined" killtrigger noprompt killtrigger prompt1 killtrigger prompt2 killtrigger prompt3 killtrigger prompt4 killtrigger statlinetrig killtrigger getLine2 setTextLineTrigger prompt :allPrompts & nbsp; #145 & #8 setTextLineTrigger statlinetrig :statStart #179 send #145&"/" pause :allPrompts getWord CURRENTLINE $CURRENT_PROMPT 1 stripText $CURRENT_PROMPT #145 stripText $CURRENT_PROMPT #8 #getWord currentansiline $checkPrompt 1 #getWord currentline $tempPrompt 1 #getWordPos $checkPrompt $pos "[35m" #if ($pos > 0) # ;setVar $CURRENT_PROMPT $tempPrompt #end setTextLineTrigger prompt :allPrompts & nbsp; #145 & #8 pause :statStart killtrigger prompt killtrigger prompt2 killtrigger prompt3 killtrigger prompt4 killtrigger noprompt setVar $stats "" setVar $wordy "" :statsline killtrigger statlinetrig killtrigger getLine2 setVar $line2 CURRENTLINE replacetext $line2 #179 " " striptext $line2 "," setVar $stats $stats & $line2 getWordPos $line2 $pos "Ship" if ($pos > 0) goto :gotStats else setTextLineTrigger getLine2 :statsline pause end :gotStats setVar $stats $stats & " @@@" setVar $current_word 0 while ($wordy <> "@@@") if ($wordy = "Sect") getWord $stats $CURRENT_SECTOR &nb sp;($current_word + 1) elseif ($wordy = "Turns") getWord $stats $TURNS ($current_word + 1) elseif ($wordy = "Creds") getWord $stats $CREDITS ($current_word + 1) elseif ($wordy = "Figs") getWord $stats $FIGHTERS ($current_word + 1) elseif ($wordy = "Shlds") getWord $stats $SHIELDS ($current_word + 1) elseif ($wordy = "Hlds") getWord $stats $TOTAL_HOLDS ($current_word + 1) elseif ($wordy = "Ore") getWord $stats $ORE_HOLDS ($current_word + 1) elseif ($wordy = "Org") getWord $stats $ORGANIC_HOLDS &nbs p; ($current_word + 1) elseif ($wordy = "Equ") getWord $stats $EQUIPMENT_HOLDS &n bsp; ($current_word + 1) elseif ($wordy = "Col") getWord $stats $COLONIST_HOLDS &nb sp; ($current_word + 1) elseif ($wordy = "Phot") getWord $stats $PHOTONS ($current_word + 1) elseif ($wordy = "Armd") getWord $stats $ARMIDS ($current_word + 1) elseif ($wordy = "Lmpt") getWord $stats $LIMPETS ($current_word + 1) elseif ($wordy = "GTorp") getWord $stats $GENESIS ($current_word + 1) elseif ($wordy = "TWarp") getWord $stats $TWARP_TYPE ($current_word + 1) elseif ($wordy = "Clks") getWord $stats $CLOAKS ($current_word + 1) elseif ($wordy = "Beacns") getWord $stats $BEACONS ($current_word + 1) elseif ($wordy = "AtmDt") getWord $stats $ATOMIC ($current_word + 1) elseif ($wordy = "Corbo") getWord $stats $CORBO ($current_word + 1) elseif ($wordy = "EPrb") getWord $stats $EPROBES ($current_word + 1) elseif ($wordy = "MDis") getWord $stats $MINE_DISRUPTORS &n bsp;($current_word + 1) elseif ($wordy = "PsPrb") getWord $stats $PSYCHIC_PROBE ($current_word + 1) elseif ($wordy = "PlScn") getWord $stats $PLANET_SCANNER ($current_word + 1) elseif ($wordy = "LRS") getWord $stats $SCAN_TYPE ($current_word + 1) elseif ($wordy = "Aln") getWord $stats $ALIGNMENT ($current_word + 1) elseif ($wordy = "Exp") getWord $stats $EXPERIENCE ($current_word + 1) elseif ($wordy = "Corp") getWord $stats $CORP ($current_word + 1) elseif ($wordy = "Ship") getWord $stats $SHIP_NUMBER ($current_word + 1) end add $current_word 1 getWord $stats $wordy $current_word end oneQuikstats killtrigger prompt1 killtrigger prompt2 killtrigger prompt3 killtrigger prompt4 killtrigger statlinetrig killtrigger getLine2 return # ============================== END QUICKSTATS SUB============================== :endReport setVar $formattedCountFuel "" setVar $countFuel ($newFuel - $currentFuel) getLength $countFuel $length while ($length > 3) cutText $countFuel $snippet $length-2 9999 cutText $countFuel $countFuel 1 $length-3 getLength $countFuel $length setVar $formattedCountFuel ","&$snippet&$formattedCountFuel end setVar $formattedCountFuel $countFuel&$formattedCountFuel setVar $formattedCountOrganics "" setVar $countOrganics ($newOrganics - $currentOrganics) getLength $countOrganics $length while ($length > 3) cutText $countOrganics $snippet $length-2 9999 cutText $countOrganics $countOrganics 1 $length-3 getLength $countOrganics $length setVar $formattedCountOrganics ","&$snippet&$formattedCountOrganics end setVar $formattedCountOrganics $countOrganics&$formattedCountOrganics MD |
|
| Author: | Zarkahn [ Mon Nov 05, 2007 9:16 am ] |
| Post subject: | |
heh Njoy... be a little more specfic in what ur wanting... I've modded a few scripts for the bot and added some... Best way i found to have them keep going is a seperate area for when disconnected... wait for the mombot messages to finish... then it needs to decide where u are and if on the right planet... ex. :conlost killalltriggers settexttrigger momnoplan :mom "No Planet in Sector!" settexttrigger momplan :mom "- In Cit - Planet" settexttrigger momwrongplan :mom "Incorrect Planet Number" pause :mom killalltriggers send "'Mombot Override Engaged, Resuming*" waitfor "Message sent" goto :main now thats not spoof proof or nothing, just a basic way to wait for mombot to finish relogging in... You can always add a SS radio check and a word count to help against spoofing.. |
|
| Author: | NjoY [ Wed Nov 14, 2007 5:34 pm ] |
| Post subject: | |
Mind Dagger wrote: ###STEP 1 - LOAD any bot variables that your bot module will need.### #User's bot name# loadVar $bot_name #TRUE/FALSE Whether bot is loaded in an unlimited turns game# loadVar $unli mitedGame &nbs p; #Number of turns that user has put turn limit to# loadVar $bot_ turn_limit &nb sp; #The entire command line as entered by the user ex. "strip all f"# loadVar $user_command_line #The first parameter of the command line ex. "all"# loadVar $parm 1 #The second parameter of the command line# loadVar $parm 2 #and so on...# loadVar $parm 3 loadVar $parm4 loadVar $parm5 loadVar $parm6 loadVar $parm7 loadVar $parm8 ###END STEP 1### Thats exactly what i wanted. Many thanx. Zark, i cant be too specific... most of the info i need will be used against u laff by separate area do you mean a separate script?? Thats what i was thinking of but i wanted it to autorun every time i relogged or started m()m I've got 1 already that i have to run manually that has some security and help scripts... but nothing to monitor connection or anything. it is a systemscript so it doesnt shut off that much. I got some scripts i want to add.... One i was thinking of is to warp a planet away whilst ur erm.. i mean.. the other player is killing the planet figs. Therefor taking them away from their reloader planet. Then citkill them. I had a few issues with that... especially when all the planets are named the same. <any ideas any1?? without landing on each planet in the sector> Still playing with that. But still not sure if thats the best method for defending planets will be funny tho lol. Thanx both of you for ya help. PS MD... I'd love to see YOUR m()m laff |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|