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
astrotaz
Beginner


Joined: 09 Aug 2011
Posts: 12

PostPosted: Sat Feb 01, 2014 8:42 pm   

Testing a string in a variable
 
I hope I can explain this well enough to get some help.


I'm using a trigger to capture some text and put it into a variable

for example

ITEM_A big round apple

I trigger on ITEM_&item

#SHOW @item has A big round apple

np so far ...


now if I want to perform an IF test on the variable @item


#IF (@item="*apple") {do something} {do nothing}

How can I use a wildcard to just test for the presence of apple in that variable without having to test #IF (@item="A big round apple") etc.etc..



Thanks
-A
Reply with quote
astrotaz
Beginner


Joined: 09 Aug 2011
Posts: 12

PostPosted: Sat Feb 01, 2014 8:47 pm   resolved
 
sorry for the trouble I found the answer


#IF (@item=~"* apple")
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Feb 02, 2014 6:48 am   
 
%match(@item, "apple")
_________________
Discord: Shalimarwildcat
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