|
zanakobu Beginner
Joined: 12 Oct 2002 Posts: 10 Location: Canada
|
Posted: 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.
|
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: 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) |
|
|
|
blackwolffe Newbie
Joined: 14 Oct 2002 Posts: 9 Location: Memphis Tennessee
|
Posted: 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? |
|
|
|
zanakobu Beginner
Joined: 12 Oct 2002 Posts: 10 Location: Canada
|
Posted: 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 |
|
|
|
zanakobu Beginner
Joined: 12 Oct 2002 Posts: 10 Location: Canada
|
Posted: 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?
|
|
|
|
zanakobu Beginner
Joined: 12 Oct 2002 Posts: 10 Location: Canada
|
Posted: 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?
|
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: 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) |
|
|
|
|
|