cs1count = 0 :
if dice total = any(9)
then add 1 to cs1count :
else cs1count =0 :
endif
if dice total = any(9)
and cs1count = 1
then bet $5 on place5 :
else cs1count = 0 :
endif
The program just Place bets $5 the first time a 9 comes up. Any help on this would be appreciated.
Any(9) means you had 1 to your variable. Then a few lines below it checks for any 9 again....if the variable is 1, then it bets $5.
Try something like this:
If dice total = 9 then
If var = 1 then
Bet $5 on 9
Else
Var = var + 1
Else
Var = 0
End if
Quote: lovetosing2011I'm trying to code in the WinCraps program specifically. I can't seem to find a way to get the auto-bet to Place the 9 for $5 only after it appears back to back:......
The program just Place bets $5 the first time a 9 comes up. Any help on this would be appreciated.
Not Tested:
If
initializing script
then
cs1=0
endif
if
dice total=any(9)
then
add 1 on cs1
endif
if
cs1>1
then
place9=5
endif
if
cs1=1
and
dice total=any(2,3,4,5,6,7,8,10,11,12)
then
cs1=0
endif
if
cs1=0
then
place9=0
endif
Quote: lovetosing2011I'm trying to code in the WinCraps program specifically. I can't seem to find a way to get the auto-bet to Place the 9 for $5 only after it appears back to back:
cs1count = 0 :
if dice total = any(9)
then add 1 to cs1count :
else cs1count =0 :
endif
if dice total = any(9)
and cs1count = 1
then bet $5 on place5 :
else cs1count = 0 :
endif
The program just Place bets $5 the first time a 9 comes up. Any help on this would be appreciated.
You've got the right idea -- using a checkstack to flag the first 9 -- but your mechanics are a bit off. Remember that auto-betting runs through your entire script after each roll unless you redirect it. It doesn't pause to roll the dice between your two conditional statements. So after the first 9 rolls your first conditional statement increments cs1.count to 1 which makes your second conditional true (because 9 just rolled and cs1.count = 1) and hence, your bet gets made.
Instead, you need to preserve the value of cs1.count so that it can be evaluated in the next roll. In other words, don't reset it to zero in your very first line as you've done.
There are many ways to skin this cat. The code RS wrote will work fine if you'll add another "EndIf" after the line "Var= Var +1" and of course substitute cs1 for Var.
Another option would be:
If dice total = 9 Then
add 1 to cs1.count
Else
cs1.count = 0
EndIf
If cs1.count = 2 Then
bet $5 on Place5
EndIf
One advantage of this method is that you can easily adapt it to more 9's in a row -- ie, If cs1.count = 3
The shortest code I can think of is:
If dice total = 9 And cs1.lastroll = 9 Then
bet $5 on Place9
EndIf
cs1.lastroll = dice total
You should be able to copy and paste this code directly onto your auto-bet screen. Also, for what it's worth, while "any(9)" is perfectly acceptable, you can just use "9" as in, "If dice total = 9". The keywords "any" and "all" are intended for multiple values.
Hope that helps.
Steen
If dice total = 9 Then
add 1 to unt
Else
unt = 0
EndIf
If unt = 2 Then
bet $5 on Place5
EndIf
Yay! Thanks, that was my problem. I was confusing myself, but it worked now! I used this code, because it was most similar to my existing code, but thanks for the help EVERYONE :D
When more than one back-to-back 9 pairs are rolled, the "bet $ place on Place5" will accumulate the $5 onto the bet amount?
Quote: discflickerWon't this occasionally place the 5 on a come-out roll? It would be not-working in this case?
When more than one back-to-back 9 pairs are rolled, the "bet $ place on Place5" will accumulate the $5 onto the bet amount?
This worked along with my other code. I fixed the problem by a combination of making count >= 2 (instead of just count = 2) and using on off commands.