Skip to content

akleemans/bejeweled-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bejeweled-bot

Plays an automated game of Bejeweled. Be sure to read the CAUTION section below before using.

1. Dependencies

  • autopy - used for accessing mouse/screen (OS independent. Windows installers available)
  • pygame - optional, used for displaying recognized gems
  • Quartz, pip install pyobjc-framework-Quartz

Please note: the script is optimized for Mac OS X, which means screenshots could be faster on other systems (Windows, Ubuntu) using autopy itself or another library like pyscreenshot.

2. Anchor and game start

The game is automatically detected by its border colour, as long as the border of the game is in the following range:

  • Horizontally: 1/3 of screen width
  • Vertically: 1/2 of screen height

The bot starts playing from the "Play now" screen, so first load that screen, then start the bot with

python bejeweled-bot.py

It will start the game itself from then on. Don't move the game after you started the bot or no gems will be recognized.

3. "Algorithm"

There's only one rule: If a possible move has been found, the program will try to do it. The algorithm is really simple/stupid and not optimized in any way.

Here, it would drag down the matching yellow gem:

Still, it should get somewhat around 300'000 - 600'000 points on average, more if you use Phoenix or another power-up.

4. Demo

CAUTION

Use at your own risk. Be aware that your mouse will not be controllable while the game is running! The program is provided "as is" without warranty of any kind.

Normally the end of the game should be recognized. There are 2 fallbacks if the end of the game is not recognized properly:

  • The bot will stop automatically after 75 seconds (which should be enough in regular mode. You might tweak that when using sepcial gems.)
  • The bot will stop when you scroll down and big parts of the recognized area are white.

About

Plays an automated game of Bejeweled.

Topics

Resources

Stars

Watchers

Forks

Languages