User Login
Name
Password
Site Contents
News
About
Download
Scripts
Tutorials
Register
Support
FAQ
Script Reference
New User


Contact Me
Xide
User Support Forum
Return to thread listing
Bnix13 - 2 February 2005 at 7:00 PM  (EST)
I may be going at this the wrong way but i'm trying to set an array of the sectors and there densities. Then do the same thing and compare the two. It's a density photon script.
Here's were i got to

send "SD"
:Start

killAllTriggers
setTextLineTrigger igetSec :igetSec "Sector"
setTextTrigger goinitialSec :Start2 "] (?=Help)? :"
pause

:igetSec

add $i 1
getText $line $seci[$i] "Sector " " ==>"
getText $line $deni[$i] "==> " " Warps"
goto :Start

:Start2
getWord CURRENTLINE $initTime 1
setVar $c 0
send "SD"
killAllTriggers
setTextLineTrigger cgetSec :currentSec "Sector"
setTextTrigger currentSec :wait "Command [TL="
pause

:currentSec

add $c 1
getText $line $denc[$c] "==> " " Warps"
if ($denc[$c] <> $deni[$c])
goto :photon
else
goto :Start2

:photon
killAllTriggers
send "cpy"
send $seci[$c]
send "*"





ElderProphet - 5 February 2005 at 7:51 PM  (EST)
Fixing my last post... seems my comments didn't make it.

Okay, there are a few errors with what you've written.
1. You are trying to use $line after a text trigger activates. Instead, you want to use the system variable CURRENTLINE. It contains all text received since the last Carriage Return (CR).

2. Your if/else statement doesn't have an end.

3. You are either missing or forgot your :wait routine.

It also looks like you've had some problems with triggers... knowing when to kill them. You've probably seen "Trigger already exists" a few times, which is why you use killAllTriggers so frequently. What follows is revised but still based on what you posted. I have no idea if it works, so pay more attention to what I'm trying to show you, rather than whether or not the code works. You'll definately want to add back in the formatting that this forum pulls out, like on the "==> " line where extra spaces were removed. Anyways, look it over and see if you understand why and where it differs from yours. Pay special attention to how the triggers are managed.

Good luck, and a good effort by the way.

+EP+

#############################################
:start
setVar $i 0
send "SD"
setTextLineTrigger igetSec :igetSec "Sector"
setTextTrigger goinitialSec :Start2 "] (?=Help)? :"
pause

:igetSec
# Note: The "igetSec" trigger hit, so it is no longer active, but the "goinitialSec" trigger is.
add $i 1
getText CURRENTLINE $seci[$i] "Sector " " ==>"
getText CURRENTLINE $deni[$i] "==> " " Warps"
# Note: Since the "goinitialSec" trigger is still active, we just need to reset the "igetSec" trigger and pause.
# This keeps the script from bouncing back up and killalltriggers and then setting 2 triggers.
setTextLineTrigger igetSec :igetSec "Sector"
pause
# Now the :igetSec will loop basically, until the "goinitialSec" trigger hits.

:Start2
# Note: The "goinitialSec" trigger activated, so it is no longer active, but "igetSec" trigger is.
# Since it is no longer needed though, we must kill it.
killTrigger igetSec
setVar $c 0
send "SD"
setTextLineTrigger cgetSec :currentSec "Sector"
setTextTrigger currentSec :wait "Command [TL="
pause

:currentSec
add $c 1
getText CURRENTLINE $denc[$c] "==> " " Warps"
if ($denc[$c] <> $deni[$c])
goto :photon
end
# Again, no need to bounce up, killalltriggers, and set triggers. Well just reset the one that hit.
setTextLineTrigger cgetSec :currentSec "Sector"
pause
# And we've created another loop at :currentSec, until the "currentSec" trigger hits.

:wait
# The "currentSec" trigger hit, so the only active trigger now is cgetSec, and we'll kill it since we don't need it.
killTrigger cgetSec
setDelayTrigger 1Sec :Start2 1000
pause

:photon
killTrigger currentSec
send "cpy" $seci[$c] "*"