spel565 Posted January 2, 2010 Share Posted January 2, 2010 this is my script. I want it to mousemove if a certain colour is detected at a certain place, but the mousemoves even if the certain colour isnt there.. While @error = 0 $pixel = pixelsearch(27, 751,8, 765,0xFFBE39) WEnd mousemove (536, 471,50) Link to comment Share on other sites More sharing options...
Sobiech Posted January 2, 2010 Share Posted January 2, 2010 (edited) If PixelGetColor($placeX, $placeY) = $color Then MouseMove(536, 471,50) EndIf small tip Insert this to loop Edited January 2, 2010 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
GEOSoft Posted January 2, 2010 Share Posted January 2, 2010 Try this While 1 $pixel = pixelsearch(27, 751,8, 765,0xFFBE39) If NOT @Error Then ExitLoop WEnd mousemove (536, 471,50) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
spel565 Posted January 2, 2010 Author Share Posted January 2, 2010 (edited) If PixelGetColor($placeX, $placeY) = $color Then MouseMove(536, 471,50) EndIf small tip Insert this to loop $colour=0xFFBB39 While 1 If PixelGetColor(29, 754) = $color Then MouseMove(536, 471,50) EndIf WEnd got error message = variable used without being declared Edited January 2, 2010 by spel565 Link to comment Share on other sites More sharing options...
darkjohn20 Posted January 2, 2010 Share Posted January 2, 2010 You spelled color 2 different ways. Link to comment Share on other sites More sharing options...
Sobiech Posted January 3, 2010 Share Posted January 3, 2010 $colour=0xFFBB39 While 1 If PixelGetColor(29, 754) = $color Then MouseMove(536, 471,50) EndIf WEnd got error message = variable used without being declared $color <> $colour xD Anyway i think you just cant insert all code into while loop I think you can $color = 0x2B6F70 While 1 If PixelGetColor(833, 224) = $color Then MsgBox(0, "Color", "I found you!") ExitLoop Else ContinueLoop EndIf WEnd This will be checking 833, 224 so many times until program not detect 0x2BF6F70 When he fount it, then show MsgBox and Exit from Lopp (so close program in this code) You can replace MsgBox with MouseMove This world is crazy Link to comment Share on other sites More sharing options...
spel565 Posted January 3, 2010 Author Share Posted January 3, 2010 $color <> $colour xD Anyway i think you just cant insert all code into while loop I think you can $color = 0x2B6F70 While 1 If PixelGetColor(833, 224) = $color Then MsgBox(0, "Color", "I found you!") ExitLoop Else ContinueLoop EndIf WEnd This will be checking 833, 224 so many times until program not detect 0x2BF6F70 When he fount it, then show MsgBox and Exit from Lopp (so close program in this code) You can replace MsgBox with MouseMove That does work, thank you! btw close topic someone.. 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