#Adding a grace period to a trigger

1 messages · Page 1 of 1 (latest)

fallow widget
#

Hello you beautiful people!
Does anyone know how to add a grace period to a trigger? Specifically so that a weakaura cant fire if it has already fired in the last second.

For super clarity, Im looking to make a weakaura trigger on a Pistol Shot cast, but NOT on the subsequent volleys that trigger when you have the Opportunity buff(which makes it fire additional times). In the combat log they're all the same spellid so i cant filter by that. So I want to use Pistol Shot -> weakaura shows -> pistol shot shoots 3 more times, but does NOT show or refresh the weakaura three additional times. Only the very 1st shot should count.
Im thinking the easiest way to achieve this is to make it so the aura cant fire again for 1sec after the 1st time.

Any help is appreciated!

idle thunder
#

Using a combat log trigger, give it a 1sec duration. (not cloning)

fallow widget
#

this? it doesnt work, it refreshes on subsequent casts if they occur

idle thunder
#

It does refresh yes. So a sound On Show, for example, wouldn't refire

#

If that doesn't get you where you need to be then it would likely be trickier to fix

fallow widget
#

would it be too much of a hassle if i sent you the whole thing? im not sure how much im asking or if its easy fix

idle thunder
#

I'm too busy right now to take a look I'm afraid

fallow widget
#

ah no worries

idle thunder
#

Could maybe just go the direct route and try using this in Custom Activation (change the triggers being used as needed)

function(t)
  if t[1] then
    if not aura_env.last or GetTime() - aura_env.last > 1 then
      aura_env.last = GetTime()
      return true
    end
  end
end
fallow widget
#

ill check it out!

fallow widget
#

I played around with it, but im too noob. Not sure where to include it, was getting errors =/. Here's the snippet:

function(event,...)--GCD from SpellCasting and Combatlog
local function SpellCT(SpellID)
local ,,_,CastTime = GetSpellInfo(SpellID)
return CastTime
end

local function SpellGCD(SpellID)
    local _,GCD = GetSpellBaseCooldown(SpellID)
    return GCD
end

if event == "COMBAT_LOG_EVENT_UNFILTERED" then
    if select(2,...) == "SPELL_CAST_START" and select(4,...) == UnitGUID("player") and SpellGCD(select(12,...)) == 1000 then
        aura_env.spellID = select(12,...)
        aura_env.spellCasting = aura_env.spellID
        aura_env.GCDstart = GetTime()
        aura_env.GCDexp = aura_env.GCDstart + 1
        return true
    end
end

if event == "UNIT_SPELLCAST_SUCCEEDED" and GetSpellInfo(185763) ~= GetSpellInfo(select(4,...)) then --185763 is Pistol Shot
    aura_env.spellID = select(3,...)
    if aura_env.spellID and SpellCT(aura_env.spellID) <= 0 and SpellGCD(aura_env.spellID) == 1000 then
        aura_env.GCDstart = GetTime()
        aura_env.GCDexp = aura_env.GCDstart + 1
        return true
    end
    
end

end

--[[
function(t)
if t[1] then
if not aura_env.last or GetTime() - aura_env.last > 1 then
aura_env.last = GetTime()
return true
end
end
end
]]

idle thunder
#

Required for Activation = Custom

fallow widget
#

aaah

#

no, still doesnt work :< it re-fires it with every proc after the initial cast