Sign in to follow this  
Followers 0
Wimse

Color?

4 posts in this topic

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

Share this post


Link to post
Share on other sites



Welcome to the forums.

Look in the help file for PixelGetColor. That should get you started.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Wimse

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0