Jump to content
Sign in to follow this  
Havegooda

Quick Question

Recommended Posts

Havegooda

Hey,

It's been awhile since I've used AutoIt, so I just have a quick question. I'd ask it in IRC, but I couldn't find the server/channel information (I'll go back to searching after I post this).

Anyways, could someone give me the command/"If" statement when: I get a color at x/y position? I know how to get them, I've just forgotten how to use them -.-.

I apologize in advance if this is too stupid of a question.

Thank you!

~Gooda~

Share this post


Link to post
Share on other sites
cppman

Hey,

It's been awhile since I've used AutoIt, so I just have a quick question. I'd ask it in IRC, but I couldn't find the server/channel information (I'll go back to searching after I post this).

Anyways, could someone give me the command/"If" statement when: I get a color at x/y position? I know how to get them, I've just forgotten how to use them -.-.

I apologize in advance if this is too stupid of a question.

Thank you!

~Gooda~

$Color = PixelGetColor(0, 0) ;Get the color at position (0,0)
if ($Color == 0xFFFFFF) Then
    ;The color is white
Else
    ;The color is not white
EndIf

Maybe this will help?

Edited by chris95219

Share this post


Link to post
Share on other sites
Havegooda

This is what I'm working with. Keep in mind that I'm a nub. In theory, this "should" work, right? I'm getting an error that is telling me that it's badly formatted, which I don't doubt. Think you could explain where I've gone wrong?

Func PartyMatch
    If WinActive($Sro_Client)And PixelGetColor(60,709)=5328721)Then
        Send("{e}")
        Sleep(2000)
        MouseClick("LEFT",529,713)
        Sleep(2000)
        MouseClick("LEFT",582,654)
        Sleep(3000)
        MouseClick("LEFT",1015,290)
        Sleep(3000)
    EndIf
EndFunc

Thanks for hanging on with me...

EDIT: Error message below

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\HP_Owner\My Documents\Party Match.au3" 
C:\Documents and Settings\HP_Owner\My Documents\Party Match.au3 (1) : ==> Badly formatted "Func" statement.: 
Func PartyMatch 

>Exit code: 1   Time: 1.456

~Gooda~

Edited by Havegooda

Share this post


Link to post
Share on other sites
cppman

You have to understand the error messages. It is telling you that you didn't declare your function properly.

Func PartyMatch ;you are missing the ()
    If WinActive($Sro_Client)And PixelGetColor(60,709)=5328721)Then ;you are also missing a ( on the left side of the expression
        Send("{e}")
        Sleep(2000)
        MouseClick("LEFT",529,713)
        Sleep(2000)
        MouseClick("LEFT",582,654)
        Sleep(3000)
        MouseClick("LEFT",1015,290)
        Sleep(3000)
    EndIf
EndFuncoÝ÷ Ù*"¶ÈhºW[y«­¢+ÙÕ¹AÉÑå5Ñ  ¤(%¡]¥¹Ñ¥Ù ÀÌØíMɽ}
±¥¹Ð¥¹A¥á±Ñ
½±½È ØÀ°ÜÀä¤ôÔÌÈàÜÈÄ¥Q¡¸(M¹ ÅÕ½ÐííôÅÕ½Ðì¤(M±À ÈÀÀÀ¤(5½ÕÍ
±¥¬ ÅÕ½Ðí1PÅÕ½Ðì°ÔÈä°ÜÄ̤(M±À ÈÀÀÀ¤(5½ÕÍ
±¥¬ ÅÕ½Ðí1PÅÕ½Ðì°ÔàÈ°ØÔФ(M±À ÌÀÀÀ¤(5½ÕÍ
±¥¬ ÅÕ½Ðí1PÅÕ½Ðì°ÄÀÄÔ°ÈäÀ¤(M±À ÌÀÀÀ¤(¹%)¹Õ¹
Edited by chris95219

Share this post


Link to post
Share on other sites
Havegooda

Yearg, damn those teeny things that you can forget so easily with time...

Thanks!

~Gooda~

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  

×