JewelBot

From TedTycoon.co.uk

Jump to: navigation, search

JewelBot is an application written for PopCap's Bejeweled Twist where the application sent clicks to the game and played for you. It was written in C# in early 2009. JewelBot ended up being fairly reliable but it still keeps trying to move jewels when the game is doing the last move still and other jewels are falling making it impossible to make another move at that moment. It also randomly did wrong moves which caused it to lose the chain score.

Contents

Getting the game info

Due to the complexity of the memory management of the game I originally wrote JewelBot to capture screenshots of Bejeweled and then determine what colour each jewel was by checking the centre pixel colour of each jewel on the screen. This was fairly reliable but caused problems when jewels were moving or had special effects over them. It also had to be a certain size resolution.

Later on I changed it to read the game's memory, it has to check and go though about 3 pointers until it finds the list of jewels and can get the X and Y positions to recreate the board in JewelBot where it can calculate the best move.

Controlling the game

After calculating the best move JewelBot then sent windows messages to Bejeweled Twist which were mouse down and mouse up with the correct X and Y coordinates to rotate the right jewels.

See Also

External Links

Personal tools