Pages:
Author

Topic: Seuntjie' Dice bot programmers mode discussion. - page 2. (Read 125420 times)

HCP
legendary
Activity: 2086
Merit: 4361
bro-every roll

Resetting Seed!
Betting 0.0000004 at 48% chance to win, high
Resetting Seed!
Betting 0.0000001 at 48% chance to win, low
Resetting Seed!
What is the nonce value being shown in the bet history? Huh The screenshot you showed had an incrementing nonce value... if it is always zero (which according to Seuntjie it will be for 999Dice), then this code will attempt to reset the seed (and do nothing anyway) on every single roll.


Just FYI, 999dice uses a new server and client seed combination for every (normal) bet, the nonce will always be 0 for 999dice in DiceBot.
Similarly, calling resetseed on 999dice has no effect, since it's reset for every bet anyway. (to the effect that no request is actually sent to the site when you call resetseed)
and how then to control whether the reset worked or not?
Sounds like you don't need to... as it is reset on every single bet.

If you want to see the values being used so you can make sure that it is actually changing then add these print() calls at the beginning of dobet():
Code:
...
function dobet()
  print("client: " .. lastBet.clientseed)
  print("server: " .. lastBet.serverseed)
 
  -- all your other code goes here
 
end

You should see the client/server seeds output to the console for every roll and that the client and server seeds are changing every single time.

Additionally, you could probably store the values in a temporary variable and then check to make sure that the values are different from the previous roll and call stop() if they are not. But it sounds like your plan to use the same seed for 70 rolls and then change it will not work with 999Dice Undecided





I'm sorry to derail this topic just a little bit, but can anyone recommend a reputable casino that works well with Seuntjie's Dice bot?
Now that YOLOdice is closed, I'm looking for an alternative that works at a similar rate with small amounts (I prefer altcoins) so I can continue running my scripts. Any recommendation is welcome.
I've not had any issues with Crypto.Games... although, I'm not sure what "a similar rate with small amounts" would be... They support these coins:


and have an inbuilt exchange system (with "OKish" rates) between currencies if required.
legendary
Activity: 1526
Merit: 1359
I'm sorry to derail this topic just a little bit, but can anyone recommend a reputable casino that works well with Seuntjie's Dice bot?
Now that YOLOdice is closed, I'm looking for an alternative that works at a similar rate with small amounts (I prefer altcoins) so I can continue running my scripts. Any recommendation is welcome.
legendary
Activity: 1717
Merit: 1125
Just FYI, 999dice uses a new server and client seed combination for every (normal) bet, the nonce will always be 0 for 999dice in DiceBot.
Similarly, calling resetseed on 999dice has no effect, since it's reset for every bet anyway. (to the effect that no request is actually sent to the site when you call resetseed)
HCP
legendary
Activity: 2086
Merit: 4361
Code:
chance     =
multiplier =
base       = 0.00000010
seedreset = false
function dobet()
if win then
nextbet=base
bethigh = !bethigh
else
nextbet=previousbet*multiplier
end
 if seedreset then
    if lastBet.nonce > 1 then
      -- nonce not reset
      stop()
    else
      -- nonce reset, continue
      seedreset = false
    end
  end
  if (lastBet.nonce % 70) == 0 then
    resetseed()
    seedreset = true
  end
end
Don't forget to put your chance and multiplier value in!
hero member
Activity: 1456
Merit: 940
🇺🇦 Glory to Ukraine!
received

LUA ERROR!!
assignment statement expected, got 'not'


Have you removed all lines starting with # like HCP said? These are comments that are not really needed in the script.
HCP
legendary
Activity: 2086
Merit: 4361
primary expression expected, got '#'
LOL... sorry, I am an idiot Roll Eyes  Embarrassed Embarrassed I have been programming in Python a lot lately... and Python uses "#" for comments... LUA (which Dicebot uses), uses "--" for comments! Roll Eyes Roll Eyes

So, replace: #nonce not reset
with: --nonce not reset

and replace: #nonce reset, continue
with: --nonce reset, continue


