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
Shalafi
Newbie


Joined: 05 Jul 2002
Posts: 1

PostPosted: Fri Jul 05, 2002 5:32 pm   

Evaluating expressions with strings
 
I'm having some difficulty with a zMUD trigger I've been working on and I can't seem to find an adequate answer in the helpfile (I'm probably looking in the wrong places, the helpfile is huge).

Here's the hitch ... I have an #if statement that checks the following expression:

#if @state=~*eb* {true} {false}

The @state variable is parsed from the MUD command prompt and tells you various things about your character. It is a string of letters, sometimes with a whitespace in between them. When eb occurs in it, it's always side by side like that. But those wildcard symbols next to the eb don't seem to take. How do I write it so it searches the string @state and looks for the "eb" pair, no matter what is to the left or right of it?

- Shalafi
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jul 05, 2002 6:56 pm   
 
#IF (%pos("eb",@state)) {true} {false}


LightBulb
Senior Member
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sat Jul 06, 2002 9:13 am   
 
I agree with Lightbulb's solution, but for future reference, the syntax for your command should be something like:

#if (@state =~ "*eb*") {true} {false}



 - Charbal
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