Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Please help me with the script, thank you


  • Please log in to reply
3 replies to this topic
arashi87
  • Members
  • 1 posts
  • Last active:
  • Joined: 30 Oct 2015
Hi I have just started in a game which has got Ctrl+1-9 and Alt+1-9 skill bars. I would like to create something like Ctrl +(number) or Alt +(number) for a skill that has got cooldown time (45sec for example) and needs to be able to play it in loop Also a "one key" to activate on and off function for all the skills thats in loop for example; turn on enter Ctrl +1, wait 45sec, enter again and so on enter Ctrl+2, wait 200sec, enter again and so on and an hotkey that i can turn the script on and off freely much appreciated thanks arashi

Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

While I am sure there are better options, here is one way to do what you want (I only did 1 & 2 for Ctrl & Alt)...

; Start timers for each key.
SetTimer, Ctrl1, 45
SetTimer, Ctrl2, 200
SetTimer, Alt1, 45
SetTimer, Alt2, 200
Return
 
; Define the individual hotkeys.
^1:: ; Ctrl+1
CtrlOne := !CtrlOne
Return
 
^2:: ; Ctrl+2
CtrlTwo := !CtrlTwo
Return
 
!1:: ; Alt+1
AltOne := !AltOne
Return
 
!2:: ; Alt+2
AltTwo := !AltTwo
Return
 
F12:: ; Enable/Disable all timers
If ToggleAll = On
    ToggleAll = Off
Else
    ToggleAll = On
Loop, 2    ; Increase this to 9 once you have all 9 keys configured.
{
    SetTimer, Ctrl%A_Index%, %ToggleAll%
    SetTimer, Alt%A_Index%, %ToggleAll%
}
Return
 
; Define the timers.
Ctrl1:
If CtrlOne
    Send ^1
Return
 
Ctrl2:
If CtrlTwo
    Send ^2
Return
 
Alt1:
If AltOne
    Send !1
Return
 
Alt2:
If AltTwo
    Send !2
Return


Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Do note that with Shadow's example, the number in SetTimer has the units of milliseconds. To do seconds, multiply those by 1000. (e.g. 45 seconds is 45000 milliseconds).



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

Do note that with Shadow's example, the number in SetTimer has the units of milliseconds. To do seconds, multiply those by 1000. (e.g. 45 seconds is 45000 milliseconds).

 

 

D'oh!    Knew I had something wrong in there.   Nice catch.  Thank you.    :)