rockets Posted October 22, 2009 Share Posted October 22, 2009 here is the script im working on , and i have a question that involves it while 1 $coordinates1 = pix(0xffe1e6) if @error <> 1 Then MouseClick("left", $coordinates1[0], $coordinates1[1],1,0) EndIf HotKeySet("z", "myexit") WEnd func pix($color) $coordinatespie = PixelSearch(413, 233, 1010, 695, $color) Return $coordinatespie EndFunc Func myexit() Exit EndFunc right now im only getting the coordinates of 1 pixel , if i add $coordinates2 = pix(0x8ce1e6) to line 3 then how would i get it to search if either pixel is active and if it is then to click on it , and how would i keep the script open and have it keep trying to see if any of those pixels are there? cause when none of the pixels are found the script automatically exits. any help would be much appreciated , thank you. Link to comment Share on other sites More sharing options...
omikron48 Posted October 22, 2009 Share Posted October 22, 2009 (edited) The script has some wrong in it. HotKeySet("z", "myexit") ;this should be here While 1 pixclick(0xffe1e6) pixclick(0x8ce1e6) ;you can keep adding more colors if you want Sleep(100) ;adjust to however long you want WEnd Func pixclick($color) ;this should lessen code repetition $coordinates = PixelSearch(413, 233, 1010, 695, $color) If @error <> 1 Then MouseClick("left", $coordinates[0], $coordinates[1],1,0) EndIf EndFunc Func myexit() Exit EndFunc Edited October 22, 2009 by omikron48 Link to comment Share on other sites More sharing options...
rockets Posted October 22, 2009 Author Share Posted October 22, 2009 Thank you so much , it works perfectly , and answers all my questions . 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