interesting error

Posted by Ogomez92 on Thu 22 Oct 2009 08:09 PM — 5 posts, 21,063 views.

#0
Hi
I'm having a really interesting issue here.
One of my triggers captures a prompt and grabs certain information from it. There's this new area that when I enter it it works fine, but after I fight something, and goes back to the default prompt, it simply stops capturing it and it's as though we're stil fighting.
I would like to know why this is happening and if it's something to do with a change in the prompt that I can't see or it's something else.
Ps if my prompts look really weird is because I'm omiting them so they don't show up on the screen. I'm using a screen reader.
The regexp to capture prompt is this
match="^area: (.*?)gold: (\w+)mana: (\w+)max (\w+)cond: (.*?)hit: (\w+)max (\w+)terrain: (.*?)mv\: (\w+)max\: (\w+)dt: (.*?)xp: (.*)$"

Here's the prompt that showed up before I was fighting which it did capture
area: The fiery, unforgiving Demonic Realmgold: 0mana: 58max 388cond:
excellenthit: 370max 370terrain: wastelandmv: 25max: 60dt: xp: 401699

And here's the one that didn't capture after the fight.
area: The fiery, unforgiving Demonic Realmgold: 0mana: 155max 388cond:
excellenthit: 370max 370terrain: wastelandmv: 59max: 60dt: xp: 403774
Australia Forum Administrator #1
You've edited it slightly haven't you? You show two lines but the regexp will only match one?

Can you show the complete trigger:

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


And also copy and paste the exact output (without adding linebreaks or anything).
#2
Ok.
Sicne the first line is omiting, it's not going to show any output.
Here's the whole trigger

<trigger
enabled="y"
keep_evaluating="y"
match="^area: (.*?)gold: (\w+)mana: (\w+)max (\w+)cond: (.*?)hit: (\w+)max (\w+)terrain: (.*?)mv\: (\w+)max\: (\w+)dt: (.*?)xp: (.*)$"
omit_from_log="y"
omit_from_output="y"
regexp="y"
script="dprompt"
sequence="100"
>
</trigger>

Then the dprompt function that hooks to the trigger is all about getting data inside that and showing it/setting vars, like
if not (area == w[1]) then
area=w[1]
Sound(GetInfo(67).."/sounds/notifications/change area.ogg")
Note(w[1])
prevarea=w[1]
end

etc etc
Australia Forum Administrator #3
Well, you could turn off omit from output long enough to capture the exact matching line.

Anyway, here is a guess as to what is happening ...

When you get into a fight, your script has some sort of script error (eg. arithmetic on a nil value). This shows an error message. However, if omit from output is on in the trigger, the error message is also omitted. Then, because the script had an error, MUSHclient disables the trigger because otherwise you would get heaps of errors.

So, either turn omit from output off for long enough to see and debug this error message, or turn off "note errors" in scripting configuration. Then the error message will appear in a dialog box instead, which will not be omitted.
#4
Oh thanks i'll try turn off note errors see where the problem is. I'm pretty sure it's something like that, since I had been getting errors due to unrecognized weapons. I'll get back to you later thanks for the help