Jump to content

function help


glix
 Share

Recommended Posts

Func gather()
    $color = PixelGetColor(302, 228)
    $keycolor = PixelGetColor(107, 418)
    If $color = 0xFFFBD6 Then
        Send("b")
        Sleep(150)
        Send ("a")
        sleep(1050)
    if $keycolor = 0x311400 then                  ;if 0x311400 is in the designated pixel it still will not move the mouse nor click it
        MouseMove (116, 411)
        Sleep (300)
        MouseDown ("left")
        Sleep (300)
        Mousemove (343, 236)
        Sleep (300)
        MouseUp("left")
        Sleep (300)
        Send ("d")
    else
        Send ("d")
        Sleep (250)
    EndIf
Endif
EndFunc   ;==>gather

Link to comment
Share on other sites

PixelGetColor returns decimal values not hex.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

well the first part of the script works fine and the color is in hex, but after "if $keycolor = 0x311400 then" it does not work but ill switch them with decimals and see what happens

Edited by glix
Link to comment
Share on other sites

i got it

Func gather()
    $color = PixelGetColor(302, 228)
    $keycolor = PixelGetColor(118, 414)
    If $color = 16776150 Then
        Send("b")
        Sleep(150)
        Send ("a")
        sleep(1050)
        elseif $keycolor = 8666145 then
            MouseMove (118, 414)
        Sleep (1000)
        MouseDown ("left")
        Sleep (1000)
        Mousemove (343, 236)
        Sleep (1000)
        MouseUp("left")
        Sleep (1000)
        Send ("d")
        Sleep (250)
    Endif
EndFunc   ;==>gather
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...