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


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Wed Nov 27, 2002 10:14 pm   

Random reply trigger/variables not working!
 
Hello again,
I've looked through the forum, but still am coming up at a loss for my problem.

I have a bot set up to accept donations and thank the person for giving the specific item. (trigger: ^(%w) gives you (*) value: tell %1 Thanks for the %2). That works fine.

What I would *like* to do is have it give one of 10 responses to thank them for their donation. Here is where my problem is coming in however. I left the trigger the same ( ^(%w) gives you (*)), in the value box I have:
%item(@Responses, %random(1, %numitems(@Responses)).

I set up the variables in the following manner:
#VAR Responses {tell %1 blah blah %2|tell %1 bleh bleh %2|...}

Now, when someone gives me something, it tries to send all 10 replies at once, and also fails to see their name as indicated by the trigger, which tells me it would also fail to see what they have given me.

I'm still a bit new to the scripting process, I'm trying to inch my way deeper into it, but I'm not sure what I'm doing wrong in this situation.

Any help would be Greatly appreciated.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Nov 27, 2002 11:02 pm   
 
Using variables inside other variables is tricky and seldom necessary. In this instance, I'd recommend #CASE.

#TR {(%w) gives you (*)} {#CASE %random(1, 2) {tell %1 blah blah %2} {tell %1 bleh bleh %2}}

LightBulb
Senior Member
Reply with quote
Madamegato
Beginner


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Thu Nov 28, 2002 1:40 am   
 
Thanks for the suggestion...
I tried it and though it filled in the name and donation, it still sent all of the cases.

One thing that I didn't do was put the brackets outside of the #CASE statement. When I tried it wouldn't save. Any other things that I might not be doing right?
M.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Nov 28, 2002 1:56 am   
 
It works. I've tested it. The only thing I can think of is that you might have changed something in your preferences or have some other setting (trigger, alias, etc) that's causing it to send all of them.

LightBulb
Senior Member
Reply with quote
Madamegato
Beginner


Joined: 27 Nov 2002
Posts: 27
Location: USA

PostPosted: Thu Nov 28, 2002 3:59 am   
 
I figured it out. :o)
I actually didn't need the (1,2,3...ect) in the trigger.

#TR ^(%w) gives you (*)
#CASE %random {tell %1 blah blah %2} {tell %1 bleep bleep %2}

It works! But, Lightbulb, again you have come to my rescue and I thank you so much. Without you, I would have never thought of using a case statement. I'm glad there are the knowledgeable people out there like yourself that can help newbies (n00bies if you prefer...) like myself.

*smile* *hug*
M.
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