[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Whininguser   Canada  (30 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] 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
[Go to top] top

Posted by Whininguser   Canada  (30 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] 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
[Go to top] top

Posted by Whininguser   Canada  (30 posts)  [Biography] 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.
[Go to top] 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.


14,067 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]