|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu May 08, 2008 8:32 am
[2.24] database variables |
#ADDK kill giant 1
#ADDK kill "giant spider" 1
#ADDK kill "giant leader" 1
#TR {{@kill}} {#CW saddlebrown}
#ECHO @kill
It seems to not be catching the spider or leader, but it does get just the word 'giant'. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Thu May 08, 2008 8:51 am |
Confirmed.
|
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Thu May 08, 2008 12:02 pm |
I think the problem is the order the keys are being presented in the regex
currently it's (?:giant|giant spider|giant leader) so giant is found and accepted first it needs to be something like (?:giant spider|giant leader|giant) |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Thu May 08, 2008 12:33 pm |
I double checked when I tested it, though, by creating a trigger with #TRIGGER {{giant|giant spider}} {#CW saddlebrown} and it correctly colored both giant and giant spider.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu May 08, 2008 4:29 pm |
Sigh. It's because regex actually needs the string list sorted in *reverse* order (so that shorter strings are first), and database variables are currently being sorted in ascending order. Looks like I'll be releasing 2.25 today. I'm so burned out.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu May 08, 2008 5:04 pm |
Sounds like it needs to be sorted by %length then, not alphabetically, because in the settings editor, the shorter "giant" is listed first.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Thu May 08, 2008 5:16 pm |
If he just reverses the sort order (makes it descending) then shorter prefixes will come last.
|
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu May 08, 2008 5:51 pm |
There has always been a routine in the trigger conversion that does the reverse sort of the list. In 2.23 CMUD would convert the database variable to a list, and then this routine would sort the list in reverse order. When I made the change to improve the speed of creating the database list, I just forgot that the order needed to be reversed and I had removed the call to the string list sort routine because I thought it was redundant. In 2.25 it properly creates the database list in reverse order, so it is still fast, and I've added a comment to the code so that in the future I won't forget that a reverse order is needed.
|
|
|
|
|
|