Code to Scan and Detect images for CandyCrushSaga

My attempt at writing screen recognition software. It actually worked pretty well, I didn’t have enough time to optimize the logic but the scanfunc itself worked like a charm and was able to map graphics to its internal memory to then calculate the next best move. I’ll probably break this code out again one day to make an Aimbot when I’m board but this was one of my more interesting projects.

The general idea of this code is in WritePixelColorCode function, I would place my mouse over a given pixel and it would Debug.Output the value of that pixel and the neighboring pixels in a 3×3 grid. I then hard code those values into my app then scan every pixel of the screen looking for that pattern, It should be unique to that specific GEM in this case for CandyCrushSaga, Once that is detected I note where it it on the grid in its internal memory. Once mapped its up to the logic to determine which move is best by bruteforcing each possibility then calculating the largest value out of all the moves. Code below no longer works due to an outdated agent in the WebBrowser object, but using Chromium in dotnet will most likely get the code to fly again if you get board.

Leave a comment

Your email address will not be published. Required fields are marked *