gainstaa Posted September 5, 2007 Share Posted September 5, 2007 (edited) Well thisi what I have so far$Command = 0 Hotkeyset ( "O", "exit1") while 1 = 1 PixelSearch ( 60, 60, 1220, 500, < 0x151515 then Command() wend func Command() mouseclick ("left") sleep(100) endfunc func exit1() Exit (0) endfuncWhat I want it to do is search the screen for anything darker than ( 0x151515 ) Then move mouse to the pixel and click when I press H ( dont know how to do this)and theres an error on the pixel search line dont know what it is thoughPress O to close Edited September 5, 2007 by gainstaa Link to comment Share on other sites More sharing options...
Demonic Posted September 5, 2007 Share Posted September 5, 2007 (edited) HotKeySet("0", "Exit") HotKeySet("H", "Search") While(1) WinActive("NAME OF WINDOW SEARCHED ON") WEnd Func Search() $coord = PixelSearch( 60, 60, 1220, 500, < 0x151515) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) EndFunc Func Exit() End EndFunc More something like that, not so sure of the <0x151515 though. Edited September 5, 2007 by Arakard Link to comment Share on other sites More sharing options...
gainstaa Posted September 5, 2007 Author Share Posted September 5, 2007 (edited) I just tried what you said but it says badly formatted func statement for the Exit func. Which makes no sense since it is correct Edited September 5, 2007 by gainstaa Link to comment Share on other sites More sharing options...
gainstaa Posted September 5, 2007 Author Share Posted September 5, 2007 HotKeySet("0", "Exit") HotKeySet("H", "Search") While(1) WinActive("NAME OF WINDOW SEARCHED ON") WEnd Func Search() $coord = PixelSearch( 60, 60, 1220, 500, < 0x151515) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) EndFunc Func Exit() End EndFunc More something like that, not so sure of the <0x151515 though. I just tested this again and for some reason nothing works the hotkeys do nothing. Link to comment Share on other sites More sharing options...
gainstaa Posted September 5, 2007 Author Share Posted September 5, 2007 (edited) HotKeySet( "p", "exit1") HotKeySet( "h", "Search") While(1) WinActive("untitled - Paint") WEnd Func Search() $coord = PixelSearch( 300, 60, 980, 500, 0x000000) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) endif EndFunc Func exit1() Exit (0) EndFunc ok now that whole thing works now I just want to change the colour to > 0x151515 because the below doesnt work HotKeySet( "p", "exit1") HotKeySet( "h", "Search") While(1) WinActive("untitled - Paint") WEnd Func Search() $coord = PixelSearch( 300, 60, 980, 500, > 0x151515) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) endif EndFunc Func exit1() Exit (0) EndFunc Edited September 5, 2007 by gainstaa Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 5, 2007 Share Posted September 5, 2007 ok now that whole thing works now I just want to change the colour to > 0x151515 because the below doesnt work Func Search() $coord = PixelSearch( 300, 60, 980, 500, > 0x151515) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) endif EndFunc What is it you expect the ">" operator to do in that context? That's just plain invalid syntax. The color field is a 24bit RGB unsigned integer. No comparison operator is valid there. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
gainstaa Posted September 5, 2007 Author Share Posted September 5, 2007 (edited) OK i finally figured it out. Now what I want is for it to do this when I click instead of press H I've tried mouse down but it dont work.Before I just wanted it to find anything darker than 0x111111 and now it does.HotKeySet( "p", "exit1") HotKeySet( "h", "Search") While(1) WinActive("untitled - Paint") WEnd Func Search() $color = 0x111111 $coord = PixelSearch( 590, 350, 690, 450, $color ,5) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) endif EndFunc Func exit1() Exit (0) EndFunc Edited September 5, 2007 by gainstaa Link to comment Share on other sites More sharing options...
ofLight Posted September 5, 2007 Share Posted September 5, 2007 (edited) OK i finally figured it out. Now what I want is for it to do this when I click instead of press H I've tried mouse down but it dont work. Before I just wanted it to find anything darker than 0x111111 and now it does. $color = 0x111111 $coord = PixelSearch( 590, 350, 690, 450, $color ,5) My understanding is that this is not actually looking for anything "Darker" than $color, But is infact looking for any pixel within 5 Shades of $color. This includes Lighter or darker. #Include <Misc.au3> HotKeySet( "p", "exit1") ;HotKeySet( "h", "Search") While(1) If _IsPressed("01") Then Search() WinActive("untitled - Paint") WEnd Func Search() $color = 0x111111 $coord = PixelSearch( 590, 350, 690, 450, $color ,5) If not @error then MouseClick("left", $coord[0], $coord[1], 2, 0) endif EndFunc Func exit1() Exit (0) EndFunc Edited September 5, 2007 by ofLight There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly 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