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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Thu May 22, 2008 2:06 pm   

same trigger?
 
I've got two triggers, when at first appearence, they look the same. However... I they are not. One has upper case, and the other has lower case. Other then that, they are identical. I have the "case sensitive" box checked, however... When working with the trigger or whatever... It prompts me that I have two of the same triggers, when... I don't. Or at least, I shouldn't. Very confused. TIA!

Code:
  <trigger priority="430" case="true" newline="false" prompt="true" id="43">
    <pattern><![CDATA[^~[H:&%dhit_cur/&%dhit_max] ~[M:&%dman_cur/&%dman_max] ~[S:&%dspi_cur/&%dspi_max] ~[E:&%dend_cur/&%dend_max]]]></pattern>
    <value>#if (@bkill = 1) {#if (@bcombat) {#if (@bdetect = 0) {act} {move}}}</value>
  </trigger>
  <trigger priority="429" case="true" newline="false" prompt="true" id="292">
    <pattern><![CDATA[^~[h:&%dhit_cur/&%dhit_max] ~[m:&%dman_cur/&%dman_max] ~[s:&%dspi_cur/&%dspi_max] ~[e:&%dend_cur/&%dend_max]]]></pattern>
    <value>#if (@bkill) {#var bdetect 0}</value>
  </trigger>
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu May 22, 2008 2:57 pm   
 
Good point; I guess this is ignoring the case sensitivity option. You can get around it for now by giving one or both of the triggers IDs.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Thu May 22, 2008 3:12 pm   
 
This a bug? I can give them ID's no issue there. Thanks!
Reply with quote
Zugg
MASTER


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

PostPosted: Wed May 28, 2008 7:37 pm   
 
Yes, CMUD is comparing the Name field of the settings in a case insensitive way, since that is how they are stored in the internal hash table. The case sensitivity option for triggers is only used by the trigger tester and doesn't have any effect on how settings are searched for in the internal hash table.

For example, if you do this:
Code:
#TRIGGER {test} {my command}
#TRIGGER {TEST} {my new command}

you will actually overwrite the first trigger and will *not* create a new trigger with different case, regardless of the case sensitivity of the trigger. This is true of all settings (aliases, variables, etc). CMUD is generally not case sensitive. So yes, as Fang mentioned, if you want to do something like this, you need to assign a unique ID to each trigger.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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