Jump to content

Script Error


Recommended Posts

While 1 = 1

Sleep(5000)

$coor = PixelSearch(6, 62, 1128, 803, 0x16777215, 2, 2)

While @error = 0

While 1 = 1

$i = 0

While $i <5

Sleep(2000)

send("{a}")

$I = $I + 1

Wend

End

$coor = PixelSearch(6, 62, , 1128, 803, 0x16777215, 2, 2)

Wend

Getting this error.

Line 14

End

End^ERROR

Error: Missing seperator character after keyword.

If i remove it I get line 17

Wend

Error: "While" Statement has no matching "wend" Statement how do i fix this.

Link to comment
Share on other sites

you have 4 while loops so u need 4 wend statements, u only had 2 :P . i believe what you meant to write was this:

While 1 = 1

    Sleep(5000)

    $coor = PixelSearch(6, 62, 1128, 803, 0x16777215, 2, 2) ;I get a syntax error here but it runs fine
    While @error = 0
        While 1 = 1
            $i = 0
            While $i < 5
                Sleep(2000)
                Send("{a}")
                $i = $i + 1
            WEnd
        WEnd   ;You wrote 'End' here

        $coor = PixelSearch(6, 62,, 1128, 803, 0x16777215, 2, 2)
    WEnd
WEnd  ;I added this

it helps if you organize your script like above. Press CTRL+T in Scite to organize your script

"The quieter you are, the more you are able to hear..."

My AppsUSB Finder

Link to comment
Share on other sites

Ok that fixed it sorry havent used auto in years What I am trying to do is get it so teh program locates a color that pops up and begins to run a script then if teh color goes away it stops and serches for the color again until it pops up again then it runs the script again am I headed the right way ?

Link to comment
Share on other sites

If I had to guess, it would look like this:

While 1
    Sleep(5000)
    PixelSearch(6, 62, 1128, 803, 16777215, 2, 2)
    If @error Then ContinueLoop
    For $x = 0 To 4
        Sleep(2000)
        Send("{a}")
    Next
Wend
Link to comment
Share on other sites

If I had to guess, it would look like this:

While 1
    Sleep(5000)
    PixelSearch(6, 62, 1128, 803, 16777215, 2, 2)
    If @error Then ContinueLoop
    For $x = 0 To 4
        Sleep(2000)
        Send("{a}")
    Next
Wend

I will add that in and see if it fixs my problem

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