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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
buckleyp
Newbie


Joined: 14 Feb 2005
Posts: 2

PostPosted: Mon Feb 14, 2005 8:31 am   

#IF statement thats not case sensitive..
 
Im trying to do the following:-

#if (%1 = a) {#ad npccount 1}
#if (%1 = an) {#ad npccount 1}
#if (%1 = two) {#ad npccount 2}

etc.

Which works perfectly for when someone else is leading, but as soon as I lead the first word is capitalised so the comparrision fails.

Is there any way to either ignore the case on an IF compare, or do IF (this) or (That)? I would prefer not to have to double up on my code.

Two days and its driving me crazy :p

Thanks

buckleyp
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Mon Feb 14, 2005 8:58 am   
 
#VAR countword %lower(%1)
#if (@countword = "a") {#ad npccount 1}
#if (@countword = "an") {#ad npccount 1}
#if (@countword = "two") {#ad npccount 2}
.
.
.
#VAR countword ""
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Mon Feb 14, 2005 11:40 am   
 
The following would work as well.

#if %ismember(%1,"a|A|an|An") {#ad npccount 1}
#if %ismember(%1,"two|Two") {#ad npccount 2}
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Feb 14, 2005 4:10 pm   
 
or :P
#add cnt %if(%ismember("%1","a|A|an|An"),1,%if(%ismember(%1,"two|Two"),2,0)


this works too
#if (%1 =~ a) {#ad npccount 1}
#if (%1 =~ an) {#ad npccount 1}
#if (%1 =~ two) {#ad npccount 2}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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