Hello Guest

# how to write if win then change to 60%~90% chance

• 4 Replies
• 837 Views

#### b6497907

• 1
• +0/-0
##### how to write if win then change to 60%~90% chance
« 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

#### Seuntjie

• 468
• +13/-2
##### Re: how to write if win then change to 60%~90% chance
« Reply #1 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

#### BlueSuede

• 11
• +1/-0
• Programmer In Training
##### Re: how to write if win then change to 60%~90% chance
« Reply #2 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
« Last Edit: August 13, 2019, 01:48:13 pm by BlueSuede »
Need help programming a script? Contact me.
Discord: XclusiveDigital#8102

#### Seuntjie

• 468
• +13/-2
##### Re: how to write if win then change to 60%~90% chance
« Reply #3 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.

#### BlueSuede

• 11
• +1/-0
• Programmer In Training
##### Re: how to write if win then change to 60%~90% chance
« Reply #4 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.
Need help programming a script? Contact me.
Discord: XclusiveDigital#8102