Need help for a tracking script
Re: Need help for a tracking script
Oh. Yes, there is a bug with cecho and insertText, Babelfish knows about that one.
Re: Need help for a tracking script
Ok, thanks, I will see if this works and post if I have problems
Re: Need help for a tracking script
ok, heiko's is this:
Trigger: You see fresh tracks of a (\w+) leaving (\w+). (perl regex I take it)
Script:
local markRef = {}
markRef["north"] = "^^north^^"
markRef["east"] = ">>east>>"
markRef["south"] = "VVsouthVV"
markRef["west"] = "<<west<<"
selectCaptureGroup(3)
replace(markRef[matches[3]])
On this one, simply nothing happens.
tsuujin's does this:
trigger:You see fresh tracks of a (\w+) leaving (\w+). (also perl regex I assume)
Script:
local markRef = {}
markRef["north"] = "^^"
markRef["east"] = ">>"
-- Et cetera for all directions
deleteLine()
cecho(string.format("\n<white>There are some <red>bloody tracks of %s headed %s %s %s."matches[2],markRef[matches[3]],matches[3],markRef[matches[3]]))
When I try to activate it, the ladybug says: Lua syntax error:[string "function Trigger60.."]:7:')' expected near matches'
Any help would be awesome!
Trigger: You see fresh tracks of a (\w+) leaving (\w+). (perl regex I take it)
Script:
local markRef = {}
markRef["north"] = "^^north^^"
markRef["east"] = ">>east>>"
markRef["south"] = "VVsouthVV"
markRef["west"] = "<<west<<"
selectCaptureGroup(3)
replace(markRef[matches[3]])
On this one, simply nothing happens.
tsuujin's does this:
trigger:You see fresh tracks of a (\w+) leaving (\w+). (also perl regex I assume)
Script:
local markRef = {}
markRef["north"] = "^^"
markRef["east"] = ">>"
-- Et cetera for all directions
deleteLine()
cecho(string.format("\n<white>There are some <red>bloody tracks of %s headed %s %s %s."matches[2],markRef[matches[3]],matches[3],markRef[matches[3]]))
When I try to activate it, the ladybug says: Lua syntax error:[string "function Trigger60.."]:7:')' expected near matches'
Any help would be awesome!
Re: Need help for a tracking script
1. If my script doesn't work then your regex is wrong.
Use the highlighter option to see what's really matching your regex or print the result of matches[3]. The script only works correctly, if the second capture group evals to "north", "west", "south" or "east". Anything else will cause an error.
2. It's usually better to use the error view (red ! button) instead of the debug console (lady bug button).
3. A full stop becomes \. in regex.
Use the highlighter option to see what's really matching your regex or print the result of matches[3]. The script only works correctly, if the second capture group evals to "north", "west", "south" or "east". Anything else will cause an error.
2. It's usually better to use the error view (red ! button) instead of the debug console (lady bug button).
3. A full stop becomes \. in regex.
Re: Need help for a tracking script
looks like mine is missing a comma between the sting and the first argument within string.format
Re: Need help for a tracking script
Ok heiko, I just copied/pasted a line into the trigger line and set as an exact match to make sure that my pattern was correct. This is what it says in the debug console:
new line arrived:Outside a Massive Gate
new line arrived:[ Exits: n e s w ]
new line arrived:You see fresh tracks of a trolloc leaving east.
Trigger name=Tracking(You see fresh tracks of a trolloc leaving east.) matched.
match state 3/3 condition #0=true (0/2) regex=You see fresh tracks of a trolloc leaving east.
new line arrived:You see fresh tracks of a trolloc leaving east.
Trigger name=Tracking(You see fresh tracks of a trolloc leaving east.) matched.
match state 4/4 condition #0=true (0/2) regex=You see fresh tracks of a trolloc leaving east.
So it is matching everything, but it doesn't seem to be doing anything.
This is what it says in the mud:
Outside a Massive Gate
[ Exits: n e s w ]
You see fresh tracks of a trolloc leaving east.
You see fresh tracks of a trolloc leaving east.
You see almost fresh tracks of a trolloc leaving east.
and this is the script:
local markRef = {}
markRef["north"] = "^^north^^"
markRef["east"] = ">>east>>"
markRef["west"] = "<<west<<"
markRef["south"] = "VVsouthVV"
-- Et cetera for all directions
selectCaptureGroup(3)
replace(markRef[matches[3]])
new line arrived:Outside a Massive Gate
new line arrived:[ Exits: n e s w ]
new line arrived:You see fresh tracks of a trolloc leaving east.
Trigger name=Tracking(You see fresh tracks of a trolloc leaving east.) matched.
match state 3/3 condition #0=true (0/2) regex=You see fresh tracks of a trolloc leaving east.
new line arrived:You see fresh tracks of a trolloc leaving east.
Trigger name=Tracking(You see fresh tracks of a trolloc leaving east.) matched.
match state 4/4 condition #0=true (0/2) regex=You see fresh tracks of a trolloc leaving east.
So it is matching everything, but it doesn't seem to be doing anything.
This is what it says in the mud:
Outside a Massive Gate
[ Exits: n e s w ]
You see fresh tracks of a trolloc leaving east.
You see fresh tracks of a trolloc leaving east.
You see almost fresh tracks of a trolloc leaving east.
and this is the script:
local markRef = {}
markRef["north"] = "^^north^^"
markRef["east"] = ">>east>>"
markRef["west"] = "<<west<<"
markRef["south"] = "VVsouthVV"
-- Et cetera for all directions
selectCaptureGroup(3)
replace(markRef[matches[3]])
Re: Need help for a tracking script
Post a screenshot of your trigger because you've somehow messed up the settings. You are using a multistate AND trigger with 3 conditions according to your debug output instead of a regular 1 state trigger with a single regex condition
Re: Need help for a tracking script
He and I fixed this some time ago. Unless there's a new issue, this can be marked solved.Heiko wrote:Post a screenshot of your trigger because you've somehow messed up the settings. You are using a multistate AND trigger with 3 conditions according to your debug output instead of a regular 1 state trigger with a single regex condition :D
Re: Need help for a tracking script
if anyone wants this scipt, let me know.
Re: Need help for a tracking script
Just post it up, not everyone registers to post