Jump to content

While ... WEnd Problem


Recommended Posts

I'm new to auto it scripting and I have problem

I get this error

line 26 (File "..."):

WEnd

Error: "Wend" statement with no matching "While" statement.

this is the script

CODE
sleep(3000)

$s = 1

While $s < 10

if PixelGetColor(90,70) = 0000A1 then

if PixelGetColor(238,70) = D86165 then

sleep(3000)

Send("1")

sleep(3000)

Send("2")

sleep(3000)

Send("3")

sleep(3000)

Send("4")

sleep(3000)

Send("5")

else

sleep(3000)

send("0")

sleep(3000)

else

sleep(3000)

send("p")

$s = $s * 1

WEnd

plz help

Link to comment
Share on other sites

  • Moderators

You are missing 2 EndIf's ... Each "If" statement must be closed with an EndIf.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

if PixelGetColor(90,70) = 0000A1 thenoÝ÷ ÚÈhºW[y«­¢+Ù¥A¥á±Ñ
½±½È äÀ°ÜÀ¤ôÁàÀÀÀÁÄÑ¡
same with the other If-statement.

The other problem is actually not related to the While/WEnd-loop, but instead it's because you're

missing two EndIf to close your If's. So I'm guessing that you want to place those two EndIf's at

the line before where you increase $s. Btw, you might want to check out a For/Next-loop where

you then wont have to manually increase $s.

Link to comment
Share on other sites

ok, I changed script and I get no error, but script doing nothing :/

here is changed one

CODE
sleep(3000)

$s = 1

While $s < 100

If PixelGetColor(90,70) = 10551296 then

If PixelGetColor(238,70) = 6644184 then

sleep(3000)

Send("1")

sleep(3000)

Send("2")

sleep(3000)

Send("3")

sleep(3000)

Send("4")

sleep(3000)

Send("5")

else

sleep(3000)

send("0")

sleep(3000)

EndIf

else

sleep(3000)

send("p")

EndIf

$s = $s + 1

WEnd

Link to comment
Share on other sites

  • Moderators

Your loop is so fast that if it didn't find the color, in less than a second it's done more than likely.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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