Hello,
Since LuaNinja was gone awhile ago and I'm just looking for a Ret Pally 'rotation' script that will fire off certain keys after certain intervals, and also have a toggle so I can turn off the script because I'd like to chat. :P
Judgements are on a 8 second cooldown.
Crusader Strike is on a 4 second cooldown.
Divine Storm is on a 10 second cooldown BUT with 2 piece Tier 10, the cooldown can reset, so if this key can be pressed constantly.. <3
Consecration is on a 10 second cooldown.
Hammer of Wrath is on a 6 second cooldown.
Exorcism is on a 15 second cooldown.
Here's an example I found on AHK forum with a guy using a Hunter Shot 'Rotation'.. maybe it'll help!
Code:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: Complex
Script Function:
To automate the casting rotation of a warlock in the game World of Warcraft
#ce ----------------------------------------------------------------------------
Global $GCD = 1450 ; the standard global cool down (ADDED 50 MS FOR SERVER LAG)
Global $SBcd = 2350 ; the longer cool down of a specific spell (ADDED 50 MS FOR SERVER LAG)
Global $Mana = 2729 ; collection of mana used by spells, starting at 2729 to force as first spell
Global $Spells ; database to house the spell information
Global $Duration ; databse to maintain the current durration of each spell
Global $Paused ; toggle to pause and start the script, defaults paused
#cs ----------------------------------------------------------------------------
The global array Spells
key to be sent to the game client | cool down | mana cost | durration
t | 1430 | -2729 | 40000
1 | 1430 | 434 | 12000
2 | 1430 | 506 | 18000
3 | 1430 | 543 | 15000
4 | 1430 | 361 | 28000
5 | 2390 | 655 | 0
#ce ----------------------------------------------------------------------------
Dim $Spells[6][4] = [['t',$GCD,-2729,40000],['1',$GCD,434,12000],['2',$GCD,506,18000],['3',$GCD,543,15000],['4',$GCD,361,28000],['5',$SBcd,655,0]]
Dim $Duration[6] = [0,0,0,0,0,0]
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
WinWaitActive("World of Warcraft")
; The main driver
While 1
Select
case $Mana >= 2729 ; check the amount of mana
send("{t}") ; send the key stroke t
$Mana += $Spells[0][2] ; add the value of the spell cost (this instance is negitive)
If $Mana < 0 Then $Mana = 0 ; value must never drop below zero
$Duration[0] = $Spells[0][3] ; set the duration to the master value
CoolDonws($Spells[0][1]) ; lower the duration of all spells based on cool down
Sleep($Spells[0][1]) ; pause the script for the cool down
case $Duration[1] <= 0
send("{1}")
$Mana += $Spells[1][2]
CoolDonws($Spells[1][1]) ; cool downs happen befor the duration is reset for this spell since its cast time is the same as the cool down
$Duration[1] = $Spells[1][3]
; special case is there is a spell 2 active then 1 resets its counter
If $Duration[2] > 1400 Then $Duration[2] = $Spells[2][3]
Sleep($Spells[1][1])
case $Duration[2] <= 0
send("{2}")
$Mana += $Spells[2][2]
$Duration[2] = $Spells[2][3]
CoolDonws($Spells[2][1])
Sleep($Spells[2][1])
case $Duration[3] <= 0
send("{3}")
$Mana += $Spells[3][2]
CoolDonws($Spells[3][1])
$Duration[3] = $Spells[3][3]
Sleep($Spells[3][1])
case $Duration[4] <= 0
send("{4}")
$Mana += $Spells[4][2]
$Duration[4] = $Spells[4][3]
CoolDonws($Spells[4][1])
Sleep($Spells[4][1])
case $Duration[5] <= 0
send("{5}")
$Mana += $Spells[5][2]
$Duration[5] = $Spells[5][3]
CoolDonws($Spells[5][1])
Sleep($Spells[5][1])
EndSelect
While $Paused
Sleep(100)
Wend
WEnd
;Functions
Func CoolDonws($cd)
For $i = 0 to 5
$Duration[$i] -= $cd
; duration can never go below 0
If $Duration < 0 Then $Duration = 0
Next
EndFunc
Func TogglePause()
; serves two purposes, when paused the state of the script is reset
; and it pauses the script
If $Paused Then
ToolTip("")
$Mana = 2729
For $i = 0 to 5
$Duration[$i] = 0
Next
$Paused = False
Else
$Paused = True
ToolTip('Script is "Paused"',0,0)
Endif
EndFunc
Func Terminate()
Exit 0
EndFunc
Code:
IfWinActive, World of Warcraft
#HotkeyInterval 2000
#MaxHotkeysPerInterval 70
;repeats a specified key while holding down a hotkey and sending other keystrokes at set timeintervals.
;sets wich key to be the first key to be sent after loading the script and pressing the button
var_keytopress = 2
;set to 1 if you want the key to be repeated in the rotation
var_key2run = 1
var_key3run = 1
var_key4run = 1
;set to 1 if you want this to be used at the start of the rotation the first time after script is loaded
var_key2q = 1
var_key3q = 1
var_key4q = 1
;keys to be used and what I originally made them to do.
var_key1 = {Numpad1} ;Steady Shot
var_key2 = {Numpad2} ;Sting
var_key3 = {Numpad3} ;Auto Shot
var_key4 = {Numpad4} ;Multishot
;cooldowns after shooting
var_gcd = 1500 ;this is what you want to use for global cooldown
var_cd2 = 0 ;extra time before fire this particular shot
var_cd3 = 0
var_cd4 = 0
;Times to be used between trying to fire special shots (like stings)
var_key2_timer = 15000
var_key3_timer = 6000
var_key4_timer = 12000
$Numpad1::
SetTimer, CheckQ, 0 ;checks if the cooldown of sting is down
if var_key2run = 1 ;checks if var_key2 has been sent to not reset the timer until that has happened
{
SetTimer, Key2, %var_key2_timer% ;starts the function to change key to var_key2
}
var_key2run = 0 ;will be reset to 1 when y has been sent
if var_key3run = 1
{
SetTimer, Key3, %var_key3_timer%
}
var_key3run = 0
if var_key4run = 1
{
SetTimer, Key4, %var_key4_timer%
}
var_key4run = 0
;This loop will run as long as the button is pressed.
Loop
{
if not GetKeyState("Numpad1", "P")
break
if var_keytopress = 1
{
Send, %var_key1%
if var_key2q = 1
var_keytopress = 2
else if var_key3q = 1
var_keytopress = 3
else if var_key4q = 1
var_keytopress = 4
else
var_keytopress = 1
Sleep, %var_gcd%
}
else if var_keytopress = 2
{
Send, %var_key2%
var_key2q = 0
if var_key2q = 1
var_keytopress = 2
else if var_key3q = 1
var_keytopress = 3
else if var_key4q = 1
var_keytopress = 4
else
var_keytopress = 1
var_key2run = 1
Sleep, %var_gcd%
}
else if var_keytopress = 3
{
Send, %var_key3%
var_key3q = 0
if var_key2q = 1
var_keytopress = 2
else if var_key3q = 1
var_keytopress = 3
else if var_key4q = 1
var_keytopress = 4
else
var_keytopress = 1
var_key3run = 1
Sleep, %var_gcd%
}
else if var_keytopress = 4
{
Send, %var_key4%
var_key4q = 0
if var_key2q = 1
var_keytopress = 2
else if var_key3q = 1
var_keytopress = 3
else if var_key4q = 1
var_keytopress = 4
else
var_keytopress = 1
var_key4run = 1
Sleep, %var_gcd%
}
}
Return
Key2:
var_keytopress = 2
var_key2q = 1
Sleep, %var_cd2%
return
Key3:
var_keytopress = 3
var_key3q = 1
Sleep, %var_cd3%
return
Key4:
var_keytopress = 4
var_key4q = 1
Sleep, %var_cd4%
return
CheckQ:
if var_key2q = 1
var_keytopress = 2
else if var_key3q = 1
var_keytopress = 3
else if var_key4q = 1
var_keytopress = 4
return