Jump to content

PixelGetColor?


Recommended Posts

Okay, in the code, as you can see, it searches the pixel before the first click, and then it moves on after it's worked.

But when I try to do it with the second click, it keeps doing that "left" click because obviously the script thinks that $aAttack is always equal to $bAttack when it obviously isn't and Shouldn't be.

Anyone got some suggestion for me?

I've tried just PixelSearch for a 00FF00 color, but that doesn't seem to help either.

Thanks

While 1
    $GoodRod = PixelGetColor(526,416)
        Sleep(500)

        Do
            MouseClick("left",316,227)
            $BattleRod = PixelGetColor(526,416)
            Sleep(100)
        Until $GoodRod <> $BattleRod
        Sleep(2000)
        Send("{SPACE}")

    $bAttack = PixelGetColor(473, 455)

        Do
            $aAttack = PixelSearch(
            MouseClick("left",494,564)
            Sleep(500)
        Until $aAttack <> $bAttack
        Sleep(10000)

WEnd
Link to comment
Share on other sites

Okay, in the code, as you can see, it searches the pixel before the first click, and then it moves on after it's worked.

But when I try to do it with the second click, it keeps doing that "left" click because obviously the script thinks that $aAttack is always equal to $bAttack when it obviously isn't and Shouldn't be.

Anyone got some suggestion for me?

I've tried just PixelSearch for a 00FF00 color, but that doesn't seem to help either.

Thanks

While 1
    $GoodRod = PixelGetColor(526,416)
        Sleep(500)

        Do
            MouseClick("left",316,227)
            $BattleRod = PixelGetColor(526,416)
            Sleep(100)
        Until $GoodRod <> $BattleRod
        Sleep(2000)
        Send("{SPACE}")

    $bAttack = PixelGetColor(473, 455)

        Do
            $aAttack = PixelSearch(
            MouseClick("left",494,564)
            Sleep(500)
        Until $aAttack <> $bAttack
        Sleep(10000)

WEnd
I'm guessing you are trying to automate some game. First you click somewhere untill the color of $goodrod changes, then you press "space" and try something else.

The part Send("{SPACE}") looks ok, but after that it makes no sense.

1. "$aAttack = PixelSearch(" gives a syntax error.

2. $bAttack is a decimal value of pixel's color, while $aAttack is a two-element array of pixel's coordinates. The two are always going to be different, so even if the script would run, MouseClick("left",494,564) would only be executed once.

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...