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

Check inputted value #28

Closed 544449 closed 10 years ago

544449 commented 10 years ago

Having an open firefox window and scrolling out of the bet/chance input box, wrong input can happen: (note: lost additional 10btc)


+0.00007002 WIN  (49.5%) = 39.03193870 total. session: +0.80533420
-0.00003501 LOSE (49.5%) = 39.03190369 total. session: +0.80529919
-10.00007002 LOSE (49.5%) = 29.03183367 total. session: -9.19477083
-0.00014004 LOSE (49.5%) = 29.03169363 total. session: -9.19491087
+0.00028008 WIN  (49.5%) = 29.03197371 total. session: -9.19463079

possible (unchecked) solution:


self.driver.find_element_by_id("pct_bet").send_keys("%10.8f" % bet)
                if self.driver.find_element_by_id("pct_bet").get_attribute("value") != ("%10.8f" % bet):
                    raise Exception("bet value not equal")
KgBC commented 10 years ago

what happened? you typed on that window?

544449 commented 10 years ago

Possible that I typed something, I'm not sure. But it can happen if you try to scroll down (below bet/chance input box) when viewing bets/chat.

KgBC commented 10 years ago

OK, I see how I could make this safer. I personally use a linux box which uses a hidden browser, and view the bets on another browser. This would be the best.

544449 commented 10 years ago

Ive checked log and I guess it works:

2013-10-07 22:04:20,921, ERROR: reconnect bet value not equal
KgBC commented 10 years ago

I don't think we should make a reconnect if there is a mismatch, as it slows the whole thing down. Better approach would be check numbers for correctness just before clicking hi/lo, but let me test if this slows down the whole betting signifficantly. This shouldn't be an issue, but I want to check :)

544449 commented 10 years ago

maybe just try to reinput the values few times and if there is still mismatch then try to reconnect

KgBC commented 10 years ago

I should be able to check them just before clicking hi/lo. I just need to get my hands on code for some minutes soon.

KgBC commented 10 years ago

fix on the way, will be in next release. I used your code in junction with a faster reconnect method (just reload the site first, which is enough in most cases). I'm testing and will upload soon.