Wimse Posted July 21, 2010 Posted July 21, 2010 Hi! Just started with AutoIt today and, it feels like a great program^^ Now to my question: Can I make the script see if a particular spot of the program is a certain color, and if so how? I tried this for funs sake but it didn't work xD Func Bra() MouseMove (288,389) if (288,389) = 0x534F29 Then MouseMove (288,389) MouseClick("Left") Else MouseMove (288,389) EndIf EndFunc
stampy Posted July 21, 2010 Posted July 21, 2010 Welcome to the forums. Look in the help file for PixelGetColor. That should get you started.
Wimse Posted July 21, 2010 Author Posted July 21, 2010 (edited) Ah, nice this should work right? Dim $evil1 = (PixelGetColor(288,389)), $evil2 = (PixelGetColor(280,458)), $evil3 = (PixelGetColor(288,530)) Dim $good1 = (PixelGetcolor(399,392)), $good2 = (PixelGetcolor(408,460)), $good3 = (PixelGetcolor(398,530)) edit: no ( ) around pixelgetcolor :) Call ("Dåliga") Func Dåliga() if $evil1 = 0x534F29 Then MouseMove (288,389) MouseClick("Left") Call ("Dåliga") Else if $evil2 = 0x5B532C MouseMove (280, 458) MouseClick("Left") Call ("Dåliga") Else if $evil3 = 0x222018 MouseMove (288,530) MouseClick("Dåliga") Else Call ("Bra") EndIf EndFunc Edited July 21, 2010 by Wimse
Moderators SmOke_N Posted July 22, 2010 Moderators Posted July 22, 2010 No, function and variables must consist of word characters: Characters: A to Z a to z _ 0-9 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.
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