asan Posted January 12, 2009 Share Posted January 12, 2009 Ok just remember im a total newb and after trying and trying finally came up with something that is almost there. It seems to be working right it just doesnt seem to be clicking the pixel as soon as it finds it, I need it to click as soon as it finds it and also do I really need a msg box every time it finds it. I'd love to take that out. Someone please help me tweak this HotKeySet('{esc}', '_Exit') While 1 Global $iColor = 0xE4EBFF $coord = PixelSearch( 11, 78, 539, 779, $iColor ) If Not @error Then MouseClick("left", $coord[0], $coord[1]) sleep(500) MouseClick("left", $coord[0], $coord[1]) MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf WEnd Func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
jaberwacky Posted January 12, 2009 Share Posted January 12, 2009 (edited) Ok just remember im a total newb and after trying and trying finally came up with something that is almost there. It seems to be working right it just doesnt seem to be clicking the pixel as soon as it finds it, I need it to click as soon as it finds it and also do I really need a msg box every time it finds it. I'd love to take that out. Someone please help me tweak this HotKeySet('{esc}', '_Exit') While 1 Global $iColor = 0xE4EBFF $coord = PixelSearch( 11, 78, 539, 779, $iColor ) If Not @error Then MouseClick("left", $coord[0], $coord[1]) sleep(500) MouseClick("left", $coord[0], $coord[1]) MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf WEnd Func _exit() Exit EndFunc How about this? HotKeySet("{esc}", "_Exit") Global $iColor = 0xE4EBFF While 1 sleep(100) $coord = PixelSearch( 11, 78, 539, 779, $iColor ) If Not @error Then MouseClick("left", $coord[0], $coord[1],2,0) ConsoleWrite("X and Y are:" & $coord[0] & "," & $coord[1]) EndIf WEnd Func _exit() Exit EndFunc edit: code edit edit: 2nd code edit edit: used" [autoit][/autoit] instead of: [code] Edited January 12, 2009 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Spiff59 Posted January 12, 2009 Share Posted January 12, 2009 (edited) I guess he doesn't like mouse-clicking to close a MsgBox every time he gets a hit, and ConsoleWrite certainly might be what he would prefer. I don't know how he needs his output presented, or intends to use it, but he might also consider tooltip as an option. You could easily place the tooltip at the location of the found pixel as well. Edited January 12, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
asan Posted January 12, 2009 Author Share Posted January 12, 2009 How about this? HotKeySet("{esc}", "_Exit") Global $iColor = 0xE4EBFF While 1 sleep(100) $coord = PixelSearch( 11, 78, 539, 779, $iColor ) If Not @error Then MouseClick("left", $coord[0], $coord[1],2,0) ConsoleWrite("X and Y are:" & $coord[0] & "," & $coord[1]) EndIf WEnd Func _exit() Exit EndFunc edit: code edit edit: 2nd code edit edit: used" [autoit][/autoit] instead of: [code] Thank you works perfect now Link to comment Share on other sites More sharing options...
jaberwacky Posted January 12, 2009 Share Posted January 12, 2009 No probs. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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