XInFisk Posted August 8, 2006 Posted August 8, 2006 Hi. Anyeone there can explain how i make pixelsearch to a hotkey? i mean when i push lets say 6 then it searchs after a color and then push on it 2 times.. Sry my english isn't good.. But i hope someone understands me..
GtaSpider Posted August 8, 2006 Posted August 8, 2006 hi! yeah i understand you^^ HotKeySet("6","_searchcolor") $color = 0xff0000;this is a expample! you must edit it if you want to search at a another color! While 1 Sleep(100) ;;;;;;;;; WEnd Func _searchcolor() $ps = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,$color) MouseClick("left",$ps[0],$ps[1],1,0) EndFunc www.AutoIt.de - Moderator of the German AutoIt Forum
XInFisk Posted August 8, 2006 Author Posted August 8, 2006 (edited) hi! yeah i understand you^^ HotKeySet("6","_searchcolor") $color = 0xff0000;this is a expample! you must edit it if you want to search at a another color! While 1 Sleep(100) ;;;;;;;;; WEnd Func _searchcolor() $ps = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,$color) MouseClick("left",$ps[0],$ps[1],1,0) EndFuncThanks! but it that made for beta? Edit: okay now i have testet it... and it works. but when it cant find the color its jst shutdown.. can i do anything ingore it? if it cant find the color then it just dont do anything? Edited August 8, 2006 by XInFisk
Moderators SmOke_N Posted August 8, 2006 Moderators Posted August 8, 2006 You have to have the while loop, and make sure that the color was found before you click:HotKeySet("6","_searchcolor") $color = 0xff0000;this is a expample! you must edit it if you want to search at a another color! While 1 Sleep(100) ;;;;;;;;; WEnd Func _searchcolor() $ps = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,$color) If IsArray($ps) Then MouseClick("left",$ps[0],$ps[1],1,0) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
XInFisk Posted August 8, 2006 Author Posted August 8, 2006 You have to have the while loop, and make sure that the color was found before you click:HotKeySet("6","_searchcolor") $color = 0xff0000;this is a expample! you must edit it if you want to search at a another color! While 1 Sleep(100) ;;;;;;;;; WEnd Func _searchcolor() $ps = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,$color) If IsArray($ps) Then MouseClick("left",$ps[0],$ps[1],1,0) EndFuncOh thanks.
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