| Author |
Message |
|
BlackBeard
Warrant Officer
Joined: Thu Jan 13, 2005 3:00 am Posts: 82 Location: USA
|
i can do this another way...because the way it is now no data can be sent or recieved while it is counting...all it is doing is delaying between commands and sometimes causes twx to crash
:wait
if ($loop<> 6000000)
add $loop 1
goto :wait
end
|
| Sat May 21, 2005 6:56 pm |
|
 |
|
Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA
|
have you tried a delaytrigger instead?
_________________ http://tw-cabal.navhaz.com - THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.
|
| Sat May 21, 2005 7:08 pm |
|
 |
|
RammaR
Warrant Officer
Joined: Sat Dec 15, 2001 3:00 am Posts: 94 Location: USA
|
Not sure of exactly what you're trying to do, but like Traitor suggested I'd look into a "setDelayTrigger". From the TWX helpfile, here's the description and syntax:
Purpose: Creates a trigger that will automatically activate after a specified time period.
Syntax: setDelayTrigger {name} {label} {tics)
Note: tics are in milliseconds
:wait
send "#"
setDelayTrigger delay :wait 60000
pause
Hope that helps. If its not what your looking for, then give us a few more details of your project.
Good luck.
_________________ http://www.grimytrader.com
|
| Sat May 21, 2005 9:39 pm |
|
 |
|
Zoso
Ensign
Joined: Fri Sep 19, 2003 2:00 am Posts: 247 Location: Canada
|
yup need more info. Your prolly stuck in an infinite loop. TWX freezing and not responding? ECHO $loop and see the results. BTW - TWX is in desperate need of a debugger.
_________________ No Quarter - Is what we offer our enemies
|
| Sat May 21, 2005 11:05 pm |
|
 |
|
BlackBeard
Warrant Officer
Joined: Thu Jan 13, 2005 3:00 am Posts: 82 Location: USA
|
ok i tried that delay trigger but cant get it to work.... heres what i am doing
:start
setVar $loop 0
KillAllTriggers
send " l 1 *"
setTextLineTrigger 1 :chk "There are currently"
pause
:chk
setVar $line CURRENTLINE
getWord $line $colo 4
if ($colo < 114)
setVar $loop 0
gosub :wait
send "q"
goto :start
end
:getem
send " t * 931 y"
waitFor "Locating beam pinpointed, TransWarp Locked."
send "y l 3 * s n l 1 * t n t 1 72* q 1* y"
waitFor "Locating beam pinpointed"
send "y"
goto :start
halt
:wait
if ($loop<> 6000)
add $loop 1
goto :wait
end
return
what it does it starts at terra checks # of colonist and if colonist is less than number of holds then it needs to pause for a bit (still sitting on terra) blast off and land again checking if there is enough colonist to fill the holds
|
| Sun May 22, 2005 12:58 pm |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
I have a script at griys called Terra Checker in the zip with 21 scripts that does that.<Cheap Plug>
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Sun May 22, 2005 3:34 pm |
|
 |
|
Coke
Lieutenant J.G.
Joined: Sat Apr 10, 2004 2:00 am Posts: 449 Location: USA
|
yah but he's wanting to do his own  And your scripts are not in .ts for him to see how it's done to get his working.
on a side note, WHOHOO 200 posts, i'm a Gunnery SGT.
|
| Sun May 22, 2005 3:42 pm |
|
 |
|
BlackBeard
Warrant Officer
Joined: Thu Jan 13, 2005 3:00 am Posts: 82 Location: USA
|
wildstar: i just tried your script and seems to me that if you have a planet scanner on your ship it doesnt work....the way my script is you can be afk so you dont have to type in 1 all the time at terra...and what i want my script to do is land on terra while i wait for colonist to regen...maybe so if i am not fed safe i still can use it
|
| Sun May 22, 2005 5:28 pm |
|
 |
|
Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA
|
quote:Originally posted by BlackBeard
ok i tried that delay trigger but cant get it to work.... heres what i am doing
BlackBeard, try this instead:
:start
send " l 1 *"
setTextLineTrigger chk :chk "There are currently"
pause
:chk
killtrigger chk
getWord CURRENTLINE $colo 4
if ($colo < 114)
gosub :wait
send "q"
goto :start
else
goto :getEm
end
:getEm
send " t * 931 y"
waitFor "Locating beam pinpointed, TransWarp Locked."
send "y l 3 * s n l 1 * t n t 1 72* q 1* y"
waitFor "Locating beam pinpointed"
send "y"
goto :start
halt
:wait
SetDelayTrigger delay :delay 6000
pause
:delay
killTrigger delay
return
Whenever you have triggers, it's good practice to name the trigger with the same name as the lable that it's referencing. I also used to name them numbers, but as my scripts got bigger, it became a pain to keep track of them. If you name them the same as the lable they call, then you can be sure that you won't ever reuse a trigger name on accident.
Also, it's good practice to kill triggers, even ones that automatically get killed when they are triggered. It's not requried, but when you are troubleshooting a 3000 line script, triggers are usually the culprit. And there is no perceptable increase in processing time.
_________________ http://tw-cabal.navhaz.com - THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.
|
| Sun May 22, 2005 6:40 pm |
|
 |
|
BlackBeard
Warrant Officer
Joined: Thu Jan 13, 2005 3:00 am Posts: 82 Location: USA
|
thanks traitor seems to be working now
i was working on it all day with the setdelaytrigger
and when i added
:delay
killTrigger delay
it started to work right...
thanks again 
|
| Sun May 22, 2005 7:16 pm |
|
 |
|
Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA
|
No prob.
triggers need someplace to go.
_________________ http://tw-cabal.navhaz.com - THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.
|
| Sun May 22, 2005 9:38 pm |
|
 |
|
Zoso
Ensign
Joined: Fri Sep 19, 2003 2:00 am Posts: 247 Location: Canada
|
I would be very careful about AFK colo scripts.
_________________ No Quarter - Is what we offer our enemies
|
| Sun May 22, 2005 11:00 pm |
|
 |
|