chance = 50
div = 5000
base = balance / div
nextbet = base
h = 1
high = 0
low = 0
bethigh = true
rolls = {}
mode = 1
betcount = 0
function dobet()
betcount = betcount + 1
div = 5000
base = balance / div
nextbet = base
if (lastBet.roll >= 50) then
h = 1
high = high + 1
else
h = 0
low = low + 1
end
table.insert(rolls, h)
if not win then
base = base + 2 * (balance / div)
else
base = base - (balance / div)
end
if (mode == 1) then
if (#rolls >= 2 and rolls[#rolls] ~= rolls[#rolls - 1]) then
if (rolls[#rolls] == 0) then
bethigh = false
nextbet = base
else
bethigh = true
nextbet = base
end
mode = 2
elseif (#rolls >= 3 and rolls[#rolls] ~= rolls[#rolls - 1] and rolls[#rolls
- 1] == rolls[#rolls - 2]) then
if (rolls[#rolls] == 0) then
bethigh = true
nextbet = base
else
bethigh = false
nextbet = base
end
end
elseif (mode == 2) then
if (#rolls >= 2 and rolls[#rolls] ~= rolls[#rolls - 1]) then
if (rolls[#rolls] == 0) then
bethigh = false
nextbet = base
else
bethigh = true
nextbet = base
end
mode = 1
elseif (#rolls >= 3 and rolls[#rolls] ~= rolls[#rolls - 1] and rolls[#rolls
- 1] == rolls[#rolls - 2]) then
if (rolls[#rolls] == 0) then
bethigh = true
nextbet = base
else
bethigh = false
nextbet = base
end
end
end
if nextbet <= base then nextbet = base end
end