It's close. Any idea what would give this error "input:18: unexpected symbol near '!'" ? So it looks like "(!win)" is the opposite of (win). But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo) it doesn't like it.
I thought in order to do the opposite we just do "not" so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.
The problem wasn't the !win. Lua was expecting an end for the "if win" Statement. I was trying to leave your logic the same but missed that end statement. So the code is
chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0
function dobet()
profitsincelastcycle += lastBet.Profit
if (win) then
if (profitsincelastcycle == 0.00004000) then
sleep(300000)
profitsincelastcycle = 0
else
nextbet=base
end
end -- Missing end statement
if (!win) then
nextbet=previousbet*multiplier
end
end
Personally I would have handled the !win part in an else path. But to each there own, and it's better that you understand what it's doing then I.
Should I be able to see the simulator pause or stop with the "sleep(300000)" command in there? Or does that only work when it's running real bets? When I run the sim, martingale works correctly but I don't see any sleep.
Did you cut/paste the above script? Simulator will wait/loop. It actually hangs the bot with the spinning circle thingy....
Are you incrementing profitsincelastcycle? Are you checking the same variable? You can check things out on the console. type "print(profitsincelastcycle)" no quotes, to see what that variable contains.