Post
Topic
Board Gambling discussion
Re: Seuntjie' Dice bot programmers mode discussion.
by
seuntjie
on 04/09/2016, 08:26:13 UTC
Is there a way to reset the labouchere(win) function??


Code, something like this, what to insert at ##reset ??##??:


---

function dobet()

bal = balance

if maxbal == nil then maxbal = 0.00000001 end

oldmaxbal = maxbal

maxbal = math.max(bal, oldmaxbal)

if balance < maxbal*2/3 then ##reset ??##end

nextbet = labouchere(win)


end

---

Please help...

L

I think the only way to do this would be to set the value of the labouchere list. So

Code:
setvaluestring('settingname','value')
--the setting name is LabValues
--the value is a ? seperated list. This means if your labouchere list is
--0.1
--0.2
--0.3
--0.4
--0.5
--0.4
--0.3
--0.2
--0.1
--then your value is 0.1?0.2?0.3?0.4?0.5?0.4?0.3?0.2?0.1

--So try using
setvaluestring('LabValues','0.1?0.2?0.3?0.4?0.5?0.4?0.3?0.2?0.1')

--If you're going to be resetting at multiple places, I recommend making a global variable with the list
LabVals = '0.1?0.2?0.3?0.4?0.5?0.4?0.3?0.2?0.1'

function dobet()

--script things

--reset
setvaluestring('LabValues',LabVals)

--script things
end

Alternatively you can write your own reset function LUA that does that and resets any variables etc you need to reset.

Note on this approach: If you reset the list and do not call labouchere(win) it will use the latest value set to nextbet.
If you DO call labouchere(win) it will calculate the second bet (since you told it there's been a win or a loss). If you reset it using this method, you need to manually set the size of the next bet for it to be the correct size.

Edit: Just realized that because of some internals in the bot, this might or might not work.... I'm honestly not sure and it's up to you to test Smiley