Or just delete both lines with #... they're not actually required.
HCP
legendary
Activity: 2086
Merit: 4361
ahhhh ok, yeah... the "nonce"

you should be able to check lastBet.nonce value and make sure that it has reset, otherwise you can stop:
Code:
...
seedreset = false
...
function dobet()

  ...
  if seedreset then
    if lastBet.nonce > 1 then
      #nonce not reset
      stop()
    else
      #nonce reset, continue
      seedreset = false
    end
  end

  ...
 
  if (lastBet.nonce % 70) == 0 then
    resetseed()
    seedreset = true
  end

  ...

end

Note:
- code assumes the "nonce" is reset to 1 (and not 0) as per the screenshot
- you won't know if the "nonce" has reset properly until the next bet is made and the nonce value is returned from the server... again, this will likely only work with sites that use a nonce... for instance, on crypto.games, the nonce always returns as -1.
HCP
legendary
Activity: 2086
Merit: 4361
I don't know what you mean by "family"? Huh
HCP
legendary
Activity: 2086
Merit: 4361
Oh right... so you just want a simple counter then? Huh

You code looks "OKish"... Something like that should work.
Code:
...
basebet = xyz
basechance = abc
nextbet = basebet
chance = basechance
...
bets = 0

function dobet()
 
  bets += 1
 
  if (win) then
    ..
  else
    ..
  end

  if bets%70 == 0 then
    resetseed()
    nextbet = basebet
    chance = basechance
    bethigh = true
    bets = 0
  end
end

Something like that should run whatever you like for 70 bets, then reset to the basebet and basechance and bethigh etc... then it will repeat for another 70 bets with a new seed etc.

Also, it is important to note that not all sites allow the use of the resetseed() function. I have not used 999Dice, so I've no idea if the resetseed() function actually works with that site. If it doesn't, then there is nothing the dicebot can do about it.
HCP
legendary
Activity: 2086
Merit: 4361
there is a counter for counting seeds?, which resets the counter to 0 after resetting the seed(). how to adjust the functions. Huh
I don't understand the question? Huh

The seed doesn't usually change unless you use resetseed() function... at which point a "random" seed is chosen. Are you talking about some of the sites that use a "nonce" once you have set a seed? Huh Which site are you playing on? Huh
HCP
legendary
Activity: 2086
Merit: 4361
As a warning to other users... this code is NOT extensively tested, USE AT YOUR OWN RISK

I have more question marks over my head after your answer than before lol

I want a script that does the following:

basebet = 1
Chance = always variable

if you win = nextbet = basebet (chance variable)
if you lose = increase your stake, you end with the variable chance with plus

sorry for my bad english


As per the PM I sent you... here is the example script...
Code:
chance  = 49.5 --sets your chance for placing a bet
basebet = 10
nextbet = basebet --sets your first bet.
bethigh = true --bet high when true, bet low when false

math.randomseed(os.time())
totalloss = 0

function dobet()
   
    chance = math.random(1,9705) / 100
    payout = (100 - site.edge) / chance

    if (!win) then
        totalloss += previousbet
        nextbet = totalloss / (payout - 1)
        while nextbet < basebet do
            chance = math.random(1,9705) / 100
            payout  = (100 - site.edge) / chance
            nextbet = totalloss / (payout - 1)
        end
    else
        nextbet   = basebet
        totalloss = 0
    end
   
end

NOTES:
- the basebet is set for PLAY token at Crypto.Games... it will need to be adjusted to the site you use
- the "chance = math.random()" lines will need the values adjusted for the site you want to use... Crypto.Games has a min of 0.01% and max of 97.05% for chance... so that is what this script is calculating for... again, you will need to adjust it for the site you want to use the script on.
newbie
Activity: 5
Merit: 0
good day


I have more question marks over my head after your answer than before lol


I want a script that does the following:


basebet = 1
Chance = always variable

if you win = nextbet = basebet (chance variable)
if you lose = increase your stake, you end with the variable chance with plus

