Originally Posted by
paintpauller
to delay some code for x amount of seconds in this case 2 seconds. its a Interrupt profile so yes i am, just using that to only run the code once. the PQR_WriteToChat is just for testing to see y it wasnt working and wont be there when i get it to work.
If you just need to delay your rotation for 2 seconds, consider using PQR_DelayRotation(2). To use it, whenever you need to delay, call PQR_DelayRotation(2) which delays for 2 seconds, then return true. When the ability returns true, the rotation simply pauses for 2 seconds then continues.
Originally Posted by
paintpauller
cold some1 let me know how to use
PHP Code:
PQR_DelayRotation()
when ever i try to use it it doesnt look like its doing anything even at 20 seconds it still not noticeable.
i have made the following changes to your code mentally but it still does not work:
PHP Code:
if PQR_InterruptStarted then
PQR_InterruptStarted = false
local Start = GetTime()
if Start - GetTime() == 2 then
PQR_WriteToChat("Two seconds elapsed.")
end
if Start - GetTime() >= 2 then
PQR_WriteToChat("Two seconds or more have elapsed.")
end
end
=(
If you want to try something a little fancy, you could always look at Xelpers code for handling shields on heroic spirit kings. Here's a smaller version that only checks to see if the immunities are up on certain targets and halts the rotation until the immunities are gone (with a 0.5sec latency delay).
PHP Code:
-- Pause Rotation Handler - Variable is simply a timestamp on when to
-- continue rotation.
if PQR_PauseRotation == nil then
PQR_PauseRotation = 0
elseif PQR_PauseRotation > GetTime() then
return true
else
PQR_PauseRotation = 0
end
-- Check for Immunities on when to stop
local immunities = { 117697, 117961, 118162 }
for i,v in ipairs(immunities)
local immunityName, _, _, _, _, _, immunityTimeToExp = UnitBuffID("target",v)
if immunityName then
StopAttack()
SpellStopCasting()
PQR_PauseRotation = GetTime() + immunityTimeToExp + 0.5
return true
end
end