basebet = 0.00000001
chance  = 4.95
bethigh = false
nextbet = basebet
target  = 1
old     = balance 
lol     = 0
resetstats()

function dobet()              
 if win then
     bethigh = !bethigh
     lol     = 0
 else
     lol = lol+1
 end
 if lol>=15 then
     nextbet = previousbet*2
     lol     = 0
 end
 if balance>=old then
     lol     = 0
     nextbet = basebet
     old     = balance
 end
if (balance>target) then
   stop()
end 
end