# Seuntjies DiceBot

## DiceBot => Programmer Mode => Topic started by: b6497907 on August 04, 2019, 09:15:48 am

Title: how to write if win then change to 60%~90% chance
Post by: b6497907 on August 04, 2019, 09:15:48 am
Can someone teach me how to write
like this  49.50->60->70->80->90->70->80->90

I don't know how to write~
plz help me

chance = 49.50
bethigh = true
basebet = balance
nextbet = balance

function dobet()
if (win) then
chance = 60
nextbet = balance
end
if (win) then
chance = 70
nextbet = balance
end
if (win) then
chance = 80
nextbet = balance
end
if (win) then
chance = 90
nextbet = balance
end
if (win) then
chance = 70
nextbet = balance
end
if (win) then
chance = 80
nextbet = balance
end
if (win) then
chance = 90
nextbet = balance
end
end
Title: Re: how to write if win then change to 60%~90% chance
Post by: Seuntjie on August 04, 2019, 09:33:40 am
Be sure to look through the programmer mode tutorials on https://forum.seuntjie.com/index.php?topic=2.0

The steemit tutorials are more aimed towards players with little programming experience
Title: Re: how to write if win then change to 60%~90% chance
Post by: BlueSuede on August 13, 2019, 12:57:33 pm
This should work..

chance = 49.50
bethigh = true
basebet = balance
nextbet = balance
myWins = 0

function dobet()
if (win) then
myWins+=1
if (myWins == 1) then
chance = 60
nextbet = balance
elseif (myWins == 2) then
chance = 70
nextbet = balance
elseif (myWins == 3) then
chance = 80
nextbet = balance
elseif (myWins == 4) then
chance = 90
nextbet = balance
elseif (myWins == 5) then
chance = 70
nextbet = balance
elseif (myWins == 6) then
chance = 80
nextbet = balance
elseif (myWins == 7) then
chance = 90
nextbet = balance
end
end
end
Title: Re: how to write if win then change to 60%~90% chance
Post by: Seuntjie on August 13, 2019, 01:10:54 pm
wins is an internal variable and cannot be used as in BlueSuedes example. See https://forum.seuntjie.com/index.php?topic=2.0 for a list a of variables. Or just look in the variables tab in DiceBot.

look at the internal variable currentstreak.

From https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-1-1-variables
Quote
currentstreak, type double. Permission: Read Only. Shows the current winning or losing streak. When positive (>0), it's a winning streak. When negative (<0) it's a losing streak. Can never be 0. Only set after first bet.
Title: Re: how to write if win then change to 60%~90% chance
Post by: BlueSuede on August 13, 2019, 01:48:50 pm
Thanks, I've updated the variable.

wins is an internal variable and cannot be used as in BlueSuedes example. See https://forum.seuntjie.com/index.php?topic=2.0 for a list a of variables. Or just look in the variables tab in DiceBot.

look at the internal variable currentstreak.

From https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-1-1-variables
Quote
currentstreak, type double. Permission: Read Only. Shows the current winning or losing streak. When positive (>0), it's a winning streak. When negative (<0) it's a losing streak. Can never be 0. Only set after first bet.