Sign in to follow this  
Followers 0
ghostofdeath

Dunno do this...

4 posts in this topic

look i have a code here that i need 2 click once everytime that a color apeer : heres the code

HotKeySet("{esc}","esc")
WinWaitActive("Tibia")
Func esc()
    Exit
EndFunc
While 1
    $1=PixelGetColor(992,416)
    If $1=49152 Then
        MouseClick("left",874,415,1)
    Else
        If $1= 4737096 Then
            Sleep(300)
        EndIf
    EndIf
WEnd

Share this post


Link to post
Share on other sites



lol yes havent u seen the code? MouseClick("left",874,415,1)

the '1' there mean clicks :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

lol yes havent u seen the code? MouseClick("left",874,415,1)

the '1' there mean clicks :)

<{POST_SNAPBACK}>

Won't get very far if you don't try to explain what errors your getting.

Try this:

Opt("PixelCoordMode", 0); assuming your x and y coords are from an active window if not change 0 to 2
Opt("MouseCoordMode", 0); assuming your x and y coords are from an active window if not change 0 to 2

HotKeySet("{esc}","esc")
WinWaitActive("Tibia")
Func esc()
    Exit
EndFunc
While WinExists("Tibia")
    WinWait("Tibia")
    If Not WinActive("Tibia") Then WinActivate("Tibia")
    Sleep(200)
    $var = PixelGetColor(992,416)
    ToolTip("Var Colour == 0x" & Hex($var, 6), 0, 0)
    If $var == 0x49152 Then; is your colour a hex or a dec?  I put 0x assuming that it is a hex.
        MouseClick("left", 874, 415, 1, 1)
    Else
        If $var == 0x4737096 Then
            Sleep(300)
        EndIf
    EndIf
WEnd

Edit: Please let us know what specifically your getting if this doesn't work... Good Luck!

Edited by ronsrules

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