Strange trigger reaction while speedwalking in Aardwolf

Posted by Whininguser on Fri 19 Nov 2010 01:53 PM — 6 posts, 21,063 views.

Canada #0
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
Amended on Fri 19 Nov 2010 02:24 PM by Whininguser
Australia Forum Administrator #1
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.
Australia Forum Administrator #2
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.
Amended on Fri 19 Nov 2010 08:54 PM by Nick Gammon
Canada #3
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?
Amended on Sat 20 Nov 2010 12:27 AM by Whininguser
Australia Forum Administrator #4
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?
Canada #5
Nick Gammon said:

Also, if it works, why fiddle with it?


Good point.