View unanswered posts | View active topics It is currently Mon Apr 27, 2026 3:09 pm



Reply to topic  [ 9 posts ] 
 First time scripter question 
Author Message
Corporal

Joined: Wed Jan 14, 2004 3:00 am
Posts: 5
Location: USA
Unread post 
I am just trying out scripting for the first time, and I'm comparing to other scripts to try and construct it. This particular one is very simple; I'm only doing a basic colonizing script, but the catch is that I am trying to make it check for 0-low number of colonists on Terra. I'll post the script here, because it is simple, any help would be greatly appreciated. I'm not sure where else to post a message like this, except here, sorry if this is too basic. So the problem is that it doesn't work; I'm trying to scan for the quantity of colonists wanted in the 'i' information, and all it does is express to the planet to colonize, lands and then sits there and does nothing... I don't get it, however, I am new at this. If there is a better place to post such topics please tell me. Thanks.

# check if we can run it from here
cutText CURRENTLINE $location 1 12

if ($location <> "Command [TL=")
clientMessage "This script must be run from the command prompt"
halt
end

# Set trigger to stop script if disconnected
setEventTrigger 0 :End "Connection lost"

# Get needed info
:GetMoveFrom
getinput $planet "Enter planet sector" 0
getinput $planet1 "Enter planet ID to colonize" 0
getinput $quantity "Enter quantity to move" 0
getinput $resource "What resource number (1=Ore, 2=Organics, 3=Equip)" 0

# Start the colonizing
:move
send "1*e"
send "lt" $quantity "*"

# Now let's check to see if the number of colonists are the quantity or not
send "i"
setTextLineTrigger 1 :getscanner "Total Holds :"
:getScanner
getWord CURRENTLINE $colonist 9
if ($colonist < $quantity)
goto :notenough
else
goto :finish

# Finish it up
:finish
send $planet "*e" "lsn" $resource $quantity "*q"
goto :move

# This way it keeps checking for colonists
:notenough
send $planet "*e"
setDelayTrigger delay :wait 60000
goto :move

Thanks again.


Sun Feb 08, 2004 6:29 am
Profile
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post 
quote:Originally posted by Evernex

I am just trying out scripting for the first time, and I'm comparing to other scripts to try and construct it. This particular one is very simple; I'm only doing a basic colonizing script, but the catch is that I am trying to make it check for 0-low number of colonists on Terra. I'll post the script here, because it is simple, any help would be greatly appreciated. I'm not sure where else to post a message like this, except here, sorry if this is too basic. So the problem is that it doesn't work; I'm trying to scan for the quantity of colonists wanted in the 'i' information, and all it does is express to the planet to colonize, lands and then sits there and does nothing... I don't get it, however, I am new at this. If there is a better place to post such topics please tell me. Thanks.

Thanks again.

This is a TWX type question and should be posted @
http://www.twxproxy.com/support.php

but for the most part , you may want a look at more files , I don't want to make this a long post.
So email/icq me and I'll get you rolling.

Vid's World on Guam
http://geocities.com/videotees/twars.html
telnet://vidsworld.no-ip.org:2002
http://vidkid.coastgames.com/index.php <--- Register & Request Games
http://geocities.com/videotees/hintstips.html <-- Vid's Hints and Tips
icq 14340614 - Vid Kid

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Sun Feb 08, 2004 8:50 am
Profile WWW
Lieutenant

Joined: Fri Apr 05, 2002 3:00 am
Posts: 580
Location: USA
Unread post 
I can help ya out,Add me to your icq and I will see what I can do to help.

_________________
My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.


Sun Feb 08, 2004 9:42 pm
Profile ICQ YIM
Corporal

Joined: Wed Jan 14, 2004 3:00 am
Posts: 5
Location: USA
Unread post 
Thanks for the reroute Vid Kid, it is a TWX script which I didn't specify in the original message (though I guess it was obvious).I also appreciate the offers of help, and am currently trying to add both of you to my ICQ account, thanks.

My ICQ number is: 301934560


Mon Feb 09, 2004 12:13 am
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
This is a fine forum for this sort of post. And I'm glad to see that there are plenty of players willing to help. First, let me encourage you to keep trying, as this is the best way to improve your skills. Let me briefly cover the problems with this script. There are a few reasons I might choose not to write this kind of script, but I'm just gonna focus on the problems that will keep this script from working. I'm assuming the paths to and from terra are clear, since you did.

The first problem is that you ask for a total number of colonists to move, $quantity. This is the same number that you try and pick up from terra on line 22. And since a quantity like 3000 will not fit into your ship, TWGS will read 3000 as 30.
Also, textLineTrigger 1 is wrong. First, you have to pause after the triggers are set. The quoted part should be (Note the extra spaces) "Total Holds :". However, this CURRENTLINE shouldn't have 9 words. For this script you should jettison sometime before :move,then set the textlinetrigger, and capture word 4 as $colonists, E.g.:

setTextTrigger 1 :getscanned "Total Holds :"
pause
:getscanned
getWord CURRENTLINE $colonists 4

Other basic problems:
Your if/else statement beginning on line 29 should have an end statement on line 33. Also, your :finish section has a few problems, which is the reason it just sits on the planet. Here is the corrected version.

:finish
send "l" $planet1 "*snl" $resource "*q"
goto :move

So, to summarize... Jettison, then you need to send "I" first to get the $colonists variable, then at Terra, just send "lt**" to take as many as you can. Then move to the planet sector and drop colonist. This is where you can check how many you are actually carrying or dropping off, as well as keep track of how many you've moved. Ah, what the heck, I'll post it...

:finish
send "l" $planet1 "*snl" $resource "*q"
setTextLineTrigger colosdropped :trackcolos "Colonists do you want to leave"
pause
:trackcolos
getWord CURRENTLINE $colosmoved 11
stripText $colosmoved "(["
stripText $colosmoved "]"
add $totalmoved $colosmoved
if ($totalmoved >= $quantity)
echo "*Finished. Halting..."
halt
end
# Note that this delay trigger is alot different than yours... :move vs :wait, and the pause
if ($colosmoved < $colonists)
setDelayTrigger delay :move 60000
pause
end
goto :move

Good luck with it, and feel free to post any follow ups.

+EP+

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


Mon Feb 09, 2004 11:59 pm
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Er... I guess those extra spaces don't make it to the post after all. Ah well, I'm sure you had that Total Holds quote right to start with.

+EP+

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


Tue Feb 10, 2004 12:13 am
Profile WWW
Lieutenant

Joined: Fri Apr 05, 2002 3:00 am
Posts: 580
Location: USA
Unread post 
Good post EP,I was going to send him along the same way also.I wish I had all the help that the new guys are getting when I started.I got lucky,Xide and Alexio took pity on this fool and helped me get started.I owe those guys big.
Good luck with the scripting

_________________
My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.


Tue Feb 10, 2004 11:48 am
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Heh, I just noticed that the very first line of "corrected" code is wrong... should be setTextLineTrigger. Ah well, that is what debugging is for.

Having said all of this, the TWX Proxy site is still a better place for TWX specific help.

Thanks for the props Wildstar.

+EP+

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


Wed Feb 11, 2004 12:27 am
Profile WWW
Corporal

Joined: Wed Jan 14, 2004 3:00 am
Posts: 5
Location: USA
Unread post 
Hey thanks a lot EB, that did help out a lot. Wildstar has been helping me a bit more as well, so thanks goe out to him. Appreciate it. [:)]


Tue Feb 17, 2004 9:20 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 49 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.