help with an autotrack script

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: help with an autotrack script

Post by Vadi »

enableTrigger?

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: help with an autotrack script

Post by syrik »

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 :(

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: help with an autotrack script

Post by tsuujin »

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".

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: help with an autotrack script

Post by syrik »

So should I make it really specific?

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: help with an autotrack script

Post by tsuujin »

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.

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: help with an autotrack script

Post by syrik »

!! 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()

Post Reply