help with an autotrack script

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

help with an autotrack script

Post by syrik »

Ok, so I want a script that will follow people's tracks when I type: follow xx (like human, warhorse, etc)
But I want to be able to stop it with any other command, and auto hit when I find the think I am tracking. Also would it interfere with my other script that alters what the tracks look like?

The tracks for my mud look like this: You see almost fresh tracks of a critter leaving south.
(the script changes to: ALMOST FRESH of a critter vv south vv. but I don't think that will make a difference)

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

Re: help with an autotrack script

Post by syrik »

Ok, so far I have:

Pattern:
You see fresh tracks of (.+) leaving (\w+)

Script:
direction = matches[3]
send(direction)

All it does is spam me around, but it doesn't follow the fresh tracks tracks and will eventually just start spamming north. What am I doing wrong?

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: help with an autotrack script

Post by Yetzederixx »

need some actual cut and pastes from teh mud

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

Re: help with an autotrack script

Post by syrik »

Ok, Here is what a set of fresh tracks looks like:
You see fresh tracks of a trolloc leaving east.

At the Gates of the Blackened Hold
[ Exits: e w ]
<-- I go 1w here
HP:Healthy MV:Good >
Before the Massive Walls
[ Exits: e w ]
You see fresh tracks of a trolloc leaving east. <--- is it because of the set of 3 fresh tracks that it...
You see fresh tracks of a trolloc leaving east.
You see fresh tracks of a trolloc leaving east.
A deer staggers along weakly.

HP:Healthy MV:Good >
At the Gates of the Blackened Hold <----- 1e
[ Exits: e w ]

HP:Healthy MV:Good >
Entering the Blackened Hold <----- 1e again
[ Exits: e w ]

HP:Healthy MV:Good > <----- 1e again
A Grotesque Well in the Blackened Hold
[ Exits: n s w ]
A crumbling stone well is here, ready to collapse.
A bell tower stands here, its stone carved with statues of legends past.
A bronze bell hangs inside the highest window of the tower.
Otar the Goatrider, Commander of the Horde is standing here.
A Dreadlord smirks here, an aura of power about him.

So maybe my problem is that I need to limit it to only catch like one line?

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: help with an autotrack script

Post by Yetzederixx »

hrm, try this:

Name: Tracking Gate
Pattern: ^\[ Exits: .* \]$
Fire Length: 10? Shorten/lengthen as necessary, the sub-trigger will disable reguardless
Code: [show] | [select all] lua
enableTrigger("SOMETHING") -- see below
Then put your trigger to follow the tracks as a subtrigger

Sub-trigger Name: SOMETHING
Pattern: Keep the one that works
Code: [show] | [select all] lua
send(matches[2])
disableTrigger("SOMETHING")

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 »

Code: [show] | [select all] lua
moveCursor("main",0,getLineCount()-1)
if selectString("tracks of",1) == -1 then
    --[[ Do your tracking code here ]]--
end
moveCursorEnd()
This will, on the capture of the trigger, check the line above the triggered line and see if it contains "tracks" information. If it doesn't, then you do the tracking script. Otherwise it's the second or third line and you just ignore it.

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

Re: help with an autotrack script

Post by syrik »

Ok, thanks! I will see how it works.

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

Re: help with an autotrack script

Post by syrik »

Ok, I now have this:
pattern: You see fresh tracks of (.+) leaving (\w+)

moveCursor("main",0,getLineCount()-1)
if selectString("fresh tracks of",1) == -1 then
direction = matches[3]
send(direction)
end
moveCursorEnd()

And it still just spams me around in random direction. Should I add the enable/disable trigger stuff?

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 changed what I put on there, by adding "fresh tracks" to the selectString. You're probably catching stale tracks on the second and third, and the third is causing you to move again. Be less descriptive in your search.

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

Re: help with an autotrack script

Post by syrik »

ok, changed it to "tracks of" and it is working for the most part. How would I activate it by using an alias and also target a specific set of tracks? So something like "Track human" would make the tracks followed be a human's tracks? Thanks for all the help so far!

Post Reply