Post
Topic
Board Gambling
Re: Seuntjies DiceBot -Multi-Site, multi-strategy betting bot for dice. With Charts!
by
HCP
on 17/03/2017, 14:43:00 UTC
Also, how does the variable lastBet work? I want to check if the roll result of every bet I make is 11.11 or 22.22 or 33.33... etc. and print the bet id in the console for future reference if it is. How would one code that?
so the values you are looking for in lastBet are "roll" and "id"... as in lastBet.roll and lastBet.id

So, you could do something like:

Code:
luckyNumbers = {11.11, 22.22, 33.33, 44.44}
for x = 1, #luckyNumbers do
  if luckyNumbers[x] == lastBet.roll then
    print("Rolled: [" .. lastBet.roll .. "] with BetID [" .. lastBet.id .. "]")
  end
end

Basically, you are defining an array of the rolls that you want to check for, then iterating over that array and comparing the last roll to each of the values in the array and printing the roll and BetID if it matches one of them Smiley

You might also want to check out the dicebot programmers discussion thread:  https://bitcointalk.org/index.php?topic=1114503.0