Jump to content

Buff Timer


 Share

Recommended Posts

Good evening. I wanted to tap the minds of this community to see if you can teach me a lil trick to 2. I'm playing 2Moons atm and I'm at the point where I'm grinding my fingers to the bone by hitting my number keys constantly. I'm sure I'll have to get another G15 here soon <_< .... So after some research I came across this site and I must say, a wealth of knowlege here.... Anyways, I came up with this lil script which is working fine, except that I want to go one step further if possible. On my tool bar, I have 9 slots which are set to keys 1-9. The first 5 keys are my attack keys and the last 5 are my buff keys. The way the script is now, it's just going in order from 9 - 1 which fires off my buffs first, and then my attacks last. What I noticed is that all of my 'buffs' have a 'cool down time' which can be 30 secs in duration up to the longest one 210 secs before the buff is available again. What I'd like to find out is how to add a 'cool down' timer so that I can take the repetativeness out of the script..... Ex: once the macro starts, all the buffs fire off.... but after the last key is hit, I want to go back to my attack buffs only until my other defense buffs are done cooling down.. so for instance... at time 210 secs , key 9 would be pressed... at 160 secs, key 8 would be pressed and so on... I want this to be a continues script also... I'm not looking for someone to re-write my script, but more then pointing me in the right direction so I can learn how to script more..... I'd rather learn to code then to have someone write it for me. Eventually I want something that I can wrap up in a gui to fire off.... Thanks much and I hope I didn't confuse anyone.... btw, this is my first attempt of writing scripts so plz be kind :) ....

Opt("TrayIconDebug",1)
WinActive("2Moons")

Global $Paused
HotKeySet("{F4}","_Start")
HotKeySet("{F5}","_Pause")
HotKeySet('{F6}', '_Exit')

While 1
    Sleep(100)
WEnd

Func _Start()
    While 1 = 1
    ControlSend("2Moons","","","9")
    Sleep(2000)
    ControlSend("2Moons","","","8")
    Sleep(2000)
    ControlSend("2Moons","","","7")
    Sleep(2000)
    ControlSend("2Moons","","","6")
    Sleep(2000)
    ControlSend("2Moons","","","5")
    Sleep(2000)
    ControlSend("2Moons","","","4")
    Sleep(2000)
    ControlSend("2Moons","","","3")
    Sleep(2000)
    ControlSend("2Moons","","","2")
    Sleep(2000)
    ControlSend("2Moons","","","1")
    Sleep(2000)
    ControlSend("2Moons","","","{SPACE}")
    ControlSend("2Moons","","","{SPACE}")
    ControlSend("2Moons","","","{SPACE}")
    WEnd
EndFunc

Func _Pause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc


Func _Exit()
    ToolTip('         '&@CRLF&'  EXITING  '&@CRLF&'       ')
    Sleep(500)
    Exit
EndFunc
Link to comment
Share on other sites

Look at the TimerInit() function. You can have various of these running at the same time. You use TimerDiff() to see how many milliseconds have passed.

EDIT: After looking at your script/post more closely maybe you could just fire everything at the beginning in a part outside of the loop. And then have a loop that looks something like this:

While 1
    ControlSend("2Moons","","","9")
    _Attacks()
    Sleep(1000 * 30)
    ControlSend("2Moons","","","8")
    _Attacks()
    Sleep(1000 * 30)
    ControlSend("2Moons","","","7")
    _Attacks()
    Sleep(1000 * 30)
    ControlSend("2Moons","","","6")
    _Attacks()
    Sleep(1000 * 30)

    ControlSend("2Moons","","","{SPACE}")
    ControlSend("2Moons","","","{SPACE}")
    ControlSend("2Moons","","","{SPACE}")
WEnd

Func _Attacks()
    ControlSend("2Moons","","","5")
    Sleep(1000 * 30)
    ControlSend("2Moons","","","4")
    Sleep(1000 * 30)
    ControlSend("2Moons","","","3")
    Sleep(1000 * 30)
    ControlSend("2Moons","","","2")
    Sleep(1000 * 30)
    ControlSend("2Moons","","","1")
EndFunc

This would cause it to go through each one every thirty seconds...

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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...