Post
Topic
Board Gambling
Re: Seuntjies DiceBot -Multi-Site, multi-strategy betting bot for dice. With Charts!
by
HCP
on 22/08/2020, 20:33:15 UTC
Quote

basebet = balance / 1024
nextbet = basebet
chance  = 97.2549

function dobet()
    if (lastBet.Roll < 3.3 or lastBet.Roll > 96.7) then
        chance = 49.1089
    end
   
        if !win then
            nextbet = previousbet*2
        else
            nextbet = balance / 1024
            chance  = 97.2549  <-- This is where it is resetting your chance
        end

end

Looking at your code... the only time it will end up as chance=49 is when the lastBet.Roll was <3.3 or > 96.7 AND it was a loss...

The "if !win then... else..." block you have means that if it was a win... it sets nextbet = balance /1024 and then chance is set to 97.2549.

So currently, will only work if it is < 3.3... as you're betting "high" to start by default, if the roll is over 96.7 you'll win and the chance won't change.

Try something like this:
Code:
basebet = balance / 1024
nextbet = basebet
chance  = 97.2549

function dobet()
    if (!win) then
        -- loss, martingale
        nextbet = previousbet * 2
    else
        -- win, reset
        bethigh = true
        nextbet = balance / 1024
        chance = 97.2549
    end
    
    if (lastBet.Roll < 3.3) then
        bethigh = true
        chance = 49.1089
    elseif (lastBet.Roll > 96.7) then
        bethigh = false
        chance = 49.1089
    end
    
    print("LastRoll: " .. lastBet.Roll)
    print("Chance: " .. chance)
    print("bethigh: " .. tostring(bethigh))
end

All the "ususal disclaimers" apply... I haven't thoroughly tested this, so run at your own risk Wink

Also, based on your pseudocode, I'd suggest you read this: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process

It gives you an idea of how the "flow" works... you can't run "innerloops" like the while() statement you have. Essentially, after a bet is placed and result received, dobet() is called...

At this point, you can then process the received result and make changes to your bet amount, high/low, chance etc... then when you get to the end of the dobet() function, a bet with the new parameters is sent to the server and the bot waits for the new result.

Again, once the result is received, dobet() runs again... and the process repeats until the script is stopped (manually, by stop() command in script, or an error is received from server).

Basic overview of script lifecycle
Here's a small overview of the lifecycle of the script, how and in which order everything is executed

1) bot starup - loads basic functions (withdraw, invest, tip, stop, runsim etc)
2) start() or runstim() is executed. the script in the code box is executed once. Thus functions are registered, variables are created and assigned.
3) place starting bet: the bot places the starting bet: no script executed
4) bet result returned: 4.1) variables (balance, profit, wins, lossess etc) are updated.
   4.2) dobet() is executed.
   4.3) local variables are updated to new varibable from the bot (chance, nextbet, high)
5) next bet is placed. On bet result, go back to step 4.