Jump to content

DO Until Function help


Recommended Posts

Hey guys.

Heres my code

Func Pindle()
    $Message = "OK, lets go kill pindle"
    Chat()
    Sleep(2000)
    Send($TeleportKey)
    Sleep(400)
    MouseMove(463, 88)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(732, 156)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(700, 186)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(571, 173)
    MouseDown("right")
    MouseUp("right")
    Sleep(200)
    MouseMove(490, 250)
    MouseDown("right")
    MouseUp("right")
If $Class = "Light Sorc" Then
    Send($ChainLightningKey)
    Sleep(100)
    Do
                CheckDeath()
    $MonsterFind =  PixelSearch( 148, 34, 800, 291, $monsters )
        If Not @error Then
            MouseClick("right", $monsterfind[0], $Monsterfind[1])
        EndIf
    Until @error <> 0
EndIf


If $Class = "Hammerdin" Then
       MouseClick("Right", 709, 173)
       Sleep(100)
       Send($ConcentrationKey)
       Send("{ShiftDown}")
    Do
                CheckDeath()
    $MonsterFind =  PixelSearch( 148, 34, 800, 291, $monsters )
        If Not @error Then
            MouseDown("Left")
            Sleep(2500)
            MouseUp("Left")
        EndIf
    Until @error <> 0
EndIf
    Endgame()
    $PindleKilled = $PindleKilled + 1
    Stats()
EndFunc  ;==>Pindle

Basically

$Message = "OK, lets go kill pindle"
    Chat()
    Sleep(2000)
    Send($TeleportKey)
    Sleep(400)
    MouseMove(463, 88)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(732, 156)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(700, 186)
    MouseDown("right")
    MouseUp("right")
    Sleep(400)
    MouseMove(571, 173)
    MouseDown("right")
    MouseUp("right")
    Sleep(200)
    MouseMove(490, 250)
    MouseDown("right")
    MouseUp("right")

Get to the boss.

I KNOW MESSY!

Then

If $Class = "Light Sorc" Then
    Send($ChainLightningKey)
    Sleep(100)
    Do
                CheckDeath()
    $MonsterFind =  PixelSearch( 148, 34, 800, 291, $monsters )
        If Not @error Then
            MouseClick("right", $monsterfind[0], $Monsterfind[1])
        EndIf
    Until @error <> 0
EndIf


If $Class = "Hammerdin" Then
       MouseClick("Right", 709, 173)
       Sleep(100)
       Send($ConcentrationKey)
       Send("{ShiftDown}")
    Do
                CheckDeath()
    $MonsterFind =  PixelSearch( 148, 34, 800, 291, $monsters )
        If Not @error Then
            MouseDown("Left")
            Sleep(2500)
            MouseUp("Left")
        EndIf
    Until @error <> 0
EndIf

Depending on the person's character, it kills the boss.

Heres why my problem lies

Endgame()


Here is my endgame
Func EndGame()
    Sleep(2000)
    Send("{ESC}")
    Sleep(500)
    Send("{Up}")
    Sleep(500)
    Send("{Enter}")
EndFunc  ;==>EndGame

Now after my bot has killed the monsters, and has teleported up there.

And when it is time to endgame, it kills the script and doesnt perform the ESC + UP + Enter.

Can anyone tell me why >.<

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