Jump to content

Would like assistance in pausing button pushes to push another button, then resuming.


Recommended Posts

I'm trying to make a bot for a game to auto level sword rank. I have the pixel search for finding the mob and clicking it to attack and I have it set to push buttons 1-3 to use skills with the appropriate cool downs. My problem is, I need an HP buff or else I die cus I'm a squishy mage. So, I am trying to figure out how to make it push 1, 2, 3, 1, 2, 3, then after 225 seconds (the cool down for my buff) push 4, then resume the other ones. I tried doing just 1, 2, 3, 4, but it was so much slower because the buff takes 3 seconds to cast. So I'm sitting there for 3 seconds getting hit instead of using a skill to lvl my skill rank. It may not seem like much but it adds up. I'm kinda new with this autoit thing but I enjoy trying to figure out how to make scripts for games. Sorry if this has been asked before and ty for a response :)

Link to comment
Share on other sites

I asked a friend on Xfire and he put some stuff on it. The top portion is the auto potter, then the next part is for finding the monster pixel and left clicking it. Then I have the 1, 2, 3, and there spell cool downs. I'm trying to figure out how to add a hotkey to exit the script now and the delay and pause to push 4 for my HP buff. My script is also more then likely broken as i havn't run it since my friend tried helping me with the pixel searchings. And yes, i tried the help for autoit and i got kinda confused T_T

CabalBot.au3

Link to comment
Share on other sites

To exit with a key use hotkeyset (see below). Not sure what you mean with the delay and 4. Can't you just do another send and sleep?

HotKeySet('{ESC}','EXITMyScript')

While 1
    WinActivate("CABAL")
    $SearchResult = PixelSearch(116, 59, 148, 68, 0x1A1A1A, 10, 1)
    If Not @error Then
        Send("{-}")
    EndIf
    $coord = PixelSearch( 100, 100, 1024, 718, 0X908D31, 10, 2)
    If Not @error Then
        MouseClick("left",$coord[0],$coord[1])
        Sleep (200)
    EndIf
    Send("1")
    Sleep(1500)
    Send("2")
    Sleep(1600)
    Send("3")
    Sleep(1600)
    Send("{Space}")
    Send("{Space}")
Wend

Func EXITMyScript()
    Exit
EndFunc
Link to comment
Share on other sites

I would but then my I would stand there gettin hit for around 3 seconds. I was hoping i could find a way to pause the whole script after 225 seconds, push 4, delay 3 seconds, then resume the 1, 2, 3, part of the script. Also, ty for the hotkey part ^^

Link to comment
Share on other sites

I would but then my I would stand there gettin hit for around 3 seconds. I was hoping i could find a way to pause the whole script after 225 seconds, push 4, delay 3 seconds, then resume the 1, 2, 3, part of the script. Also, ty for the hotkey part ^^

As I don't know the game, I'm flying blind. But to pause the script you can just send a sleep, push the 4 then sleep. Again not sure what your after.

HotKeySet('{ESC}','EXITMyScript')

While 1

WinActivate("CABAL")

$SearchResult = PixelSearch(116, 59, 148, 68, 0x1A1A1A, 10, 1)

If Not @error Then

Send("{-}")

EndIf

$coord = PixelSearch( 100, 100, 1024, 718, 0X908D31, 10, 2)

If Not @error Then

MouseClick("left",$coord[0],$coord[1])

Sleep (200)

EndIf

Send("1")

Sleep(1500)

Send("2")

Sleep(1600)

Send("3")

Sleep(1600)

Send("{Space}")

Send("{Space}")

Sleep(225*1000) ;pause for 225sec

Send("4")

Sleep(3000);delay 3 sec

;resume loop

Wend

Func EXITMyScript()

Exit

EndFunc

Link to comment
Share on other sites

The game is Cabal Online. What I'm going for is pushing 1, 2, 3 to use my sword skills for 225 seconds. After 225 seconds, my HP regen buff wears off and I start taking damage and start dying, so I need to recast it. So I want it to pause the script, then push 4 because thats the button my HP buff is on, then resume pushing 1, 2, 3, for another 225 seconds, then push my HP buff again. I cant figure out how to make it skip 4 and go 1, 2, 3, 1, 2, 3, then in 225 seconds, push 4 for the buff, then resume 1, 2, 3, 1, 2, 3. Hope that clears it up a bit :S

Link to comment
Share on other sites

i think i get it

not the cleanest code and not tested (i'll let you do all that)

but something like...

HotKeySet('{ESC}','EXITMyScript')

While 1
    WinActivate("CABAL")
    $SearchResult = PixelSearch(116, 59, 148, 68, 0x1A1A1A, 10, 1)
    If Not @error Then
        Send("{-}")
    EndIf
    $coord = PixelSearch( 100, 100, 1024, 718, 0X908D31, 10, 2)
    If Not @error Then
        MouseClick("left",$coord[0],$coord[1])
        Sleep (200)
    EndIf
    $begin = TimerInit()
    send123()
    Send("4")
    Sleep(3000);delay 3 sec
    ;resume loop
Wend

Func EXITMyScript()
    Exit
EndFunc

Func send123()
    Do
        Send("1")
        Sleep(1500)
        Send("2")
        Sleep(1600)
        Send("3")
        Sleep(1600)
        Send("{Space}")
        Send("{Space}")
    Until TimerDiff($begin) > 225000
EndFunc
Link to comment
Share on other sites

Thank you stampy, that got the delay for the buff to work. The only problem now is it wont find a mob pixel for 225 seconds. So if my mob dies early it will stand there for 225 seconds, cast the buff, then find a mob pixel to attack :S

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