| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Inefficent Tmilker .ts (with user Specified holds) https://mail.black-squirrel.com/viewtopic.php?f=15&t=21202 |
Page 1 of 2 |
| Author: | Kaus [ Sun Nov 23, 2008 12:31 am ] |
| Post subject: | Inefficent Tmilker .ts (with user Specified holds) |
I wrote this for anyone who has the need (wink: RajuAbju) as I was bored at work and had allot of it previously written(TFarmer). There is no assumption of safety with this script outside of it working which I tested on my private server prior to posting it here. Feel free to improve or be the critic. Let me know if you have any serious issues. For those that care I am rewriteing TerraFarmer (Making it more modern if you will) and adding a bunch of functions I allways wanted to but never had the time to. -Kaus DL from RapidShare http://rapidshare.com/files/166491567/I ... er.ts.html Or Grimy if you can get it to load http://www.grimytrader.com/GrimyScriptS ... ink_id=640 ----- ####Inefficent Tmilker ###By: Kaus ##Will Twarp to Terra and pick up user defined coloamount #Macro pickup/return. No twarp protection Code: Setvar $Terra 1 Setvar $Home CURRENTSECTOR Echo "**SCRIPT ASSUMES YOU HAVE A VALID ZTM!!!" Echo "*YOU MUST BE BLUE 1000 PLUS ALIGN/HAVE A FIG/PLANET IN YOUR SECTOR" GetInput $PlanetNum "Which Planet?" GetInput $ColoAmt "Amount of colonists to grab per landing?" GetInput $Cycles "Amount of Cycles (Times between Terra and your Base) you want this to run?" Send "*" #---------Prompt Check--------------- Getword CURRENTLINE $PromptCheck 1 If ($Promptcheck <> "Command") Echo "**Must Start From Command Prompt!!!" Halt End #--------CN9 Check------------------- Send "Cn" setTextLineTrigger cnAni :CNAni "Animation display" pause :CNAni GetWord CURRENTLINE $Display 5 If ($Display = "On") Send "n2qq" Else Send "qq" end Send "Cn" setTextLineTrigger cnKeys :cnKeys " Abort display" pause :cnKeys GetWord CURRENTLINE $Display1 7 If ($Display1 = "ALL") Send "n9qq" Else Send "qq" end #---------Calc Distance/Set Macro---- Getdistance $route $Home $Terra Getdistance $route1 $Terra $Home Multiply $route 3 Multiply $route1 3 Add $route2 ($route + $route1) Send "jy" Setvar $Macro1 "l " & $planetnum & "* t n t 1 " & $route2 & "* q m " & $Terra & "* y y " Setvar $Macro2 "m " & $home & "* y y l " & $Planetnum & "* s n l 1 * " #---------Check Hold Number-------- Settextlinetrigger Holds :Holds "³Hlds" Send "*" Waitfor "Command [TL" Send "/" pause :Holds Getword CURRENTLINE $Holds 7 Striptext $Holds "³Ore" killtrigger Holds Setvar $Holds1 $Holds Subtract $holds1 10 #---------Main Code----------------- :Go If ($Cycles = 0) Halt end Send $Macro1 #--------Start Land Sequence Loop---- :Go1 setDelayTrigger delay :Cont 1000 pause :Cont killtrigger delay #--------Check Colos----------------- Settextlinetrigger colo :colo "There are currently" Send "l1*" Pause :colo killtrigger colo #------Check For Spoof--------------- GetWord CURRENTLINE $Spoof2 1 If ($Spoof2 = "F") Or ($Spoof2 = "P") Echo ANSI_12 "*Spoof Attempt" send "q" Goto :Go1 End #-----Compare Colos Terra vs our number- Getword CURRENTLINE $Tcolos 4 If ($Tcolos > ($Holds - $route2)) Send "t*" end If ($Tcolos > $Coloamt) or ($Tcolos = $Coloamt) Send "t " & $Coloamt "*" Else Send "q" end #---------Check Holds------------------ Send "/" Settextlinetrigger CH :CH "³Col" pause :CH Getword CURRENTLINE $CH1 4 Striptext $CH1 "³Phot" Killtrigger CH If (($CH1 + $Route1) > $Holds1) Send $Macro2 Subtract $Cycles 1 Goto :Go Else Goto :Go1 End |
|
| Author: | LoneStar [ Sun Nov 23, 2008 7:11 am ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
the colo cmd in the mombot has a milk parameter in case you wernt aware. In anyevent I took the liberty of fixing up your script a bit (only a bit).. to illustrate that some things are better left checked on by the script then trusting the end user. Nothin worse than getting a ICQ/IM from someone saying: "Your script got me SD'd!" Generally it's better to make some checks right off the bat, then prompt for user input. Code: Setvar $Terra 1 Setvar $Home CURRENTSECTOR #---------Prompt Check--------------- Getword CURRENTLINE $PromptCheck 1 If ($Promptcheck <> "Command") Echo "**Must Start From Command Prompt!!!" Halt End #--------CN9 Check------------------- send " cn" setTextLineTrigger CN1 :CN1 " ANSI graphics - Off" setTextLineTrigger CN2 :CN2 " Animation display - On" setTextLineTrigger CN9 :CN9 " Abort display on keys - ALL KEYS" setTextLineTrigger CNA :CNA " Message Display Mode - Long" setTextLineTrigger CNB :CNB " Screen Pauses - Yes" setTextLineTrigger CNC :CNC " Online Auto Flee - On" setTextTrigger CND :CND "Settings command (?=Help)" pause :CN1 killTrigger CN1 setVar $CN1 TRUE pause :CN2 killTrigger CN2 setVar $CN2 TRUE pause :CN9 killTrigger CN9 setVar $CN9 TRUE pause :CNA killTrigger CNA setVar $CNA TRUE pause :CNB killTrigger CNB setVar $CNB TRUE pause :CNC killTrigger CNC setVar $CNC TRUE pause :CND killAllTriggers setVar $str "" if ($CN1) setVar $str ($str & "1") end if ($CN2) setVar $str ($str & "2") end if ($CN9) setVar $str ($str & "9") end if ($CNA) setVar $str ($str & "A") end if ($CNB) setVar $str ($str & "B") end if ($CNC) setVar $str ($str & "C") end send $str & " q q" waiton "<Computer deactivated>" #-----alignment check------- send " ** /" waiton "Warps to Sector(s) :" waiton #179 & "Aln" setVar $TEMP (currentline & "!!@@##") getText $TEMP $TEMP "Aln" "!!@@##" stripText $TEMP " " stripText $TEMP "," if (SECTOR.NAVHAZ[$Home] <> 0) Echo ("*NavHaz Detected! Might Be Faster Pressing: CBY*") halt end if (SECTOR.PLANETCOUNT[$Home] < 1) Echo "*YOU MUST HAVE A PLANET IN YOUR SECTOR" halt end if ((SECTOR.FIGS.OWNER[$Home] <> "belong to your Corp") AND (SECTOR.FIGS.OWNER[$Home] <> "yours")) Echo "*YOU MUST HAVE A FIG IN YOUR SECTOR" halt end if ($TEMP < 1000) Echo "*YOU MUST BE BLUE 1000 PLUS ALIGN" halt end GetInput $PlanetNum "Which Planet?" GetInput $ColoAmt "Amount of colonists to grab per landing?" GetInput $Cycles "Amount of Cycles (Times between Terra and your Base) you want this to run?" Send "*" #---------Calc Distance/Set Macro---- Getdistance $route $Home $Terra if ($route = "-1") send "^f" & $Home & "*" & $Terra & "**q" waiton ": ENDINTERROG" Getdistance $route $Home $Terra if ($route = "-1") Echo "*CANNOT GET DISTANCE VALUES*" halt end end Getdistance $route1 $Terra $Home if ($route1 = "-1") send "^f" & $Terra & "*" & $Home & "**q" waiton ": ENDINTERROG" Getdistance $route1 $Terra $Home if ($route1 = "-1") Echo "*CANNOT GET DISTANCE VALUES*" halt end end Multiply $route 3 Multiply $route1 3 Add $route2 ($route + $route1) Send "jy" Setvar $Macro1 "l " & $planetnum & "* t n t 1 " & $route2 & "* q m " & $Terra & "* y y " Setvar $Macro2 "m " & $home & "* y y l " & $Planetnum & "* s n l 1 * " #---------Check Hold Number-------- Settextlinetrigger Holds :Holds "³Hlds" Send "*" Waitfor "Command [TL" Send "/" pause :Holds Getword CURRENTLINE $Holds 7 Striptext $Holds "³Ore" killtrigger Holds Setvar $Holds1 $Holds Subtract $holds1 10 #---------Main Code----------------- :Go If ($Cycles = 0) Halt end Send $Macro1 #--------Start Land Sequence Loop---- :Go1 setDelayTrigger delay :Cont 1000 pause :Cont killtrigger delay #--------Check Colos----------------- Settextlinetrigger colo :colo "There are currently" Send "l1*" Pause :colo killtrigger colo #------Check For Spoof--------------- GetWord CURRENTLINE $Spoof2 1 If ($Spoof2 = "F") Or ($Spoof2 = "P") Echo ANSI_12 "*Spoof Attempt" send "q" Goto :Go1 End #-----Compare Colos Terra vs our number- Getword CURRENTLINE $Tcolos 4 If ($Tcolos > ($Holds - $route2)) Send "t*" end If ($Tcolos > $Coloamt) or ($Tcolos = $Coloamt) Send "t " & $Coloamt "*" Else Send "q" end #---------Check Holds------------------ Send "/" Settextlinetrigger CH :CH "³Col" pause :CH Getword CURRENTLINE $CH1 4 Striptext $CH1 "³Phot" Killtrigger CH If (($CH1 + $Route1) > $Holds1) Send $Macro2 Subtract $Cycles 1 Goto :Go Else Goto :Go1 End Hope this helps |
|
| Author: | Crosby [ Sun Nov 23, 2008 8:17 am ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
thanks to ya both! a good read! |
|
| Author: | RajuAbju [ Sun Nov 23, 2008 10:32 am ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
I will try this baby out asap and let you know my feedback!!! Thanks! |
|
| Author: | Kaus [ Sun Nov 23, 2008 10:46 am ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
RajuAbju wrote: I will try this baby out asap and let you know my feedback!!! Thanks! Sure, hope you like it. You might want to copy the modified version that lonestar posted. I didn't add the user protections he did. |
|
| Author: | RajuAbju [ Mon Dec 01, 2008 12:29 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
I finally had time to try this script out... I get the following error: Command [TL=07:14:46]:[8201] (?=Help)? : Script run-time error in 'TERRA_FARMER_ 2.TS': '1067³Exp85³Corp10' is not a decimal number, line 88 Script terminated: scripts\terra_farmer_2.ts any ideas?? Corp10 is my corp # obviously. This error occurs right after it does a check of my ship inventory. edit- I was using the version LoneStar added... I copy/pasted his text into a txt file and renamed it to a .ts file. I assume thats ok to do. |
|
| Author: | Promethius [ Mon Dec 01, 2008 2:02 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
RajuAbju wrote: I finally had time to try this script out... I get the following error: Command [TL=07:14:46]:[8201] (?=Help)? : Script run-time error in 'TERRA_FARMER_ 2.TS': '1067³Exp85³Corp10' is not a decimal number, line 88 Script terminated: scripts\terra_farmer_2.ts any ideas?? Corp10 is my corp # obviously. This error occurs right after it does a check of my ship inventory. edit- I was using the version LoneStar added... I copy/pasted his text into a txt file and renamed it to a .ts file. I assume thats ok to do. Just for fun, you might comment out lines 72 and 73 using the # char in front of the lines and add: setVar $TEMP (currentline & "³") getText $TEMP $TEMP "Aln" "³" If that doesn't work, delete these two lines and the comment character and you are back to the way you were. |
|
| Author: | Kaus [ Mon Dec 01, 2008 4:44 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
RajuAbju wrote: I finally had time to try this script out... I get the following error: Command [TL=07:14:46]:[8201] (?=Help)? : Script run-time error in 'TERRA_FARMER_ 2.TS': '1067³Exp85³Corp10' is not a decimal number, line 88 Script terminated: scripts\terra_farmer_2.ts any ideas?? Corp10 is my corp # obviously. This error occurs right after it does a check of my ship inventory. edit- I was using the version LoneStar added... I copy/pasted his text into a txt file and renamed it to a .ts file. I assume thats ok to do. Worse case you can run the version I orginally posted. Outa curiousity why is he adding !!@@## to the variable on that line? |
|
| Author: | Promethius [ Mon Dec 01, 2008 4:58 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
The reason he added the extra characters is due to the stats line adjusting size depending on the contents. If you have serious credits or whatever, the lines adjust and warp different. The end of line addition gives a "marker" to use. I used the vertical line that appears in the stats info - if it is there, fine go to it, if not then we have added it. I think it is coding preference, making the code a bit easier to read maybe, but I useually don't use brackets around what I am concantinating: setVar $i "xyz" & $something so setVar $TEMP (currentline & "³") would be setVar $TEMP currentline & "³" The end of line may or may not be the issue here. A good get stats routine is something that will save a lot of time as it is used in a lot of scripts. There is a thread in here about scripting the routine. I believe EP started the thread. |
|
| Author: | ElderProphet [ Mon Dec 01, 2008 6:30 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
You guys should not try and paste ANSI codes like "³". Rather, find out what the char code is and paste that, and then there will be no copy/paste problems. |
|
| Author: | LoneStar [ Mon Dec 01, 2008 7:43 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
this Code: waiton "³Turns" can also be written as Code: waiton (#179 & "Turns") |
|
| Author: | Promethius [ Mon Dec 01, 2008 8:08 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
ElderProphet wrote: You guys should not try and paste ANSI codes like "³". Rather, find out what the char code is and paste that, and then there will be no copy/paste problems. The only time I have copy and paste problems is in an IM message and use :planet or some other combination that turns into a smiley. |
|
| Author: | Kaus [ Mon Dec 01, 2008 9:59 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
LoneStar wrote: this Code: waiton "³Turns" can also be written as Code: waiton (#179 & "Turns") Lesson learned. ElderProphet wrote: You guys should not try and paste ANSI codes like "³". Rather, find out what the char code is and paste that, and then there will be no copy/paste problems. Sometimes easier said than done, maybe I'm missing something here but I remember when I first wrote the code for TerraFarmer I had a hell of a time trying to get "³" to work any other way and couldnt figure out the character code version. |
|
| Author: | RajuAbju [ Tue Dec 02, 2008 12:52 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
Kaus, as an FYI, your version gives the same error as well. I tried it elsewhere on a ship with nothing but a twarp and no corp nothing, and it works. Also, this script does "almost" what I want, but not exactly. In reality, what I'd love to see if for your TerraFarmer script to be modified so that the 'aggressive' mode has a sub-option to pick up a specified number of collies on each landing (vs landing and taking off every second until enough collies have regened that it picks them all up in 1 shot) at terra until holds are full, then going and repeating the cycle. TerraFarmer is awesome because of the options and versatility it has, and its just missing this 1 little feature for me, or it would be the perfect colonizing script |
|
| Author: | Singularity [ Tue Dec 02, 2008 12:57 pm ] |
| Post subject: | Re: Inefficent Tmilker .ts (with user Specified holds) |
Right, an aggressive mode lets you undercut other milkers. Keep in mind tho that some adaptive scripts exist that will automatically lower their collection level to keep pace. You're entering the script war zone, you can't compete unless you learn how to make mods yourself. |
|
| Page 1 of 2 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|