View unanswered posts | View active topics It is currently Tue Apr 21, 2026 12:13 pm



Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
 Inefficent Tmilker .ts (with user Specified holds) 
Author Message
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 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

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Nov 23, 2008 12:31 am
Profile ICQ
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post 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

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Sun Nov 23, 2008 7:11 am
Profile ICQ YIM
Lieutenant Commander
User avatar

Joined: Sun Jan 29, 2006 3:00 am
Posts: 800
Location: Iowa
Unread post Re: Inefficent Tmilker .ts (with user Specified holds)
thanks to ya both! a good read!

_________________
#+++
The early bird may get the worm, but the second mouse gets the cheese.
#---


Sun Nov 23, 2008 8:17 am
Profile ICQ YIM
Warrant Officer
User avatar

Joined: Thu Jan 31, 2002 3:00 am
Posts: 96
Location: USA
Unread post Re: Inefficent Tmilker .ts (with user Specified holds)
I will try this baby out asap and let you know my feedback!!! Thanks!

_________________
"Freedom is not free, but the U.S. Marine Corps will pay most of your share." -Ned Dolan
"Tolerance is the virtue of a man without convictions." -GK Chesterton


Sun Nov 23, 2008 10:32 am
Profile ICQ YIM WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 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.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Nov 23, 2008 10:46 am
Profile ICQ
Warrant Officer
User avatar

Joined: Thu Jan 31, 2002 3:00 am
Posts: 96
Location: USA
Unread post 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.

_________________
"Freedom is not free, but the U.S. Marine Corps will pay most of your share." -Ned Dolan
"Tolerance is the virtue of a man without convictions." -GK Chesterton


Mon Dec 01, 2008 12:29 pm
Profile ICQ YIM WWW
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post 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.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Mon Dec 01, 2008 2:02 pm
Profile ICQ
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 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?

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Mon Dec 01, 2008 4:44 pm
Profile ICQ
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post 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.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Mon Dec 01, 2008 4:58 pm
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 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.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Mon Dec 01, 2008 6:30 pm
Profile WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post Re: Inefficent Tmilker .ts (with user Specified holds)
this
Code:
waiton "³Turns"

can also be written as
Code:
waiton (#179 & "Turns")

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Mon Dec 01, 2008 7:43 pm
Profile ICQ YIM
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post 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.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Mon Dec 01, 2008 8:08 pm
Profile ICQ
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 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.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Mon Dec 01, 2008 9:59 pm
Profile ICQ
Warrant Officer
User avatar

Joined: Thu Jan 31, 2002 3:00 am
Posts: 96
Location: USA
Unread post 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 :)

_________________
"Freedom is not free, but the U.S. Marine Corps will pay most of your share." -Ned Dolan
"Tolerance is the virtue of a man without convictions." -GK Chesterton


Tue Dec 02, 2008 12:52 pm
Profile ICQ YIM WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 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.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Tue Dec 02, 2008 12:57 pm
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.