Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ interesting error
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Ogomez92
(42 posts) Bio
|
| Date
| Thu 22 Oct 2009 08:09 PM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Thu 22 Oct 2009 09:48 PM (UTC) |
| Message
| 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:
 |
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). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Ogomez92
(42 posts) Bio
|
| Date
| Reply #2 on Fri 23 Oct 2009 04:33 PM (UTC) |
| Message
| 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
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Fri 23 Oct 2009 08:01 PM (UTC) |
| Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Ogomez92
(42 posts) Bio
|
| Date
| Reply #4 on Sat 24 Oct 2009 07:36 AM (UTC) |
| Message
| | 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 | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
20,124 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top