Sign in to follow this  
Followers 0
Vindicator209

Wend with no matching While statement?

4 posts in this topic

Sorry, the title was a bit misleading... I have a while statement but it wount reconize it and comes back as if i never put it in.. heres my script:

HotKeySet("^!x", "MyExit")
If WinExists( "AdventureQuest RPG") Then
WinActivate ( "AdventureQuest RPG")
Else
    MsgBox( 48, "Error", "ERROR Function cannot run, Adventure Quest MUST be up")
    Exit
    EndIf
If (PixelGetColor(908,226) = 3355443)Then
    WinActivate ( "AdventureQuest RPG")
    Else
    MsgBox( 48, "Error", "ERROR: Function cannot run, please set your screen resolution to 1024x768 and AQ to 800x600")
    Exit
EndIf
$times=InputBox("Times", "How Many Times To Repeat?")
Global $attack=0

[color=#FF0000]While $attack < $times[/color]
;Sleep If Screen Is Loading
If (PixelGetColor(688, 585) = 3355443)Then
    Sleep(3000)
    EndIf
    MouseMove( 688, 585,1)
If (PixelGetColor(689, 584) = 12939541)Then
    If WinExists("untitled") Then
        WinClose("untitled")
        MouseClick("left",659, 62)
    Sleep(500)  
        MouseClick("left",517, 335)
    Sleep(500)
        MouseClick("left",771, 560)
    Sleep(500)
        MouseClick("left",496, 171)
    Sleep(500)
    EndIf
    MouseClick("left",337, 552)
    Sleep(500)
    MouseClick("left",404, 5321)
    Sleep(1000)
    MouseClick("left",689, 584)
    Sleep(1500)
    If (PixelGetColor(688, 585) = 3355443)Then
        Sleep(8000)
        If (PixelGetColor(534,391) = 10878976)Then
    MouseClick("left")
Else
If (PixelGetColor(534,391) = 10878976)Then
    MouseClick("left")
EndIf
If (PixelGetColor(325,637) = 1513239)Then
        MouseMove( 688, 585,1)
    MouseClick("left" ,688, 585,1,1)
    Sleep(1000)
            MouseMove( 595, 440,1)
    MouseClick("left" ,595, 440,1,1)
    Run("notepad.EXE")
Else
    Sleep(3000)
EndIf
[color=#FF0000]WEnd[/color]
Func MyExit()
    Exit 
EndFunc

any suggestions? please and thankyou!


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites



maybe

HotKeySet("^!x", "MyExit")
If WinExists( "AdventureQuest RPG") Then
    WinActivate("AdventureQuest RPG")
Else
    MsgBox(48, "Error", "ERROR Function cannot run, Adventure Quest MUST be up")
    Exit
EndIf

If (PixelGetColor(908, 226) = 3355443) Then
    WinActivate("AdventureQuest RPG")
Else
    MsgBox(48, "Error", "ERROR: Function cannot run, please set your screen resolution to 1024x768 and AQ to 800x600")
    Exit
EndIf

$times = InputBox("Times", "How Many Times To Repeat?")
Global $attack = 0

While $attack < $times
    ;Sleep If Screen Is Loading
    If (PixelGetColor(688, 585) = 3355443) Then Sleep(3000)
    
    MouseMove(688, 585, 1)
    If (PixelGetColor(689, 584) = 12939541) Then
        If WinExists("untitled") Then
            WinClose("untitled")
            MouseClick("left", 659, 62)
            Sleep(500)
            MouseClick("left", 517, 335)
            Sleep(500)
            MouseClick("left", 771, 560)
            Sleep(500)
            MouseClick("left", 496, 171)
            Sleep(500)
        EndIf
        MouseClick("left", 337, 552)
        Sleep(500)
        MouseClick("left", 404, 5321)
        Sleep(1000)
        MouseClick("left", 689, 584)
        Sleep(1500)
        If (PixelGetColor(688, 585) = 3355443) Then Sleep(8000)
        If (PixelGetColor(534, 391) = 10878976) Then MouseClick("left")
    Else
        If (PixelGetColor(534, 391) = 10878976) Then MouseClick("left")
    EndIf
    
    If (PixelGetColor(325, 637) = 1513239) Then
        MouseMove(688, 585, 1)
        MouseClick("left", 688, 585, 1, 1)
        Sleep(1000)
        MouseMove(595, 440, 1)
        MouseClick("left", 595, 440, 1, 1)
        Run("notepad.EXE")
    Else
        Sleep(3000)
    EndIf
WEnd

Func MyExit()
    Exit
EndFunc   ;==>MyExit

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

oook... i dont really know what happend but i know it works ^^ hehe thanks!


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

Study your original code and you will find out that you were actually missing

an EndIf and not a WEnd. The error-message also says this :whistle:

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