| Author |
Message |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
The goal is to surround the current sector with fighters. I have not got the whole understanding of the setvar command yet so I am making a script that just repeats the stuff for each warp. This only has the info for the 1st warp, when Ive got it working then ill add in the others. Anyway, uppon arrival at the 1st warp its stops working, doesn't accept triggers and just halts.
:top
getInput $figs "How many fighters per sector?"
send "d"
send "c;q"
waitfor "Max Figs Per Attack:"
getword CURRENTLINE $max 5
end
:getsectors
send "d"
waitfor "Sector :"
getword CURRENTLINE $start 3
waitfor "Warps to Sector(s) :"
getword CURRENTLINE $warp1 5
striptext $warp1 "("
striptext $warp1 ")"
getword CURRENTLINE $warp2 7
striptext $warp2 "("
striptext $warp2 ")"
getword CURRENTLINE $warp3 9
striptext $warp3 "("
striptext $warp3 ")"
getword CURRENTLINE $warp4 11
striptext $warp4 "("
striptext $warp4 ")"
getword CURRENTLINE $warp5 13
striptext $warp5 "("
striptext $warp5 ")"
getword CURRENTLINE $warp6 15
striptext $warp6 "("
striptext $warp6 ")"
goto :warp1
end
:warp1
send $warp1 "*"
goto :there1
:there1
setTextTrigger there1a :there1a "Command [TL="
setTextTrigger there1b :there1b "Mined Sector:"
setTextTrigger there1c :there1c "Your fighters:"
pause
:there1a
killAllTriggers
send "f" $figs "*cd"
goto :return1a
:there1b
killAllTriggers
send "n"
goto :there1
:there1c
killAllTriggers
send "a" $max "*"
goto :there1
:return1a
send "<"
goto :return1b
:return1b
setTextTrigger w1twarp :w1twarp "Lane is not adjacent"
setTextTrigger w1ewarp :w1ewarp "The shortest path"
setTextTrigger w1back :w1back "Sector : " $start
pause
:w1twarp
killAllTriggers
send "n"
goto :return1b
:w1ewarp
killAllTriggers
send "e"
goto :
:w1back
killAllTriggers
goto :warp2
end
:warp2
halt
|
| Thu Apr 01, 2004 12:36 pm |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
Get with me on icq next time you see me.Il help you with it
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Sat Apr 03, 2004 5:59 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
I made the following corrections to your posted script, and it works:
You can't put "end" in unless you have an If or While before it. So fix that first.
Line 66 from your above post should have "&" in it, as follows:
setTextTrigger w1back :w1back "Sector : " & $start
Note: This forum removes extra spaces, so the above line will not have enough spaces between "Sector" and ":"
As I said, it works for me after making these changes. Here are a few pointers though...
When you warp to the adjacents, you should send "m" before the sector number.
:warp1
send "m" $warp1 "*"
If you just send the sector number and "*", you will run into problems if the sector number is below a certain number, which changes according to the number of sectors in the universe... so just send "m" first and keep it simple.
Always try and use the TWX database to save yourself the unnecessary scripting. Check the following out, and you can avoid the part where you try to capture the adjacent sectors:
setVar $warp 1
getSector $current $current
:figAdjacents
if ($warp <= SECTOR.WARPCOUNT[$current]
send "m" SECTOR.WARPS[$current][$warp]
goto :there1
else
echo "*All Done*"
halt
end
And finally, you are using waitFor when you should be using setTextLineTrigger. Check line 5, 11, and 13. Your script depends on data received after the waitfor text... which may or may not have been received at the instant the triggering text is parsed. Use setTextLineTrigger instead.
Hope it helps,
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Wed Apr 07, 2004 12:08 pm |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
I was thinking the same thing.He never contacted me so I never got to help him.Oh well.
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Wed Apr 07, 2004 1:13 pm |
|
 |
|
Slim Shady
Gameop
Joined: Thu Jun 06, 2002 2:00 am Posts: 2371 Location: USA
|
i made a script but it wont work, it follows:
$Kill all and own game
can anyone fix this script for me  heh
Slim
_________________ Ask Slim!
--==[The Outfit]==--
|
| Wed Apr 07, 2004 4:44 pm |
|
 |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
Thanks for the help Elder. Sorry Wild our schedules just didn't seem to be matching up. Thanks though and you can count on me getting some help from you as I develop other scripts.
Oh yeah, nuther question... Can twx scripts call on other scripts?
If so what is the command? And does the first script halt when calling on the new one?
|
| Thu Apr 08, 2004 3:40 am |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
If I remember right it is :
load 1_col
for colonize.
Just add the scripts name in
Hope that helps
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Thu Apr 08, 2004 10:57 am |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
quote: Originally posted by Slim Shady
i made a script but it wont work, it follows:
$Kill all and own game
can anyone fix this script for me  heh
Slim
This is a wish loop which needs an end statement, but they aren't supported in the current revision of TWX Proxy.
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Fri Apr 09, 2004 9:07 pm |
|
 |
|
Slim Shady
Gameop
Joined: Thu Jun 06, 2002 2:00 am Posts: 2371 Location: USA
|
haha, thanks EP.
Slim
_________________ Ask Slim!
--==[The Outfit]==--
|
| Sun Apr 11, 2004 3:21 am |
|
 |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
Ok I have already started making better ways to do this. (not meaning pull data from the DB).
What I want to know is can an if statement have two commands to perform before the next elseif/else.
Like this
:changewarp
if ($warp = $warp1)
setvar $warp $warp2
goto :top
elseif ($warp = $warp2)
etc
etc
etc
|
| Fri Apr 16, 2004 4:03 am |
|
 |
|
typh00n
Chief Warrant Officer
Joined: Sun Mar 30, 2003 3:00 am Posts: 186 Location: USA
|
yea, you can have it perform as many tasks as you want, as long as they dont adversely affect eachother
(like putting the goto before the setvar)
|
| Fri Apr 16, 2004 4:18 am |
|
 |
|