n00bscripter Posted January 5, 2007 Share Posted January 5, 2007 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 More sharing options...
Moderators SmOke_N Posted January 5, 2007 Moderators Share Posted January 5, 2007 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 More sharing options...
MHz Posted January 5, 2007 Share Posted January 5, 2007 Use the EndIf keyword to close the If...Then block. Link to comment Share on other sites More sharing options...
Helge Posted January 5, 2007 Share Posted January 5, 2007 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 More sharing options...
n00bscripter Posted January 5, 2007 Author Share Posted January 5, 2007 ok, I changed script and I get no error, but script doing nothing :/ here is changed one CODEsleep(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 More sharing options...
Moderators SmOke_N Posted January 5, 2007 Moderators Share Posted January 5, 2007 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 More sharing options...
n00bscripter Posted January 5, 2007 Author Share Posted January 5, 2007 so what can I do to slow down it? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 5, 2007 Moderators Share Posted January 5, 2007 Put Sleep(50) after $s = $s + 1 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 More sharing options...
n00bscripter Posted January 5, 2007 Author Share Posted January 5, 2007 now it's working, ty for all ur help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now