#28 Broken array handling in regex triggers

closed
None
5
2010-12-24
2010-09-14
Majik Fox
No

If I use a perl regex in a trigger to capture text into an array, the array is not erased after the trigger executes.

Since there's no way to specify into which array data is stored, and there's no way to unset the array, there can be only one array.

This allows only one trigger to be created that uses perl regex.

If I create a second trigger that accesses "the array," the second trigger executes the action using a literal string based on the type input I used.

For example, I want to trigger on a line that says

Foo steps out of the teleport booth.

I create a trigger with a regex pattern like this:

^(.*) (\(a\s)(.*)\) steps out of the teleport booth

And that trigger has an action of:

/$world->send("look $_[1]")

...The first trigger correctly takes the first regex match and stores it in [1] and then sends "look foo" to the world because "foo" is the contents of [1].

And then I create a second trigger with this regex pattern:

^(.*) (\(a\s)(.*)\) walks over from the west

With this action:

/$world->send("ws $_[1]")

The second action "ws $_[1]" is sent to the world as "ws 1" which makes no sense, since "1" could not possibly be the contents of [1].

I have tried this with other MUD clients that have regex triggers and none of them had this problem.

Discussion

    • assigned_to: nobody --> ekalin
     
  • I could not reproduce this. I created the triggers as you specified and everything worked as expected.

    Try exporting the triggers and uploading the file here so I can use the exact same settings you have. Also, actual lines sent by the server could help in trying to match the triggers.

     
    • status: open --> pending
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending --> closed