Amended on Tue 14 Jul 2009 08:47 PM (UTC) by Phaeton
Message
You can't just assert negatives with !NotThis. Here's an example you can probably build from, simplified somewhat. You probably want to use a negative look behind like so.
^.+(?<!You) (scratches|hits|wounds) (\w+)[.!]$
Personally, I deal with this situation with grammar (may not be possible on the MUD you play on), and by matching based off colours. However, you can build in your other assertions as needed with that match. This would capture hit hit and Kevin's name.
Edit: It's worth noting that you'll want to do some things programatically rather than trying to build the kitchen sink into the match. It opens up more options for actions to take based on dynamic names and that kind of jazz.
Also, I highly recommend you check out a regex tutorial. There's one here, but I find the tutorial at http://www.regular-expressions.info/ to be pretty delightful.
Hey,
Sorry to bother you guys again, but I'm having more trigger problems...
I'm trying to make a line that will match on when someone in the group except me is in a fight and I want it to get the name of the person that's fighting.
So I thought I'd make a regular expression that would match on the mob's name that's hitting, the damage type and the person who's been hit. So I made this regexp, but it seems to be matching on every line for some reason and not returning my wildcards.
<trigger
match="^.*!Your scratches|hits|wounds|injures|mauls|decimates|devastates|maims|MUTILATES|DISMEMBERS|DISEMBOWELS|MASSACRES|\*\*\* MASSACRES \*\*\*|\*\*\* DEVASTATES \*\*\*|\*\*\* OBLITERATES \*\*\*|\*\*\* DEMOLISHES \*\*\*|\*\*\* ANNIHILATES \*\*\*|\*\*\* DESTROYS \*\*\* (w+!you!him!her!it!them)[!.]$"
regexp="y"
script="gfight"
sequence="100"
enabled="n"
>
</trigger>
For example, it should match on the wolf's bite hits Kevin, but not your slash hits Kevin.
Note that it's disabled because t was matching on every line and giving me compile errors.
Thanks all.
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.