Qousio Posted May 10, 2009 Share Posted May 10, 2009 (edited) Yours works, except i want it to stop @ each down, then do the next down. After all downs down it moves across a right then does the downs again, etc. Tee hee this is fun $Downs = 5 $Rights = 2 $Pos = MouseGetPos() $Collumns = 0 While $Collumns <= $Rights/2 For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]+$i*10 ) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Pos = MouseGetPos() For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]-$i*10 ) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Rights -= 1 $Pos = MouseGetPos() Wend Edited May 10, 2009 by Qousio Link to comment Share on other sites More sharing options...
FinalVersion Posted May 10, 2009 Author Share Posted May 10, 2009 (edited) Tee hee this is fun $Downs = 5 $Rights = 2 $Pos = MouseGetPos() $Collumns = 0 While $Collumns <= $Rights/2 For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]+$i*10 ) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Pos = MouseGetPos() For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]-$i*10 ) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Rights -= 1 $Pos = MouseGetPos() Wend Thanks You! Edit: Doesn't stop at each down Edited May 10, 2009 by Godly [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Qousio Posted May 10, 2009 Share Posted May 10, 2009 (edited) Thanks You! Edit: Doesn't stop at each down I'm guessing it just works very fast. Try adding sleep(100) between the loops. Because it works perfectly for me =P $Downs = 5 $Rights = 2 $Pos = MouseGetPos() $Collumns = 0 While $Collumns <= $Rights/2 For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]+$i*10 ) Sleep(100) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Pos = MouseGetPos() For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]-$i*10 ) Sleep(100) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Rights -= 1 $Pos = MouseGetPos() Wend Edited May 10, 2009 by Qousio Link to comment Share on other sites More sharing options...
FinalVersion Posted May 10, 2009 Author Share Posted May 10, 2009 I'm guessing it just works very fast. Try adding sleep(100) between the loops. Because it works perfectly for me =P Here is my current bot, I just want the user able to define how many columns & how many boxes per column. expandcollapse popupGlobal $Mine = False Opt("MouseCoordMode", 2) ;$Hight = InputBox("Height", "How many squares high?") ;$Width = InputBox("Width", "How many squares long?") Setup() All() Func Setup() Run("winmine.exe") WinWaitActive("Minesweeper") Sleep(100) Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") Sleep(100) EndFunc ;==>Setup Func DoRow() $i = 0 Do $Pos = MouseGetPos() MouseMove($Pos[0], $Pos[1] + 16, 1) $var = PixelGetColor(0, 0) If $var = 0 Then Sleep(10) Else MouseClick("Left") EndIf $i = $i + 1 Until $i = 9 EndFunc ;==>DoRow Func All() MouseMove(20, 45, 0) DoRow() MouseMove(35, 45, 1) DoRow() MouseMove(50, 45, 1) DoRow() MouseMove(70, 45, 1) DoRow() MouseMove(85, 45, 1) DoRow() MouseMove(100, 45, 1) DoRow() MouseMove(115, 45, 1) DoRow() MouseMove(130, 45, 0) DoRow() MouseMove(147, 45, 0) DoRow() EndFunc ;==>All [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Qousio Posted May 10, 2009 Share Posted May 10, 2009 Here is my current bot, I just want the user able to define how many columns & how many boxes per column. expandcollapse popupGlobal $Mine = False Opt("MouseCoordMode", 2) ;$Hight = InputBox("Height", "How many squares high?") ;$Width = InputBox("Width", "How many squares long?") Setup() All() Func Setup() Run("winmine.exe") WinWaitActive("Minesweeper") Sleep(100) Send("xyzzy") Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") Sleep(100) EndFunc ;==>Setup Func DoRow() $i = 0 Do $Pos = MouseGetPos() MouseMove($Pos[0], $Pos[1] + 16, 1) $var = PixelGetColor(0, 0) If $var = 0 Then Sleep(10) Else MouseClick("Left") EndIf $i = $i + 1 Until $i = 9 EndFunc ;==>DoRow Func All() MouseMove(20, 45, 0) DoRow() MouseMove(35, 45, 1) DoRow() MouseMove(50, 45, 1) DoRow() MouseMove(70, 45, 1) DoRow() MouseMove(85, 45, 1) DoRow() MouseMove(100, 45, 1) DoRow() MouseMove(115, 45, 1) DoRow() MouseMove(130, 45, 0) DoRow() MouseMove(147, 45, 0) DoRow() EndFunc ;==>All o_O ? $Collumn = InputBox( "", "" ) $Boxes = InputBox( "", "" ) ;Testing if it works MsgBox( 0, "", $Collumn ) MsgBox( 0, "", $Boxes ) Link to comment Share on other sites More sharing options...
FinalVersion Posted May 10, 2009 Author Share Posted May 10, 2009 o_O ? $Collumn = InputBox( "", "" ) $Boxes = InputBox( "", "" ) ;Testing if it works MsgBox( 0, "", $Collumn ) MsgBox( 0, "", $Boxes )I know what an input box is, just need the code to move the mouse down however many boxes then across a column then down however many then across etc. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Qousio Posted May 10, 2009 Share Posted May 10, 2009 I know what an input box is, just need the code to move the mouse down however many boxes then across a column then down however many then across etc.The code that I have posted above does exactly what you want... Just change $Downs$Rightsas needed. Perhaps, I don't understand what exactly you are trying to do...This is what the above code does: Link to comment Share on other sites More sharing options...
FinalVersion Posted May 10, 2009 Author Share Posted May 10, 2009 The code that I have posted above does exactly what you want... Just change $Downs$Rightsas needed. Perhaps, I don't understand what exactly you are trying to do...This is what the above code does: I know thats good, but i put like 4 rights it does like 7 rights lol. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Qousio Posted May 10, 2009 Share Posted May 10, 2009 I know thats good, but i put like 4 rights it does like 7 rights lol. This works for any amount of even $Rights. Such as 2,4,6,8,10,12,14,16...etc $Downs = 5 $Rights = 2 $Pos = MouseGetPos() $Collumns = 0 MoveMe($Rights/2) Func MoveMe($I_am_hungry) Do For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]+$i*10 ) Sleep(100) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Pos = MouseGetPos() For $i=0 to $Downs MouseMove( $Pos[0], $Pos[1]-$i*10 ) Sleep(100) Next $Pos = MouseGetPos() MouseMove( $Pos[0]+15, $Pos[1] ) $Rights -= 1 $Pos = MouseGetPos() $I_am_hungry -= 1 Until $I_am_hungry = 0 EndFunc Link to comment Share on other sites More sharing options...
BrettF Posted May 10, 2009 Share Posted May 10, 2009 $max_x = 5 $max_y = 5 $original_pos = MouseGetPos() For $x = 1 to $max_x $J = MouseGetPos () MouseMove ($J[0] + 17, 45) For $y = 1 to $max_y $b = MouseGetPos () MouseMove ($b[0], $b[1] + 10) Sleep (100) Next Next Cheers, Brett 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...
FinalVersion Posted May 10, 2009 Author Share Posted May 10, 2009 $max_x = 5 $max_y = 5 $original_pos = MouseGetPos() For $x = 1 to $max_x $J = MouseGetPos () MouseMove ($J[0] + 17, 45) For $y = 1 to $max_y $b = MouseGetPos () MouseMove ($b[0], $b[1] + 10) Sleep (100) Next Next Cheers, Brett Thank You! [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] 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