jpres Posted May 2, 2009 Posted May 2, 2009 (edited) Now I realize this script will look terrible, but just bare with me plz I'm new to this, and basicall what I want the script to do is search for a pixel color. Check if it found the pixel color, and if it did, move the mouse to it. Here's what i'm using. Opt("SendKeyDownDelay", 1) HotKeySet("{F8}", "Jiz") Global $v = 2 Global $check = 1 Global $coord = 0 While 1 Sleep(1) WEnd Func Jiz() If $v=2 Then For $i = 1 to 9999999999999999999999999 $coord = PixelSearch(0,0,1024,768,5210767) $check = PixelGetColor($coord[0],$coord[1],0) If $check = 5210767 Then MouseMove($coord[0],$coord[1], 0) EndIf Next Else EndIf EndFunc Here's the error I get. Line 14 (File"C:\Users\Dell XPS...."); $check = PixelGetColor($coord[0],$coord[1],0) $check = PixelGetColor($coord^ ERROR Error: Subscript used with non-array variable Edited May 2, 2009 by jpres
Uriziel01 Posted May 2, 2009 Posted May 2, 2009 Hi there Ok. Use do until 1=2 instead of !! For $i = 1 to 9999999999999999999999999 next And next: Func Jiz() If $v=2 Then do $coord = PixelSearch(0,0,1024,768,5210767) if not @error then $check = PixelGetColor($coord[0],$coord[1],0) If $check = 5210767 Then MouseMove($coord[0],$coord[1], 0) EndIf until 1=2 Else EndIf EndFunc
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