KgBC / just-dice-bot

Hi, this is a flexible betting bot for just-dice.com. Feel free to use it under GPL. If you want to donate some Beer/Satoshis: 1CDjWb7zupTfQihc6sMeDvPmUHkfeMhC83 Thanks. The ACES branch is considered stable, use this if you don't want to develop and do not need latest features: https://github.com/KgBC/just-dice-bot/tree/aces
GNU General Public License v2.0
18 stars 6 forks source link

get_rounded_bet Exception float division by zero #21

Closed geekium closed 10 years ago

geekium commented 10 years ago
Exception float division by zero, retrying...
Traceback (most recent call last):
  File "just-dice-bot.py", line 176, in __init__
    bet = self.get_rounded_bet(bet, chance)
  File "just-dice-bot.py", line 438, in get_rounded_bet
    rounded_bet = round( bet /bet_base)*bet_base
ZeroDivisionError: float division by zero
Traceback (most recent call last):
  File "just-dice-bot.py", line 524, in <module>
    JustDiceBet()
  File "just-dice-bot.py", line 268, in __init__
    print traceback.format_exc()
KeyboardInterrupt

2013-08-04_110856

the new bot(revision 21) can run a few bets(less than 10) and throw the error above.

##my config.py that produce that:
jdb_config = {
    "visible"    : 1,                   #1 = show selenium browser automation (slower, but you see what happens, dont use in productive)
    "user"       : "",          #your user and password on just-dice
    "pass"       : "",
    "min_bet"    : 0.0001,      #minimum bet 2 satoshi
    "lose_rounds": 11,               #do 8 rounds
    "multiplier" : [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 'lose10'],  
    "chance"     : [49.5, 45, 40, 33, 30,],   #first round with 49,5% chance, 2nd to 8th round with 90% chance
    "safe_perc"  : 10.0,
    "auto-tip"   : 1,
}
geekium commented 10 years ago

Another error produced, it seems the chances list feature produce these errors.

Exception float division by zero, retrying... Traceback (most recent call last): File "just-dice-bot.py", line 524, in JustDiceBet() File "just-dice-bot.py", line 267, in init print "Exception %s, retrying..." % (e,) KeyboardInterrupt

KgBC commented 10 years ago

Thanks for reporting, will look into it before uploading next version. I'm afk for 2-3 hours, expect a release after that.

KgBC commented 10 years ago

Think this happened because I was expecting a float for chance, but I'm a bit unsure without the exact numbers. could you run the new revision with an additional parameter in config?

"debug_issue_21": 1,

if it isn't solved and happens again please copy the part of bets.log regarding the issue. These lines start with 'datetime, INFO: issue21'. I leave this open until I get your feedback.

KgBC commented 10 years ago

I just got the same error, so it's unsolved. Debugging now.