w0uter Posted October 31, 2005 Share Posted October 31, 2005 (edited) edit: due to trubbles with the datatypes i used regread instead. edit2: small change so that it didnt continue clicking after we had already won. evryone made one, so did i. but mine is more leet expandcollapse popupOpt("MouseClickDelay",0) Opt("MouseClickDownDelay",0) Global Const $MEM_O = 0x8 Global Const $MEM_R = 0x10 Global Const $MEM_W = 0x20 Func _MemOpen($i_dwDesiredAccess, $i_bInheritHandle, $i_dwProcessId) $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $i_dwDesiredAccess, 'int', $i_bInheritHandle, 'int', $i_dwProcessId) If @error Then SetError(1) Return 0 EndIf Return $ai_Handle[0] EndFunc;==> _MemOpen() Func _MemRead($i_hProcess, $i_lpBaseAddress, $i_nSize, $v_lpNumberOfBytesRead = '') Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']') DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead) Local $v_Return = DllStructGetData ($v_Struct, 1) DllStructDelete ($v_Struct) Return $v_Return EndFunc;==> _MemRead() Func _MemClose($i_hProcess) $av_CloseHandle = DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $i_hProcess) Return $av_CloseHandle[0] EndFunc;==> _MemClose() ProcessSetPriority(@autoitpid, 5) opt('MouseCoordMode', 0) $i_pid = Run('winmine.exe') ProcessWait($i_pid) $v_Open = _MemOpen ($MEM_R, False, $i_pid) ;Width 0x1005334 $i_Width = _MemRead ($v_Open, 0x1005334, 1) $i_Width = RegRead('HKEY_CURRENT_USER\Software\Microsoft\winmine', 'Width') ;Height 0x1005338 $i_Height = _MemRead ($v_Open, 0x1005338, 1) $i_Height = RegRead('HKEY_CURRENT_USER\Software\Microsoft\winmine', 'Height') ;Number 0x1005330 $i_NonMines = $i_Width * $i_Height - _MemRead ($v_Open, 0x1005330, 2) $i_NonMines = $i_Width * $i_Height - RegRead('HKEY_CURRENT_USER\Software\Microsoft\winmine', 'Mines') Global $i_Array = 0 Dim $ai_Loc[$i_NonMines][2] For $y = 0 To $i_Height - 1 For $x = 0 To $i_Width - 1 ;mine 0x1005340 + 32 * y + x If _MemRead ($v_Open, 0x1005340 + 32 * ($y + 1) + ($x + 1), 1) = -113 Then ;~ ConsoleWrite("X ") ContinueLoop Else ;~ ConsoleWrite("O ") $ai_Loc[$i_Array][0] = 23 + $x * 16 $ai_Loc[$i_Array][1] = 112 + $y * 16 $i_Array += 1 EndIf Next ;~ consoleWrite(@LF) Next _MemClose ($v_Open) $v_Open = UBound($ai_Loc) - 1 opt('WinTitleMatchMode', 4) For $i = 0 To $v_Open MouseClick('left', $ai_Loc[$i][0], $ai_Loc[$i][1], 1, 0) if StringInStr(WinGetText('active'), 'OK') Then exitloop Next Edited November 1, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted October 31, 2005 Author Share Posted October 31, 2005 updated see top post. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
markusss Posted November 1, 2005 Share Posted November 1, 2005 w0uter, that thing is uber leet! I keep getting highscores like 3 secs on minesweeper with this! Really, great job! What is missing is a promt that asks if you wanna play again and one that asks on what board (I mean the different sizes) you wanna play! Kepp up your good work! Felix N. Link to comment Share on other sites More sharing options...
mikeytown2 Posted November 1, 2005 Share Posted November 1, 2005 On my box the mouse is too low... i changed this $ai_Loc[$i_Array][1] = 112 + $y * 16 to this $ai_Loc[$i_Array][1] = 100 + $y * 16 and it works only thing is its slower then some of the previous ones out there. old one 10 seconds, this one 18. this is on expert of course Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
w0uter Posted November 1, 2005 Author Share Posted November 1, 2005 (edited) @Felix i can get 2 if the mines are all in the top @mikey what os do you use ? and do you use a different windows skin ? i dont see how this can be slower actually. all it has to do is click ... all calculations are done before. could you post a link to the "previous" one ? Edited November 1, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Koder Posted November 1, 2005 Share Posted November 1, 2005 As an example of using kernel32 to do memory access, this is pretty neat. But as a minesweeper cheat, it's a bit slow. Here's a minesweeper that cheats really fast, 4 seconds on expert , but no memory access. expandcollapse popup#CS Computer Cheats at Minesweeper Works on any size grid (within reason) Computer plays minesweeper extremely fast Inspired by "Freekills Minesweeper Cheats" #CE Opt("MouseClickDelay",0) Opt("MouseClickDownDelay",0) Opt("WinTitleMatchMode", 3) ; Exit via Ctrl-Alt-X HotKeySet("^!x", "MyExit") ; MouseMove speed where applicable dim $speed = 0 dim $title = "Computer Cheats at Minesweeper" dim $win = "Minesweeper" dim $Width, $Height, $wX, $wY, $X, $Y, $X1, $Y1, $X2, $Y2 dim $i, $j, $color, $color1, $color2, $pos, $Cols, $Rows If WinExists($win) = 0 then Run(@SystemDir & "\winmine.exe") Sleep(500) endIf WinActivate($win) Sleep(50) ; Get Minesweeper info $size = WinGetPos($win) $wX = $size[0] $wY = $size[1] $Width = $size[2] $Height = $size[3] ; Start coords of mine grid -relative to window $X1 = 16 $Y1 = 97 ; End coords of mine grid -relative to window $X2 = $Width - 11 $Y2 = $Height - 11 ; size of each box;W=16;H=16 ; Determine Grid size from window size $Cols = int(($X2 - $X1 + 1) / 16) $Rows = int(($Y2 - $Y1 + 1) / 16) if MsgBox(4, $title, "Ready?" & @CR & @CR & "Cols: " & $Cols & @CR & "Rows: " & $Rows & @CR ) <> 6 then exit AutoItSetOption("MouseCoordMode", 0) AutoItSetOption("PixelCoordMode", 1) WinActivate($win) MouseClick("left", $Width / 2, 69, 0); click new game ; Send happy fun code Send("xyzzy{RSHIFT}{ENTER}") ;WinActivate($win) For $i = 1 to $Rows For $j = 1 to $Cols ; Center of each box $X = int($X1 + (($X2 - $X1) / $Cols * $j) - 8) $Y = int($Y1 + (($Y2 - $Y1) / $Rows * $i) - 8) AutoItSetOption("PixelCoordMode", 0) $color1 = PixelGetColor($X - 7, $Y) AutoItSetOption("PixelCoordMode", 1) ; Unclicked/Unknown color If $color1 = 16777215 then ; Waive the mouse around a bit to get the pixel ; Center MouseMove($X, $Y, 0) $color = PixelGetColor(0, 0) ;If NOT $color = 0 Then If $color = 16777215 Then ;tooltip("cheat pixel: " & $color, $wX, $wY - 20) MouseClick("left") ElseIf $color = 0 Then ;continueloop MouseClick("right") Else ;tooltip("cheat pixel: " & $color, $wX, $wY - 20) tooltip("cheat mode seems disabled...", $wX , $wY - 20) Send("xyzzy{RSHIfT}{ENTER}") EndIf EndIf Next;j Next;i Link to comment Share on other sites More sharing options...
Coder_Noob Posted November 1, 2005 Share Posted November 1, 2005 Run(@SystemDir & "\winmine.exe") Only need ''Winmine.exe'', because it auto-maticals runs files from system32 folder Avatar made on Gmod for HL2 by me!Name on Gmod: Oclops Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 @w0uter Everytime I use your one it hits a mine Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
w0uter Posted November 1, 2005 Author Share Posted November 1, 2005 no wonder its slow, add this to the top Opt("MouseClickDelay",0) Opt("MouseClickDownDelay",0) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
YoseMite Posted November 1, 2005 Share Posted November 1, 2005 Very cool Wouter! (Y) Can it also with Patience? Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 no wonder its slow, add this to the topOpt("MouseClickDelay",0) Opt("MouseClickDownDelay",0)It now hits a mine faster Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
w0uter Posted November 1, 2005 Author Share Posted November 1, 2005 (edited) lmao. OS ? what mine ? does it click anything else before blowing up ? Edited November 1, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 (edited) lmao. OS ?what mine ?does it click anything else before blowing up ? It usually hits first mine in the second row.I run XP Pro SP2.I am using Expert mode minesweeper. Edited November 1, 2005 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
YoseMite Posted November 1, 2005 Share Posted November 1, 2005 does it click anything else before blowing up ? Can this not disable? Link to comment Share on other sites More sharing options...
w0uter Posted November 1, 2005 Author Share Posted November 1, 2005 do you move the mouse ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
YoseMite Posted November 1, 2005 Share Posted November 1, 2005 If I move the mouse I'm game over... Can I disable moving the mouse until I have a topscore? Link to comment Share on other sites More sharing options...
BigDod Posted November 1, 2005 Share Posted November 1, 2005 do you move the mouse ?I thought I might have so I just tried it again and made sure I didn't and it still hit a mine. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
w0uter Posted November 1, 2005 Author Share Posted November 1, 2005 uncomment the consolewrite lines and see if it is mapped correctly My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
lopolop Posted November 1, 2005 Share Posted November 1, 2005 (edited) i know play a custom game set the boxes to max height and width then the number of mines to 10, start game and hit the top left corner then if you dont get one sec hit F2 untill you do Edited November 1, 2005 by lopolop Link to comment Share on other sites More sharing options...
w0uter Posted November 2, 2005 Author Share Posted November 2, 2005 its still slower then the other one for some reason. i think clicking takes longer then mousemove & pixelgetcolor My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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