Sign in to follow this  
Followers 0
n00bscripter

While ... WEnd Problem

9 posts in this topic

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

Share this post


Link to post
Share on other sites



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


[center]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.[/center]

Share this post


Link to post
Share on other sites

Use the EndIf keyword to close the If...Then block.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

so what can I do to slow down it?

Share this post


Link to post
Share on other sites

Put

Sleep(50)
after $s = $s + 1


[center]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.[/center]

Share this post


Link to post
Share on other sites

now it's working, ty for all ur help :P

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