sorry for my bad english
HCP
legendary
Activity: 2086
Merit: 4361
Calculating a required bet amount to recover a specific loss is not too difficult...and if you're randomly selecting the chance, this complicates things slightly, but it should still be doable... For starters, you'd need to know the "house edge", so you can calculate the payout from the given "chance". I believe that the dicebot has an inbuilt "house edge" variable... site.edge

For example, when logged into Crypto.games, it shows as:
Code:
print(site.edge)
0.8

The formula for calculating payout from chance is:
Code:
Payout = (100 - edge) / chance

So, if we randomly generate a chance --> 40

Payout = (100 - 0.8 ) / 40
Payout = 2.48

So far, so good... but that's the easy stuff! Tongue Calculating the required bet to recover our total losses is a bit "complicated":

Profit required = (Bet * Payout) - Bet

Which reduces down to:
Code:
Bet Required = Profit Required / (Payout - 1)

If our basebet was 10 PLAY... and we'd lost... our profit would be -10 PLAY... so with a payout of 2.48 we'd need to bet:

Bet Reqd = 10 / (2.48 - 1)
Bet = 10 / 1.48
Bet = 6.76



Or, if after several losses, our profit was at -100 PLAY... and the "random" chance picked for our next bet was 87... the calculations would be:

Payout = (100 - 0.8 ) / 87
=> 1.14

Bet Reqd = 100 / (1.14 - 1)
=> 100 / 0.14
=> 714.29


If you can't work out the actual code required to implement these two formulas, let me know and I'll try and whip up a demo script.
newbie
Activity: 5
Merit: 0
Moin moin dear people,

I thought I would try to present my problem here.

I would like to build a script in the Dicebot and would like to tell the bot that if it e.g. He lost 2 times with the next move to calculate which bet he would have to make if there was a chance that random would be generated.

so example:

Basebet: 1

If you win: continue with the basebet
in case of loss: (should he calculate how much he would have to bet on the next move (random chance) to get the loss back in)

after he has recovered the loss he should start over

It would be nice if you could help me with this I thank you in advance

sorry for my bad english
copper member
Activity: 86
Merit: 57
Blockchain Enthusiast & AI Enthusiast
(For 999dice) Run Bot, You Sleep. Stable program and low balance (minimum 1000 Doge)

Code:
resetseed()
resetstats()

chance        = math.random(15, 49)
basebet       = 0.00001 -- this recomendeed for low balance. If dogecoin more than 10k Doge, set basebet up to 0.0001 Doge
nextbet       = basebet
varmaxbet     = 2 -- set max bet 10 Doge for low balance. If dogecoin more than 10k, set maxbet up to 100 Doge
vartarget     = 10000 -- edit your target total profit
varstoploss   = 5000 -- edit your stop loss
varmaxrollwin = 2
varrollwin    = 1
multwin       = 1
multlose      = 1.4
varbetlose    = math.random(0, 1)

function dobet()
    chance  = math.random(15, 49)
    varbetlose    = math.random(0, 1)
    if (varbetlose == 0) then
        bethigh = true
    else
        bethigh = false
    end
    if (balance >= vartarget) then
        stop();
        print("target success")
    end
    if (balance <= varstoploss) then
        stop();
        print("stoploss")
    end
    if (win) then
        if (varrollwin >= varmaxrollwin) then
            nextbet = basebet
            varrollwin = 1
        else
            varrollwin = varrollwin + 1
            nextbet = nextbet * multwin
        end
    else
        if (nextbet >= varmaxbet) then
            nextbet = basebet
            varrollwin = 1
        else
            nextbet = nextbet * multlose
        end
    end
end
legendary
Activity: 1717
Merit: 1125
but how can i make bot stop after it had currentstreak = -10
or 10 losses and it has to win back to original balance then stop?
Saw your other post on the other bot thread...
how do we stop bot if it struck a losing streak of 10, ie, currentstreak = -10 and we need to stop it only when it wins [more losing steps may follow after hitting -10] above the original balance when it was positive?

my sample didn't work:
if currentstreak <= -10 and win then
stop()
alarm()
print("stopping after bad streak")
end

