www.ClassicTW.com
https://mail.black-squirrel.com/

1st script
https://mail.black-squirrel.com/viewtopic.php?f=15&t=11965
Page 1 of 1

Author:  Grivan Moranar [ Thu Oct 14, 2004 10:09 pm ]
Post subject: 

I just read through Xide's help for TWProxy scripts, and am attempting to write my 1st script. I'm trying to make a script to warp me to a sector when a certain type of ship enters said sector with one of my fighters. I'm going after the Ferret and Star Destroyer types. It kida worked, though it hiccuped and missed a hit. What am I doing wrong, if anything?

_________________________

:start
setTextLineTrigger waiting :getsector "Incoming transmission from Deployed Fighters"
Pause

:getsector
setTextLineTrigger getCurrentSector :getwarpto "Report Sector "
setTextLineTrigger identify1 :identified "Star Destroyer"
setTextLineTrigger identify2 :identified "Ferret"
pause
:getwarpto
getWord CURRENTLINE $sector 3
pause

:identified
killTrigger identify1
killTrigger identify2
send $sector "*y"
WAITON "beam pinpointed"
send "y"
WAITON "Command [TL="
send "sd"
WAITON "Command [TL="
echo ANSI_12 "You have arrived, hunt 'em down!"
halt

Author:  Silence [ Fri Oct 15, 2004 11:43 am ]
Post subject: 

your :getwarpto trigger needs to link back to the other two triggers or its not gonna work... plus you should put those killtriggers above the triggers themselves, its more efficient.
like this:

:getsector
killTrigger getCurrentSector
killTrigger identify1
killTrigger identify2
setTextLineTrigger getCurrentSector :getwarpto "Report Sector "
setTextLineTrigger identify1 :identified "Star Destroyer"
setTextLineTrigger identify2 :identified "Ferret"
pause

:getwarpto
getWord CURRENTLINE $sector 3
goto :getsector

Author:  ElderProphet [ Fri Oct 15, 2004 12:02 pm ]
Post subject: 

You're close. The problem I see will occur when the ship isn't one of the 2 you are awaiting. If the ship that enters isn't a Start Destroyer or Ferret, then this script will hang at the :getWarpTo pause, since neither of the identify triggers will hit.

To fix this:
:getSector should only have the getCurrentSector trigger and a pause.
Move the 2 identify triggers (and make them setTextTrigger) to :getWarpTo, after the getWord line. You should stripText the ":" from $sector also. Then add another set text trigger for "Command", that takes the script back to :start. Make sure you kill this new trigger in :identified.

You also need to kill the 2 identify triggers in :start. The sequence would be this: Scout enters, :getWarpTo grabs the Sector, but neither ship type is seen before "Command", so it goes back to :start, and kills the identify triggers.

I've left it somewhat ambiguous on purpose, because you need to figure it out. But don't hesitate if you can't get it, and I'll gladly post the corrections.

+EP+

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/