Sign in to follow this  
Followers 0
chaddiablo

Color Get

4 posts in this topic

Im making a script to where when a certain color pops up in area it will perform actions, but i dont know how to get that color from my screen. I need to find out what that color is. And how to, if true do actions.

Here is the part of the script where the color is needed.

While 1
    $c = PixelGetColor(386, 45)
    Case (color here)
    if $c = True Then
            MouseMove(660,360)
            Sleep(500)
            MouseClick("Left"[,660,360])
            Sleep(500)
            Run("Program")
            WinWait("Program")
            Sleep(500)
            MouseMove(100,180)
            Sleep(500)
            MouseClick("Left"[,100,180])
            WinWait("Load...")
            MouseMove(140,145)
            Sleep(500)
            MouseClick("Left"[,140,145])
            Sleep(500)
            MouseMove(520,368)
            Sleep(500)
            MouseClick("Left"[,520,368])
            Sleep(500)
            MouseMove(247,88)
            Sleep(500)
            MouseClick("Left"[,247,88])
            Sleep(500)
            WinWait("INFO")
            MouseMove(640,425)
            Sleep(500)
            MouseClick(640,425)
            Sleep(500)
            MouseMove(1620,1008)
            SLeep(500)
            MouseClick("Left"[,640,425])
        endif
WEnd

Share this post


Link to post
Share on other sites



Oh cool. Thank you.

Ill add in and see id the code is right.

Share this post


Link to post
Share on other sites

don't use the brackets "["

; say 0xffffff is your color

While 1
    $c = PixelGetColor(386, 45)
    If $c = 0xffffff Then
        MouseMove(660, 360)
        Sleep(500)
        MouseClick("Left", 660, 360)
        Sleep(500)
        Run("Program")
        WinWait("Program")
        Sleep(500)
        MouseMove(100, 180)
        Sleep(500)
        MouseClick("Left", 100, 180)
        WinWait("Load...")
        MouseMove(140, 145)
        Sleep(500)
        MouseClick("Left", 140, 145)
        Sleep(500)
        MouseMove(520, 368)
        Sleep(500)
        MouseClick("Left", 520, 368)
        Sleep(500)
        MouseMove(247, 88)
        Sleep(500)
        MouseClick("Left", 247, 88)
        Sleep(500)
        WinWait("INFO")
        MouseMove(640, 425)
        Sleep(500)
        MouseClick(640, 425)
        Sleep(500)
        MouseMove(1620, 1008)
        Sleep(500)
        MouseClick("Left", 640, 425)
    EndIf
Sleep(100) ; don't burn CPU
WEnd

8)


NEWHeader1.png

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