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
➜ General
➜ Strange trigger reaction while speedwalking in Aardwolf
|
Strange trigger reaction while speedwalking in Aardwolf
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Whininguser
Canada (30 posts) Bio
|
| Date
| Fri 19 Nov 2010 01:53 PM (UTC) Amended on Fri 19 Nov 2010 02:24 PM (UTC) by Whininguser
|
| Message
| This is the trigger:
<triggers>
<trigger
enabled="y"
match="\AEastern High Road\Z"
name="test"
regexp="y"
script="test"
send_to="12"
sequence="100"
>
<send>print("%0")</send>
</trigger>
</triggers>
This is the function:
function test()
print ("testing...")
end
This is an example of the problem:
Go to City of Aylor (recall), type "rt farm", and you'll be getting these:
Starlight Way - East (4198)
Eastern High Road (4198)
The Tothmeer Trail (4189)
and so on...
As shown, the trigger should match only "Eastern High Road", not "Eastern High Road (4198)", and the trigger behaves when I'm not speedwalking.
However, while I'm speedwalking, the trigger would call test() after "Eastern High Road (4198)" shows up, but it wouldn't call print("%0"), which is in the send box. It seems as if the trigger was both called and not called. Isn't this nuts? :D
I've tested on various strings and trigger options and got the same result. Screenshot: http://imgur.com/jdOng.png
Environment:
MC 4.33 (Yes, punch me for being lazy... I hope the problem does not happen in the newer versions)
Lua 5.1
Windows XP
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 19 Nov 2010 08:34 PM (UTC) |
| Message
| Well that had me going for a while, as I was able to reproduce it, but couldn't see why ...
First, I would use ^ and $, using \A and \Z is confusing - I mainly use those in multi-line triggers.
But the real problem is the hidden text you aren't seeing, because it is omitted from output. If you turn triggers off, and do the runto, this is what you see:
Eastern High Road (420)
<MAPSTART>
Eastern High Road
---
, ` [ ] ( * , ` ~ ~
, ` , ` [ ] , ` [?] , ` ~ ~
, ` , ` [ ] , ` , ` , ` ~ ~
[ ] [ ] [?] [#] [ ] [ ] ===
, ` , ` [ ] , ` , ` , ` ~ ~
, ` ; ; [ ] [?] , ` , ` ~ ~
, ` [ ] , ` , ` ~ ~
[ Exits: N E S W ]
<MAPEND>
The line after <MAPSTART> is the one which is firing, not the one with the number on it.
I'm not sure what to suggest as a fix, it depends what you are trying to do. However that explains *why* it is doing it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Fri 19 Nov 2010 08:53 PM (UTC) Amended on Fri 19 Nov 2010 08:54 PM (UTC) by Nick Gammon
|
| Message
|
Whininguser said:
It seems as if the trigger was both called and not called. Isn't this nuts? :D
This can be explained too. Older versions of MUSHclient, like the one you are using, have the behaviour that if you do a Note (or print) in a trigger that omits from output(*), then the note is omitted from output as well. Which is what happened to you.
Newer versions batch up the things to be printed, and thus you still see them.
[EDIT] (*) Your trigger didn't omit from output, but *a* trigger did. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Whininguser
Canada (30 posts) Bio
|
| Date
| Reply #3 on Fri 19 Nov 2010 11:41 PM (UTC) Amended on Sat 20 Nov 2010 12:27 AM (UTC) by Whininguser
|
| Message
| Mystery solved. Thank you!
By the way, I use 4.33 (downloaded from Aardwolf) because I like all the plugins in the package, and I don't know whether things will be as stable when the plugins are used in 4.61...Should I go ahead with the upgrade? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Sat 20 Nov 2010 12:18 AM (UTC) |
| Message
| | You should be able to download on top of the existing one and not lose your plugins. However I would make a copy of everything first. Also, if it works, why fiddle with it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Whininguser
Canada (30 posts) Bio
|
| Date
| Reply #5 on Sat 20 Nov 2010 12:28 AM (UTC) |
| Message
|
Nick Gammon said:
Also, if it works, why fiddle with it?
Good point. | | 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,021 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top