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
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: Mon Sep 06, 2010 6:36 pm   

#IF expression having more than one condition
 
This may be a simple one, but I couldn't find the answer in a previous post.

I have a simple trigger that populates the long name of a mob to the variable "lstarget". The long name may be something like "a lumbering turtle" or "the robber thief", etc. I want to strip the "A, a, an, the..." article.

Is there any way to do the following and get it to work right?

#IF (%word(@lstarget,1)="A|an|the") {etc..}

Or do I have to do this:

#IF ((%word(@lstarget,1)="A") || (%word(@lstarget,1)="an") || (%word(@lstarget,1)="the")) {etc...}
Reply with quote
robecks
Beginner


Joined: 22 Jun 2010
Posts: 17

PostPosted: Mon Sep 06, 2010 7:49 pm   
 
#IF (%word(@lstarget,1)="{A|an|the}") {etc..}

should work iirc
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Sep 06, 2010 9:40 pm   
 
#if (%ismember(%word(@IsTarget,1),"A|an|the")) {...}
_________________
EDIT: I didn't like my old signature
Reply with quote
Shezmu
Wanderer


Joined: 23 Apr 2010
Posts: 53

PostPosted: Mon Sep 06, 2010 10:28 pm   
 
Thanks Matt. Worked perfectly. I don't know why I didn't think of ismember.
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