Thanks for some pointer but now it is way over my level.
I wonder if i will put the counter would it not count lost multiplied games to?
Yes as I showed it, it would just bet lo lo hi hi lo lo lo etc. it doesn't check if the bet won or lost. Which is exactly what you asked for. Notice I didn't say wanted.....

You need to be very explicit, when your asking for something to be programmed.
My idea and your often will not be the same...
If you just wanted to switch after a win you could move that code to the else path of your !win if statement.
If you think about it. The initialization part of the script is almost like filling in the website getting ready to make your first bet. The Dobet function is the thought process you go thought for every other bet.
So you roll the first time.
What are you going to do if you win,
And what are you going to do if you lose.
if win then
This is what I'm going to do if I win.
else
This is what I'm going to do if I lose
end
When the bot hits the last end statement (ending the function) it rolls again.
and dobet gets called again with the new results.