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


Joined: 12 Oct 2002
Posts: 10
Location: Canada

PostPosted: Sun Oct 13, 2002 4:52 pm   

Coin Flip Triggers. Variable Needed?
 
Allright, I got my trigger all set up, now i just need to make it so that the persons name that gives me gold, is stored in a variable untill the end of the 'session' with my coin flip bot. if you want the trigger string, i'll post it here. thanks lots.
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sun Oct 13, 2002 5:03 pm   
 
If the message is "Bob gives 5 coins to you." then the trigger would be:

#TR {(%w) gives %d coins to you.} {#VAR gambler %1}

This is very basic; it just grabs the name and does not check the amount or try to verify it is not a social. Since I'm only grabbing the name, only the %w is enclosed in parentheses.

At the end of the session, execute the command #VAR gambler ""

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
blackwolffe
Newbie


Joined: 14 Oct 2002
Posts: 9
Location: Memphis Tennessee

PostPosted: Mon Oct 14, 2002 4:04 pm   
 
Basic yes, but somehow I just found out I was using $1 instead of %1 by reading your post, and fixed several different problems I was having with beginning issues. Thank you very much for your unknowing help. :-)

-Blackwolffe

On a hot summer night, would you offer your throat to the wolffe with the red, red, roses?
Reply with quote
zanakobu
Beginner


Joined: 12 Oct 2002
Posts: 10
Location: Canada

PostPosted: Tue Oct 15, 2002 3:01 am   
 
allright, that puts his name in the variable, but how do i a. use his name in another trigger sentence when he wins, and b. get rid of it after one 'round' of play?
Thanks
Reply with quote
zanakobu
Beginner


Joined: 12 Oct 2002
Posts: 10
Location: Canada

PostPosted: Tue Oct 15, 2002 3:07 am   
 
eer right, read all of it first :P, what would i use, when he wins, like i use %1, for (%w) what do i use for the variable?
Reply with quote
zanakobu
Beginner


Joined: 12 Oct 2002
Posts: 10
Location: Canada

PostPosted: Tue Oct 15, 2002 3:09 am   
 
Also, how do i use the #if, or is it %if, to make it so that if it randomly 'lands' on emote watches the coin land on heads, it will give X ammout of gold to gambler?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Tue Oct 15, 2002 4:59 am   
 
A complete script might look like this:


#TR {(%w) gives (%d) coins to you.} {
#VAR gambler %1
#VAR bet %2
#VAR results %case(%random(1,2),"heads","tails")
emote watches the coin land on @results
#IF (@results = "heads") {say You win!; give %eval(@bet*2) coins @gambler} {say You lose! Play again soon!}
}

Troubadour
(Win 98, Pentium III, 550 MHz)
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