Jump to content
Sign in to follow this  
gainstaa

Pixel getting color

Recommended Posts

gainstaa

while 1 = 1
If PixelGetColor ( 80, 30 ) < 0x0851C6 then
    sleep(1000)
    send("2")
    send("2")
    send("2")
    send("2")
    send("2")
    send("2")
endif
If PixelGetColor ( 105, 15 ) < 0xA50000 then
    sleep(1000)
    send("1")
    send("1")
    send("1")
    send("1")
    send("1")
    send("1")
endif
wend

It doesn't work, if I set it to 0xA50001 or 0x0851C7, then it is just always pressing them, but it isn't working for some reason at the values I want.

It's pretty weird actually because there obviously nothing wrong with the code its just acting strange. Can anyone help (not that I expect it to be fixable).

Edited by gainstaa

Share this post


Link to post
Share on other sites
PsaltyDS

You could at least get some debug info on what the pixel actually is:

While 1
    $iColor = PixelGetColor(80, 30)
    ToolTip("Debug: (80,30) = 0x" & Hex($iColor, 6))
    If $iColor < 0x0851C6 Then
        Sleep(1000)
        Send("2")
        Send("2")
        Send("2")
        Send("2")
        Send("2")
        Send("2")
    EndIf
    $iColor = PixelGetColor(105, 15)
    ToolTip("Debug: (105, 15) = 0x" & Hex($iColor, 6))
    If $iColor < 0xA50000 Then
        Sleep(1000)
        Send("1")
        Send("1")
        Send("1")
        Send("1")
        Send("1")
        Send("1")
    EndIf
WEnd

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×