|
buckleyp Newbie
Joined: 14 Feb 2005 Posts: 2
|
Posted: 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 |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: 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 "" |
|
|
|
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: 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} |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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} |
|
|
|
|
|