Automatic Minesweeper
#1
Posted 09 August 2006 - 02:03 PM
a little script that plays minesweeper all by itself.
autosweeper.ahk
i wrote this quite a while ago, shortly after i found autohotkey, so please forgive the obvious clumsiness in some places. i didn't really know how everything worked back then, and i didn't put more than an evening or two into it either.
it was a little difficult to determine where the mine area begins, because of all the different windows styles and font sizes and i'm not sure it will work with every theme, but i tested it under windows 2k default and windows xp classic and xp themes. also, since it uses the colors of the numbers to determine what they are, it might not work with every color depth. i tested with 16 and 32 bit and it seemed to work. the "program name" field is included for all the non-english-version windows users who might need to change the name.
since it is sometimes impossible to determine the position of mines, there is an option to have to script guess. especially once the chance of a mine goes above 20% (like on expert) this becomes quite frequent.
well, anyway, i hope you like it. it sure improved all my best times. 8)
#2
Posted 09 August 2006 - 02:34 PM
#3
Posted 09 August 2006 - 03:21 PM
#4
winmine
Posted 09 August 2006 - 06:12 PM
#5
Posted 09 August 2006 - 06:35 PM
#6
Posted 09 August 2006 - 07:56 PM
Nineteen hundred lines of code :shock: :shock: :shock:
I did not dare to read the code as it would trigger a migraine aura. :wink:
It works for me.. and is amazing! Less than 3 seconds in Win 2000 default.
Nice work!
Regards,
#7
Posted 11 August 2006 - 12:34 PM
...but if you did look at it, you would see, that parts are redundant, because i was too lazy to write some additional clauses and put them in iterations.Nineteen hundred lines of code :shock: :shock: :shock:
I did not dare to read the code as it would trigger a migraine aura. :wink:
#8
MatCauthon
Posted 12 August 2006 - 03:59 AM
But doh.
#9
Posted 15 August 2006 - 11:22 AM
it's fun watching
Ciao
Micha
#10
Posted 16 August 2006 - 12:34 PM
#11
Posted 16 August 2006 - 07:08 PM
It beat expert in 77 seconds.
#12
Kevin
Posted 16 August 2006 - 07:28 PM
Nice work!
#13
ALMusic
Posted 18 September 2006 - 05:49 PM
Just wanted to thank the author for writing autosweeper. I used it for one of my productions online here:
http://alskjdflaksjfd.ytmnd.com/
I apologize for the URL
Btw this was made using a modified version of the autosweeper script which simply takes a screenshot every time a mouseclick is registered.
thanks
AL
#14
Posted 18 September 2006 - 06:05 PM
At Profi-Level it was busted at the last mine (after 66 seconds)
So, know it finished after 65 seconds
I think I'll try it also on my faster Tower (e6600 CPU)
I have written a little script that changes point-calculation (patching it in memory), but you would have to play by yourself *g*Now we got to do Automatic Solitare 8)
Thalon
#15
Posted 22 May 2010 - 05:19 AM




