I have discovered a bit of a problem with the wildcards variable in triggers. If it's not a "wildcard" it doesn't appear as an option. For example the pattern "^You see exits leading (north|northeast|east|southeast|south|southwest|west|northwest|up|down|in|out) and (north|northeast|east|southeast|south|southwest|west|northwest|up|down|in|out).$"
Will not return the north/northeast regular expression matches in the wildcards. So, I got PHPScript to work on MUSHClient and I fixed this problem.There's my workaround for this, just in case someone wants to do some weird stuff with regular expressions and actually grab the results. ;)
Another benefit of this method is it does not limit you to ten regular expressions wildcards--you can have as many as you like, with any language!
I hope someone finds use for this, and I apologize if this subject is already covered in some way.
-- Macai
Will not return the north/northeast regular expression matches in the wildcards. So, I got PHPScript to work on MUSHClient and I fixed this problem.
function MyTriggerFunctions($name,$line) {
$pattern=$world->gettriggerinfo($name,1); // grab the regular expressions pattern of the trigger
ereg($pattern,$line,$wildcards); // dumps all the actual wildcards results into the variable $wildcards
$world->Note(print_r($wildcards,true)); // this just displays that $wildcards array
}Another benefit of this method is it does not limit you to ten regular expressions wildcards--you can have as many as you like, with any language!
I hope someone finds use for this, and I apologize if this subject is already covered in some way.
-- Macai