Web Game Bot Coded With Python

We find the programming challenge of game-playing bots to be fascinating. Take a look at this Python bot which plays Burrito Bison all the way through (video after the break). This is a totally pedantic exercise which has no purpose, other than to hone your mastery of a certain programming problem. And to that we say Bravo!

We looked in on a similar project which used some C# code to dominate the game Bejeweled Blitz. We’re not fantastic at C# and that code was never made public. But [Audionatics] has released this code through Github, and it’s written in Python which is a language in which we’re well versed.

The script monitors pixel locations to use as an input, which [Audionautics] admits is very error-prone. But if everything is setup just right it works like a charm. He’s also using the PyWin package which we believe is what lets the script move the cursor and register button clicks. We think this is really fun, but it make us wonder about the black-hat possibilities. What are the chances this could be turned into a gambling bot? Scary thought, huh?


[via Reddit]

15 thoughts on “Web Game Bot Coded With Python

  1. Gambling bots, helpers etc. already exist. Just because you can use a bot to play doesn’t give you an edge on the probability as it is controlled by the server. However, If you can login with multiple accounts to the same poker table for example, it could improve your odds.

    1. Unsurprisingly, poker sites are not stupid and already search for suspicious things like that.

      Coding something that can play in some online poker site or standalone poker program is very time consuming but easy(not just “relatively easy”, plain easy), the problem is coding something that will actually make money. You need to take into account losing streaks(due to the randomness of the cards), entry fees per game, the skill of the other players(unless you use a LOT of accounts, you wont make money in the pennies tables), … it’s not easy at all from a mathematical point of view.

      1. This guy seems to understand programming fairly well, but apparently is less well versed in poker and the AI tech that would involve playing it. Online poker isn’t 007’s Casino Royale, you’re not playing your opponent nearly as much as you are playing the odds based on your hand and the cards shown.

      2. Actually, if you program it to play tournament mode you can place fairly regularly. In large player pools you barely look at the other person at all, because you swap so frequently. You are better off playing extremely defensive, and only staying in a hand if you are in the top three possible hands.

        Just waiting will be enough to place, as the blinds rarely keep up with people’s impatience. And in this instance lower denomination entries would be better, as people are less likely to play defensively.

      3. I understand than playing online poker is no “casino royale”, but coding an IA to do it is harder than it seems. You can play by the odds all the time, but what odds? where do you set the threshold of when to check/fold/raise? select a threshold too high and you the amount of money you win wont cover your loses in the other X games where you did not satisfy that condition. Set a threshold too low and you will lose more hands than you win, leaving you with no gain(or overall loses). And you cant really really fix it on the fly because a winning-losing streak would pollute your predictions.

        It’s easy to do a simple bot that can win in no money or pennies-dollar tables, but above that your bot wont be the only one in the table playing the odds so things get harder.

        You could do a simple bot that self adjusted it’s weights based on success/failure, but that would take months to be profitable while losing money during all that time.

  2. If you guys are interested in a pixel, bitmap or DTM detection based bots I recommend checking out SCAR / Simba at http://villavu.com for many years programmers of SCAR have been solving the Anti-bot “random events” that occur in the game RuneScape. It has been a struggle creating solutions for all of the measures the game company designs to stop these bots.

    1. There are some bots that simply hook into the bytecode and directly look at the in-memory objects and fire off events like mouse movement and keyboard presses directly to the game. This gives the ability to run dozens of bots from a single computer. Runescape being in Java apparently makes this job so much easier.

      Last I heard RSBuddy had a system that automatically went through a new RS update’s bytecode, found all of the needed hook points (and bot traps), compiles a new bot client taking these into account, and pushes the update to the users.

      I may be misremembering though, it was a while back when I messed around with it.

  3. For the life of me I am trying to recreate this bot with proper versions of python, all modules included and I got the bot running. However I cannot seem to get it to recognize the game properly. It just keeps searching. Any thoughts?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.