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


Joined: 28 Jul 2004
Posts: 21
Location: Canada

PostPosted: Thu Aug 27, 2009 2:20 am   

making one trigger work for 12 stones
 
In the mud i play you can collect stones for a quest. I would like to set up 1 trigger to put any stone given to me into my bag.
Some stones when given to you show up with a a or an

gives you a moonstone.
gives you an opal.

I've tried this for a command

Trigger: gives you %d %d.
#IF %ismember ((@stones) {put stone in bag} {})

Not sure if i am missing anything or if this trigger can be set up different?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Aug 27, 2009 3:14 am   
 
1)
#trigger {gives you {a|an} (%w).} {#if (%ismember(@stones)) {put stone in bag} {whatever you want to do here}}

2)
#trigger {gives you {a|an} ({@stone}).} {put stone in bag}

#2 is probably going to be slower, since it has to test each and every element in the @stone stringlist until it finds a match. #1, however, will trigger whenever anything is given to you so even though the trigger is fast you might have it firing way too much.
_________________
EDIT: I didn't like my old signature
Reply with quote
shalimar
GURU


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

PostPosted: Thu Aug 27, 2009 3:38 am   
 
Shouldn't it be %ismember(@stone, %1)
_________________
Discord: Shalimarwildcat
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Aug 27, 2009 4:41 am   
 
By the way, the reason why your first trigger wouldn't have worked anyway is because %d is reserved for digits only. The trigger was looking for numbers, not words.

And yes, it should be %ismember(@stones, %1).

Charneus
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