StripedTie Posted February 14, 2007 Share Posted February 14, 2007 Func Color() While 1 PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon color If Not @error Then MouseClick("Left",$coord[0],$coord[1]) SLeep(10) MouseClick("Left",$coord[0],$coord[1]) Sleep(500) ExitLoop Else PixelSearch(420, 240, 600, 360, 0x3F3557, 15, 5); looks for purplish blue If Not @error Then MouseClick("Left",$coord[0],$coord[1]) SLeep(10) MouseClick("Left",$coord[0],$coord[1]) Sleep(500) ExitLoop Else Send("{a down}") Sleep(30) Send("{a up}") EndIf EndIf Wend EndFunc Thats a function in a script im working on. I just started messing around with them a week or two ago, and am not completely sure what I should do. I tested it yesterday, and if I remember correctly, the message said the error was when it tried double clicking. Can I not have it click the $coord? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 14, 2007 Moderators Share Posted February 14, 2007 You have to define $coord Instead of:PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon color You need:$coord = PixelSearch(420, 240, 600, 360, 0x6A3238, 15, 5); looks for maroon colorAnd the same for the other PixelSearch() 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. 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