Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu May 08, 2008 8:51 am   
 
Confirmed.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: 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."
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: 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."
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net