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


Joined: 04 Feb 2006
Posts: 5

PostPosted: Sat Sep 13, 2008 8:19 pm   

#IF working off a variable list.
 
Hi!
I need some help with a rather simple #IF function but I just can't wrap my head around it.

Example:
Brunte pokes Ivar in the ribs.
(%w) pokes (%w) in the ribs.

Now, I want to have a variable list of names that it should trigger on and only executer it on those names.
So something like this:
#IF {%1 (exist in variable} {tell %1 stop poking %2!} {}
^---- here is the problem, I can't get this part to work.

I'm pretty sure there's a simple solution to this.. I just can't get it :D

Many thanks for any quick answers!
Hope anyone can make some sense out of it, if not please ask me to elaborate on it.


Last edited by akkappap on Sat Sep 13, 2008 8:21 pm; edited 1 time in total
Reply with quote
shalimar
GURU


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

PostPosted: Sat Sep 13, 2008 8:21 pm   
 
#IF (%ismember(%1, @listVar)) {tell %1 stop poking %2!}

you could also use the varList in your trigger

#TR {({@varList}) pokes (%w)} {tell %1 stop poking %2!}
_________________
Discord: Shalimarwildcat
Reply with quote
akkappap
Newbie


Joined: 04 Feb 2006
Posts: 5

PostPosted: Sat Sep 13, 2008 8:25 pm   
 
Haha, you're the man Shalimar!
Fastest response ever, so fast I didn't even have time to edit this post right after I posted it. :D

Many thanks! works like a charm!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Sep 14, 2008 12:58 am   
 
Exclamation Question
I think we've got a new forums record. 2-second response time? You deserve a temporary custom posting title of "Ninja" for that one.
_________________
EDIT: I didn't like my old signature
Reply with quote
shalimar
GURU


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

PostPosted: Sun Sep 14, 2008 1:00 am   
 
Thats 2 minute, but i will gladly take the title if its made :)
_________________
Discord: Shalimarwildcat
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