Jump to content

2 Errors EndIf & Unable to parse line


Yoon
 Share

Recommended Posts

Ok.

While 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 by Yoon
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

it worked for the error, got something new... of course :)

While 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

Link to comment
Share on other sites

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 by Yoon
Link to comment
Share on other sites

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

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