Yoon Posted February 7, 2008 Posted February 7, 2008 (edited) Ok. expandcollapse popupWhile 1 * If Hex(PixelGetColor(312, 37),6) = "EDF0F3" *Then $coord = PixelSearch( 100, 100, 1280, 950, 0xFF8000, 1, 2);Orange Monsters If Not @error Then * *MouseMove($coord[0],$coord[1],0) * *MouseClick("right",$coord[0],$coord[1]) * *Sleep (50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Send("{Right 4}") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Right 4}") $coord = PixelSearch( 100, 100, 1280, 950, 0xFFFF00, 1, 2);Yellow Monsters If Not @error Then * *MouseMove($coord[0],$coord[1],0) * *MouseClick("right",$coord[0],$coord[1]) * *Sleep (50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("{Right 4}") Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Shift}") Send("{Right 4}") Send("{Strg}") EndIf;<---- This is the one I removed. WEnd Ok so I have this script But I keep receiving the EndIf has no If statement. So I removed the Final EndIf due to the fact it was an extra EndIf With no If Function. So I believe I may of fixed that problem but not 100% sure. Problem is when I Run the code after removing the extra EndIf Statement I receive this error. /whatever.au3 (2) : ==> Unable to parse line.: * If Hex(PixelGetColor(312, 37),6) = "EDF0F3" *Then ^ ERROR Not sure what the issue is. The AU3 will not run due to the error obviously. Any help would be awesome. Thank you. *edit* I also tried using Hex(PixelGetColor(312, 37) dex= "EDF0F3" Same issue. Edited February 7, 2008 by Yoon
picaxe Posted February 7, 2008 Posted February 7, 2008 (edited) Is this too obvious Remove the "*" at the begining of code lines or replace with ";" or comment code blocks with #cs #ce. Edited February 7, 2008 by picaxe
Yoon Posted February 8, 2008 Author Posted February 8, 2008 Can you show me an example? Because I thought the stars were correct. I do not follow.
NELyon Posted February 8, 2008 Posted February 8, 2008 Can you show me an example? Because I thought the stars were correct.I do not follow.I have never seen any Autoit code using an asterisk unless it was using wildcard for a filename. Just erase the asterisks and it should work fine.
Yoon Posted February 8, 2008 Author Posted February 8, 2008 it worked for the error, got something new... of course expandcollapse popupWhile 1 If Hex(PixelGetColor(312, 37),6) = "EDF0F3" *Then $coord = PixelSearch( 100, 100, 1280, 950, 0xFF8000, 1, 2);Orange Monsters If Not @error Then MouseMove($coord[0],$coord[1],0) MouseClick("right",$coord[0],$coord[1]) Sleep (50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Send("{Right 4}") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Right 4}") $coord = PixelSearch( 100, 100, 1280, 950, 0xFFFF00, 1, 2);Yellow Monsters If Not @error Then MouseMove($coord[0],$coord[1],0) MouseClick("right",$coord[0],$coord[1]) Sleep (50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("{Right 4}") Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Shift}") Send("{Right 4}") Send("{Strg}") WEnd \whatever.au3 (63) : ==> "Wend" statement with no matching "While" statement.: WEnd
Richard Robertson Posted February 8, 2008 Posted February 8, 2008 You might try indenting code so you can see where you do and don't have the correct tokens. You are missing an EndIf somewhere.
Yoon Posted February 8, 2008 Author Posted February 8, 2008 (edited) WEnd? Or EndIf.... if its EndIf Might it be right before the WEnd? *Edit* NM that I tried the EndIF where I had it before but removed it. In my 1st code post, returned another error completely. The problem seems to be with the WEnd. Edited February 8, 2008 by Yoon
picaxe Posted February 8, 2008 Posted February 8, 2008 Use "Tools, Tidy AutoIt Source" in Scite to indent your code. I can't test what you are trying to do, maybe something like this expandcollapse popupWhile 1 If Hex(PixelGetColor(312, 37), 6) = "EDF0F3" Then $coord = PixelSearch(100, 100, 1280, 950, 0xFF8000, 1, 2);Orange Monsters If Not @error Then MouseMove($coord[0], $coord[1], 0) MouseClick("right", $coord[0], $coord[1]) Sleep(50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Send("{Right 4}") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Right 4}") $coord = PixelSearch(100, 100, 1280, 950, 0xFFFF00, 1, 2);Yellow Monsters If Not @error Then MouseMove($coord[0], $coord[1], 0) MouseClick("right", $coord[0], $coord[1]) Sleep(50) EndIf Send("{Right 4}") Send("1") Sleep(100) Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("{Space}") Sleep(100) Send("1") Sleep(100) Send("{Right 4}") Send("2") Sleep(100) Send("3") Sleep(100) Send("4") Sleep(100) Send("6") Send("{Space}") Send("{Shift}") Send("{Right 4}") Send("{Strg}") EndIf WEnd
Yoon Posted February 8, 2008 Author Posted February 8, 2008 Worked great and TY VM I just hope I absorb what I learned here
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