Sign in to follow this  
Followers 0
ecstatic

DO Until Function help

7 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you are sending them seperately, i presume you want them together.

look at send in the helpfile, it shows you how to group items.

edit.

something like:

Send("{ESC}{Up}{Enter}")

Edited by mdiesel

Share this post


Link to post
Share on other sites

you are sending them seperately, i presume you want them together.

look at send in the helpfile, it shows you how to group items.

edit.

something like:

Send("{ESC}{Up}{Enter}")

Wont it just spam it instantly?

Share this post


Link to post
Share on other sites

Still closes script instead of leaving game :D

Share this post


Link to post
Share on other sites

Put ConsoleWrite() or MsgBox() after the Send("{ESC}") call. If you don't see any output or message box then try Opt("GUICloseOnESC", 0) although I don't see any GUICreate call...

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