lovetosing2011
lovetosing2011
  • Threads: 2
  • Posts: 10
Joined: Oct 21, 2016
October 24th, 2016 at 1:05:31 AM permalink
I'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.
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
October 24th, 2016 at 3:12:30 AM permalink
Go line by line, see what the code is doing.

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
Tanko
Tanko
  • Threads: 0
  • Posts: 1199
Joined: Apr 22, 2013
October 24th, 2016 at 4:25:46 AM permalink
Quote: lovetosing2011

I'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
Steen
Steen
  • Threads: 0
  • Posts: 126
Joined: Apr 7, 2014
October 24th, 2016 at 5:21:48 AM permalink
Quote: lovetosing2011

I'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
lovetosing2011
lovetosing2011
  • Threads: 2
  • Posts: 10
Joined: Oct 21, 2016
October 24th, 2016 at 5:37:47 PM permalink
Another option would be:

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
discflicker
discflicker
  • Threads: 30
  • Posts: 457
Joined: Jan 1, 2011
October 25th, 2016 at 1:18:22 AM permalink
Won'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?
The difference between zero and the smallest possible number? It doesn't matter; once you cross that edge, it might as well be the difference between zero and 1. The difference between infinity and reality? They are mutually exclusive.
lovetosing2011
lovetosing2011
  • Threads: 2
  • Posts: 10
Joined: Oct 21, 2016
October 25th, 2016 at 2:20:35 AM permalink
Quote: discflicker

Won'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.
Last edited by: lovetosing2011 on Oct 25, 2016
  • Jump to: