Thanks almost correct but
after win it should not change the bet it should stay wat it was before
I need 2 counts or profit
first everytime when profit hits 100 sato it needs to reset bet and next when total profit hits 1000 it should stop
Try this version... Slight rearrangement, so that it only resets if the profit > 100 sats, otherwise it will just bet whatever it bet last time... Which seems a bit dangerous (if it martingales up to like 2048 sats, wins once (your profit will be 1 sat) and then goes on another long losing streak, you will lose your bankroll pretty quickly!!

I hope you have a big bankroll...

chance=49.50
multiplier=2
base=0.00000001
nextbet=base
bethigh=true
function dobet()
if win then
if profit > 0.00000100 then
resetstats()
nextbet=basebet
else
nextbet=previousbet
end
else
nextbet=previousbet*multiplier
end
if profit > 0.00001000 then
stop()
ching()
end
end