What's the difference between the following variables?
Profit
currentprofit
tmpprofit
At the top of the code tab, in programmer mode, there is a list of available variables. profit and curentprofit are listed there. That is a list of variables already defined for your script. RO can only be referenced RW can be changed.
I believe profit is your current session profit from the last resetstat call. currentprofit is the profit from the last bet. both could be + or -.
tmpprofit is not used by the bot, but could be defined in your script. a lot of time you may want to do something till you hit a set profit. At the beginning of you script you could have tmpprofit += currentprofit.
That would now keep a running total of you profit since tmpprofit was set. Later you might check, if (tmpprofit > 4) then withdraw 3 and tmpprofit = 0. Setting tmpprofit to zero starts your profit calculation over.
So if I were to have
if currentprofit=-0.00000050 then
it would mean that once I have a negative value of 50 satoshi I would want the script to do something?
if currentprofit == -0.000000050 then <---- This is saying check the last bets profit and if it's equal to -50 satoshi's then do something.
(notice the double equal signs, you want to tell LUA this is a compare and not an assignment)
I normally have resetstats() above the function dobet() Then you could have
if profit == -0.00000050 then
To do something if my profit for this session has dropped to -50 satoshi's
so...
currentprofit is the last bets profit and
profit is the sessions profit
Thanks to your help I think that I nearly go it.
Would you have any idea why it's throwing me that Error?
LUA ERROR!!
primary expression expected, got 'then'
chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base
bethigh = true
resetstats()
function dobet()
if win then
nextbet=previousbet then
Nextbet = base
end
else
nextbet=previousbet*multiplier
if currentstreak==2 then nextbet = base end
end
else
if currentprofit=-0.00000050 then
if currentstreak==-1 then
if win then next bet = basebet end
end
end
end
I think you need to rethink your script.
There are 2 flavors of the "if" statement.
if (xyz) then
end
and
if (xyz) then
else
end
in you script you have
if win then
nextbet=previousbet then
Nextbet = base
end
else
Lua and I are both confused about what the else is. Since you have an end for the first if, the else is just dangling out there.
If you removed that first end after the first if, Lua would handle that first else, but then the next else would fail. But at this point I'm lost as to what your trying to do.
You may be missing the fact you can combine checks on 1 if statement so maybe
if currentprofit=-0.00000050 then
if currentstreak==-1 then
if win then next bet = basebet end
end
should be
if (currentprofit = -0.00000050 and currentstreak = -1 and win = true) then
nextbet = basebet
end
There is also a logical error. you can never have currentprofit and currentstreak negative, and still win.
since you can't go back and see what happened before, you can create a new variable, and set it when you reach your limit. Then in the win path when that variable is set you can reset the nextbet.