Building a Bot

I have been surveying a bunch of iPhone apps recently. There goes my monthly data charges. Previously I had heard about this game Bejeweled. But I never tried it out until now. The thing is very fun. I have the version called Bejeweled Blitz. Recently I read a tutorial on how to build a bot to win at Bejeweled. Winning means scoring a whole lot of points I guess.

The first decision to make in building the bot is choice of language. Personally I would use C or C++. However the example bot I saw was built with AutoIt. This is a language from Microsoft for creating macros for automation. I think the syntax of AutoIt is kind of like Visual BASIC.

Once you have chosen a language, you need to be able to read Bejewled icons on the screen. Before that you got to figure out the coordinates of the upper right hand corner of the window. Then you must determine the spacing of the icons in the Bejeweled window. The smart breakthrough was to figure out the location on an icon you can test to determine its color.

So far we have been dealing with the easy stuff. Next you need to come up with some Artificial Intelligence to choose the best icons to swap in order to maximize Bejeweled profits. Personally I think you should first swap icons near the top of the screen to ensure the bottom opporunities do not get shifted. However if the bot is considering all possibilities, it should look for longer combos and perhaps double combos.

Bejeweled is so fun that I might just have to try writing a bot to play it for me. The easiest way to do this would probably be to get a version of Bejeweled running on my PC where I have better control of the environment.