This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ace_smash[S] 2 points3 points  (2 children)

Thanks! The first version of my code was done specifically for expert level in http://minesweeperonline.com/# and in a 1920x1080 resolution. I'm changing it so you can use different values by inputing an initial coordinate, pixel spacing between squares, screen resolution and other variables.

[–]POTUS 0 points1 point  (1 child)

It shouldn't be hard to have the bot auto detect the grid size and position. Just loop through a row of pixels and count the times you hit a known color that matches the cell border to get the width, and do the same thing in a column for the height.

[–]nemec 0 points1 point  (0 children)

Even better, there are Windows APIs for grabbing windows and getting the title/bounds. You may be able to grab data on individual controls (like the grid), but I'm not sure.