|
Mbwana Beginner
Joined: 18 May 2002 Posts: 10 Location: Canada
|
Posted: Sat May 18, 2002 10:35 am
Having trouble with something. |
Okay, Im working on a craps script.
When the dealer rolls, it looks like this-
Zeligar rolls both dice, one lands on a 4 and the other lands on a 1
Then, I have a trigger that looks like this-
Trigger..
Zeligar rolls both dice, one lands on a %1 and the other lands on a %2
Pattern...
#Math total (%1+%2)
#If {@total=@winningnumbers} {say congradulations, you have won.} {say Im sorry, you've lost.}
the @winningnumbers variable is set to the numbers 2,3,12 which are the winning numbers for Any Craps.
It never seems to work out the @total to equate to one of the 3 winning numbers that are listed in the @winningnumbers variable. Can someone help me out here?
Mbwana LifeWind
"Hope is the denial of reality." |
|
|
|
Gandorf Novice
Joined: 28 Oct 2000 Posts: 38 Location: Sweden
|
Posted: Sat May 18, 2002 11:45 am |
First of all you trigger should look like this
#tr {Zeligar rolls both dice, one lands on a (%d) and the other lands on a (%d)} {#math total (%1+%2); #if (@total={@winningnumbers}) {say congradulation, you have won.} {say I'm sorry, you've lost.}}
Gandorf
-------------------------
Out in the night they laugh about me and my knowledge |
|
|
|
Mbwana Beginner
Joined: 18 May 2002 Posts: 10 Location: Canada
|
Posted: Sat May 18, 2002 8:43 pm |
Okay, I've got that down. Thanks alot dude. But now it has uncovered a new problem in a different part of my script, using emotes to fool my script into thinking he has rolled a winner. My trigger looks like this-
Pattern-
Zeligar rolls both dice, one lands on a (%1) and the second lands on a (%2)
Value-
#Math temp (%1+%2)
#if (@temp=12) {
say Congradulations, you have boxcars!
give 8000000 coins @player
#T- Boxcars
#T+ Vendor
title is available to play craps. |whois|
} {
say I'm sorry, you have lost.
#T- Boxcars
#T+ Vendor
title is available to play craps. |whois|
}
Now, if I had Mbwana emote a winner, what zeligar sees would look something like this...
Mbwana Zeligar rolls both dice, one lands on a 6 and the second lands on a 6
Mbwana says 'Zeligar rolls both dice, one lands on a 6 and the second lands on a 6'
Or the triggering line can be in the form of a tell, etc.
How can I prevent this?
Mbwana LifeWind
"Hope is the denial of reality." |
|
|
|
Gandorf Novice
Joined: 28 Oct 2000 Posts: 38 Location: Sweden
|
Posted: Sat May 18, 2002 9:12 pm |
Still you are using %1%2 in the pattern that you shouldn't do. Use %d instead. If you don't want any emoteing it use "^" at the start of the pattern and a "$" at the end. The "^" checks so it is the beginning of the line therefore anything before Zeligar won't make the trigger set off. The $ just checks for a newline or end of the line. It isn't really needed here but can be good to have anyway
Gandorf
-------------------------
Out in the night they laugh about me and my knowledge |
|
|
|
Mbwana Beginner
Joined: 18 May 2002 Posts: 10 Location: Canada
|
Posted: Sat May 18, 2002 9:22 pm |
Okay, I've done everything you've suggested. I've put the ^ at the beginning of the pattern and the $ at the end, as well I have replaced the %1, %2 with (%d), (%d). But when I do this, when a person plays, the trigger wont execute.
Mbwana LifeWind
"Hope is the denial of reality." |
|
|
|
Gandorf Novice
Joined: 28 Oct 2000 Posts: 38 Location: Sweden
|
Posted: Sun May 19, 2002 8:46 am |
I have tried the first example you gave to see if it works. And it does work for me.
Pattern:
^Zeligar rolls both dice, one lands on a (%d) and the second lands on a (%d)
Value:
#math temp (%1+%2)
#if (@temp=2 OR @temp=3 OR @temp=12) {say congradulations you have won} {say sorry but you have lost}
Gandorf
-------------------------
Out in the night they laugh about me and my knowledge |
|
|
|
|
|