Sign in to follow this  
Followers 0
ciraco

Adding Pause/Terminate hotkeys?

3 posts in this topic

Hello, I have tried a few different things to add a "Pause" and "Terminate" hotkey to my script, none of which have worked.

I was wondering if anyone could suggest a way to do it that might work without giving errors?

Here is my code:

Do
    Bot()
Until True = False
Func Bot()
    While 1
        Sleep(2000); script start delay
       ; healing
        MouseClick("left", 415, 104, 2); view city
        Sleep(1000)
        MouseClick("left", 434, 351, 2); tavern
        Sleep(1000)
        MouseClick("left", 415, 191, 2); rest
        Sleep(1500)
       ; select monster levels
        MouseClick("left", 71, 410, 2); battle
        Sleep(1000)
        MouseClick("left", 696, 201, 2); monster
        Sleep(1000)
        MouseClick("left", 640, 156, 1); dropdown
        Sleep(1000)
        Send("{DOWN DOWN}")
        Sleep(10)
        Send("{Enter}")
        Sleep(100)
        MouseClick("left", 510, 180, 2); hunt
        Sleep(1500)
        For $Attacks = 1 To 10
           ; atack monsters (1-3)
            MouseClick("left", 422, 191, 2); attack (one)
            Sleep(1000)
            MouseClick("left", 422, 224, 2); attack (two)
            Sleep(1000)
            MouseClick("left", 422, 255, 2); attack (three)
            Sleep(1500)
           ; kill (14 atacks)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1500)
           ; hunt more
            MouseClick("left", 538, 275, 2); no item
            Sleep(1000)
            MouseClick("left", 538, 312, 2); 1 item
            Sleep(1000)
            MouseClick("left", 538, 338, 2); 2 items
            Sleep(1000)
            MouseClick("left", 538, 370, 2); 3 items
            Sleep(2000)
        Next
        Sleep(9000)
    WEnd
    Return 1
EndFunc

Thanks!

Share this post


Link to post
Share on other sites



This seemed to work for me:

HotKeySet("{END}", "_End")

Func _End()
    MsgBox(0, "Gone", "Dude, I'm gone.")
    Exit
EndFunc

Do
    Bot()
Until True = False

Func Bot()
    While 1
        Sleep(2000); script start delay
       ; healing
        MouseClick("left", 415, 104, 2); view city
        Sleep(1000)
        MouseClick("left", 434, 351, 2); tavern
        Sleep(1000)
        MouseClick("left", 415, 191, 2); rest
        Sleep(1500)
       ; select monster levels
        MouseClick("left", 71, 410, 2); battle
        Sleep(1000)
        MouseClick("left", 696, 201, 2); monster
        Sleep(1000)
        MouseClick("left", 640, 156, 1); dropdown
        Sleep(1000)
        Send("{DOWN DOWN}")
        Sleep(10)
        Send("{Enter}")
        Sleep(100)
        MouseClick("left", 510, 180, 2); hunt
        Sleep(1500)
        For $Attacks = 1 To 10
           ; atack monsters (1-3)
            MouseClick("left", 422, 191, 2); attack (one)
            Sleep(1000)
            MouseClick("left", 422, 224, 2); attack (two)
            Sleep(1000)
            MouseClick("left", 422, 255, 2); attack (three)
            Sleep(1500)
           ; kill (14 atacks)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1000)
            MouseClick("left", 594, 175, 2)
            Sleep(1500)
           ; hunt more
            MouseClick("left", 538, 275, 2); no item
            Sleep(1000)
            MouseClick("left", 538, 312, 2); 1 item
            Sleep(1000)
            MouseClick("left", 538, 338, 2); 2 items
            Sleep(1000)
            MouseClick("left", 538, 370, 2); 3 items
            Sleep(2000)
        Next
        Sleep(9000)
    WEnd
    Return 1
EndFunc

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

check the help file there is a pause func there.

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