Jump to content

Color?


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...