AlmarM Posted November 9, 2008 Share Posted November 9, 2008 (edited) Hi! This time me and my friend wrote a simple MineSweeper Expert Bot. Just 25 lines of code expandcollapse popupOpt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) HotKeySet("{ESC}", "_Exit") Menu() Func Menu() $x = InputBox("* Mode *", "1 = Beginner" & @CRLF & "2 = Advanced" & @CRLF & "3 = Expert" & @CRLF & "4 = Woah", "", "", 100, 160) If $x = 1 Then Beginner() ElseIf $x = 2 Then Advanced() ElseIf $x = 3 Then Expert() ElseIf $x = 4 Then Woah() Else MsgBox(16, "^ERROR", "Please just typ '1, 2 or 3'.") Exit EndIf EndFunc Func Beginner() Run("winmine.exe") WinWaitActive("Mijnenveger") WinMove("Mijnenveger", "", 229, 187) Sleep(500) Send("!{S}{B}") Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") For $i = 250 To 380 Step 16 For $ii = 300 To 430 Step 16 MouseMove($i, $ii, 0) $var = PixelGetColor(0, 0) If $var = 0xFFFFFF Then MouseClick("LEFT", $i, $ii, 1, 0) ElseIf $var = 0x000000 Then MouseClick("RIGHT", $i, $ii, 1, 0) EndIf Next Next MsgBox(64, "* Won *", "You Won!") EndFunc Func Advanced() Run("winmine.exe") WinWaitActive("Mijnenveger") WinMove("Mijnenveger", "", 326, 248) Sleep(500) Send("!{S}{G}") Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") For $i = 350 To 590 Step 16 For $ii = 360 To 600 Step 16 MouseMove($i, $ii, 0) $var = PixelGetColor(0, 0) If $var = 0xFFFFFF Then MouseClick("LEFT", $i, $ii, 1, 0) ElseIf $var = 0x000000 Then MouseClick("RIGHT", $i, $ii, 1, 0) EndIf Next Next MsgBox(64, "* Won *", "You Won!") EndFunc Func Expert() Run("winmine.exe") WinWaitActive("Mijnenveger") WinMove("Mijnenveger", "", 326, 248) Sleep(500) Send("!{S}{E}") Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") For $i = 350 To 820 Step 16 For $ii = 360 To 600 Step 16 MouseMove($i, $ii, 0) $var = PixelGetColor(0, 0) If $var = 0xFFFFFF Then MouseClick("LEFT", $i, $ii, 1, 0) ElseIf $var = 0x000000 Then MouseClick("RIGHT", $i, $ii, 1, 0) EndIf Next Next MsgBox(64, "* Won *", "You Won!") EndFunc Func Woah() Run("winmine.exe") WinWaitActive("Mijnenveger") WinMove("Mijnenveger", "", 326, 248) Sleep(500) Send("!{S}{P}") Send("{TAB 2}1000{TAB}1000{TAB}1000{ENTER}") Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") For $i = 300 To 826 Step 16 For $ii = 360 To 730 Step 16 MouseMove($i, $ii, 0) $var = PixelGetColor(0, 0) If $var = 0xFFFFFF Then MouseClick("LEFT", $i, $ii, 1, 0) ElseIf $var = 0x000000 Then MouseClick("RIGHT", $i, $ii, 1, 0) EndIf Next Next MsgBox(64, "* Won *", "You Won!") EndFunc Func _Exit() Exit EndFunc Ill update it soon with Easy and Advanced! Hope you enjoy P.S. Just replace 'Mijnenveger' with 'Minesweeper' or other language's! AlmarM Edited November 9, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
AlmarM Posted November 9, 2008 Author Share Posted November 9, 2008 Updated >.< AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
BrettF Posted November 9, 2008 Share Posted November 9, 2008 I'm ammused by the fact that it tells me I won, yet i died on the third click. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
wIck3d Posted November 9, 2008 Share Posted November 9, 2008 Nice work. Didn't work at first though, I had to add a sleep to it. HotKeySet("{ESC}", "_Exit") Run("winmine.exe") WinWaitActive("Minesweeper") Sleep(1000) WinMove("Minesweeper", "", 326, 248) Sleep(1000) Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") For $i = 350 To 820 Step 16 For $ii = 360 To 600 Step 16 MouseMove($i, $ii, 0) sleep(1) $var = PixelGetColor(0, 0) If $var = 0xFFFFFF Then MouseClick("LEFT", $i, $ii, 1, 0) ElseIF $var = 0x000000 Then MouseClick("RIGHT", $i, $ii, 1, 0) EndIf Next Next MsgBox(64, "* Won *", "You Won!") Func _Exit() Exit EndFunc Score: 15 sec Scripts:Mouse coords, cursor ID and color Link to comment Share on other sites More sharing options...
wIck3d Posted November 9, 2008 Share Posted November 9, 2008 I'm ammused by the fact that it tells me I won, yet i died on the third click.try adding a sleep after the MouseMove. Scripts:Mouse coords, cursor ID and color Link to comment Share on other sites More sharing options...
BrettF Posted November 9, 2008 Share Posted November 9, 2008 (edited) That works Score 11seconds, Done. Now 10seconds! Edited November 9, 2008 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
mamut Posted February 10, 2009 Share Posted February 10, 2009 NICE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now