help with an autotrack script
Re: help with an autotrack script
enableTrigger?
Re: help with an autotrack script
hrm, ok so I have this:
Pattern: You see fresh tracks of (.+) leaving (\w+) (regex)
moveCursor("main",0,getLineCount()-1)
if selectString("tracks of",1) == -1 then
direction = matches[3]
send(direction)
end
moveCursorEnd()
Here is what it says in the debug window:
Trigger name=Fresh Tracks(You see fresh tracks of (.+) leaving (\w+)) matched. <---- different trigger
capture group #1 = <You see fresh tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
LUA OK script Fresh Tracks (Trigger9) ran without errors
Trigger name=autotrackfast(You see fresh tracks of (.+) leaving (\w+)) matched. <----- this is this trigger.
capture group #1 = <You see fresh tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
line under current user cursor: 3180#:On the Crumbling Road
LUA OK script autotrackfast (Trigger23) ran without errors
new line arrived:You see very recent tracks of a trolloc leaving east.
Trigger name=Very Recent(You see very recent tracks of (.+) leaving (\w+)) matched.
capture group #1 = <You see very recent tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
LUA OK script Very Recent (Trigger11) ran without errors
Its still not actually following the tracks
Pattern: You see fresh tracks of (.+) leaving (\w+) (regex)
moveCursor("main",0,getLineCount()-1)
if selectString("tracks of",1) == -1 then
direction = matches[3]
send(direction)
end
moveCursorEnd()
Here is what it says in the debug window:
Trigger name=Fresh Tracks(You see fresh tracks of (.+) leaving (\w+)) matched. <---- different trigger
capture group #1 = <You see fresh tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
LUA OK script Fresh Tracks (Trigger9) ran without errors
Trigger name=autotrackfast(You see fresh tracks of (.+) leaving (\w+)) matched. <----- this is this trigger.
capture group #1 = <You see fresh tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
line under current user cursor: 3180#:On the Crumbling Road
LUA OK script autotrackfast (Trigger23) ran without errors
new line arrived:You see very recent tracks of a trolloc leaving east.
Trigger name=Very Recent(You see very recent tracks of (.+) leaving (\w+)) matched.
capture group #1 = <You see very recent tracks of a trolloc leaving east>
capture group #2 = <a trolloc>
capture group #3 = <east>
LUA OK script Very Recent (Trigger11) ran without errors
Its still not actually following the tracks
Re: help with an autotrack script
The first line may not match because the line before it had "tracks of" in it. The second one won't match because it doesn't use "Fresh tracks".
Re: help with an autotrack script
So should I make it really specific?
Re: help with an autotrack script
You just need to think of what you're really trying to do. If you're only trying to follow fresh tracks, get rid of all the other triggers and only follow fresh ones. If you're trying to follow any track with a particular name associated with it, use one trigger and make the regex match any kind of track and then just do a previous line check and a name check.
Re: help with an autotrack script
!! I just realized something, this should work right?
moveCursor("main",0,getLineCount()-1)
if selectString("tracks of",1) == -1 then
tracks = { "human", "ridden", }
if table.contains( tracks, matches[2] ) then
send( matches[3] )
end
end
moveCursorEnd()
moveCursor("main",0,getLineCount()-1)
if selectString("tracks of",1) == -1 then
tracks = { "human", "ridden", }
if table.contains( tracks, matches[2] ) then
send( matches[3] )
end
end
moveCursorEnd()