You will never have currentstreak < 0 and win == true at the same time... as soon as a win is recorded, if currentstreak was < 0, then currentstreak is set to 1... likewise, currentstreak will never be > 0 and win == false, because as soon as a loss is recorded, if currentstreak was > 0, then currentstreak is set to -1.

You will need to create your own "flag" variable... set that to true when currentstreak >= -10... then when you get a "win", check the flag and stop as required.

Something like this:
Code:
...
badstreak = false
...
function dobet()
...
  if win then
    if badstreak then
      stop()
      alarm()
      print("stopping after bad streak")
    end
    badstreak = false
    ...
  end
  ...
  if currentstreak <= -10 then
    badstreak = true
  end if
end

Another way you can do this (that is a bit simpler imo) is to manually tack your previous streak, for example:


Code:
...
previousstreak= 0
...
function dobet()
...
  if win then
    if previousstreak <= -10  then
      stop()
      alarm()
      print("stopping after bad streak")
    end    
    ...
  end
  ...
  previousstreak=currentstreak --make sure this is always at the end of dobet
end
HCP
legendary
Activity: 2086
Merit: 4361
but how can i make bot stop after it had currentstreak = -10
or 10 losses and it has to win back to original balance then stop?
Saw your other post on the other bot thread...
how do we stop bot if it struck a losing streak of 10, ie, currentstreak = -10 and we need to stop it only when it wins [more losing steps may follow after hitting -10] above the original balance when it was positive?

my sample didn't work:
if currentstreak <= -10 and win then
stop()
alarm()
print("stopping after bad streak")
end

You will never have currentstreak < 0 and win == true at the same time... as soon as a win is recorded, if currentstreak was < 0, then currentstreak is set to 1... likewise, currentstreak will never be > 0 and win == false, because as soon as a loss is recorded, if currentstreak was > 0, then currentstreak is set to -1.

You will need to create your own "flag" variable... set that to true when currentstreak >= -10... then when you get a "win", check the flag and stop as required.

Something like this:
Code:
...
badstreak = false
...
function dobet()
...
  if win then
    if badstreak then
      stop()
      alarm()
      print("stopping after bad streak")
    end
    badstreak = false
    ...
  end
  ...
  if currentstreak <= -10 then
    badstreak = true
  end if
end
newbie
Activity: 102
Merit: 0
i used this code in javascript:
if ((maxBet >= (balance / 100) * 3) && (data.gameResult === 'win') && (balance >= sbalance)) {
            //stop();
            $('#notification').html('Relax & Reload');
            alert('Relax & Reload')
            log('Relax & Reload')
            return;
          }
which stopped the bot, if it wagered more than 3% of balance in a bet and was winning after that, so it stopped!

but how can i make bot stop after it had currentstreak = -10
or 10 losses and it has to win back to original balance then stop?

any ideas?
newbie
Activity: 5
Merit: 0
Yes, you can do that... you'd just need to create a data structure that would store the results for you... I've done something similar before that stores values... simply use LUA "Tables" to store/lookup the results... https://www.tutorialspoint.com/lua/lua_tables.htm

Note that the downside is that depending on the size of the tables you're creating/updating, it can require significant "time" and "storage" penalties to do this and there is the potential to slow down your bot. Usually it's not a huge performance hit, but some people want/need 100's of bets/second type performance from the bot.

If that isn't that important to you... then what you want to do shouldn't be too difficult.

Thanks sir!
HCP
legendary
Activity: 2086
Merit: 4361
Yes, you can do that... you'd just need to create a data structure that would store the results for you... I've done something similar before that stores values... simply use LUA "Tables" to store/lookup the results... https://www.tutorialspoint.com/lua/lua_tables.htm

Note that the downside is that depending on the size of the tables you're creating/updating, it can require significant "time" and "storage" penalties to do this and there is the potential to slow down your bot. Usually it's not a huge performance hit, but some people want/need 100's of bets/second type performance from the bot.

If that isn't that important to you... then what you want to do shouldn't be too difficult.
Pages:
Jump to: