I'm looking for a way to time a function out in a cc without blacklisting the target. Blacklist.add isn't going to cut it, I'm unsure as to weather it blacklists the target or the spell(I'd still like to know if you know though) but I want neither I need to prevent a function from executing until x time has elapsed from last execution. Any help is appreciated.
Druid's have a buff they can get if talented for it called Nature's Grace if they cast regrowth, this buff provides 20% haste and I would like to be able to take advantage of this. I so I want to be able to do something like this Code: else if (hp < 25 && !isAuraActive("Nature's Grace") && CC("Regrowth", tar) && !timeout) { s = "Regrowth"; timeout = will not attempt to run this function unless 45 seconds have elapsed from last use/run. } So in short i want know what i can place in their to prevent it from casting without blacklisting the target. Would also like to know if Blacklist.Add(tar, new TimeSpan(0, 0, 5)); blacklists the target or the spell.
First time using c# and having trouble find something that would work. Looked though 7-10 cc's and found nothing similar.
There is plenty of useful code to be found in almost every CC. A StopWatch function is what you're looking for: C# Stopwatch Samples
Code: Log("Current target is not tagged by me, Aborting pull!"); Blacklist.Add(Me.CurrentTarget, TimeSpan.FromMinutes(30)); Me.ClearTarget(); basically the blacklist can blacklist anything that the object manager can provide when blacklisted the objectmanager simply just wont pass that WoWItem, or WoWUnit, or WoWGameObject to you anymore until the timer runs out. so lets say your casting a spell on a mob and he runs out of line of sight, if you have him targeted, even though you blacklisted him, you still have him targeted, so the CC wont care if its blacklisted or not, the mob is still in the target, so a Cleartarget must be performed after so the targeting code can pass you a new target that ISNT in the blacklist. if your doing heals, and passing the target along with the spellcast. Something like SpellManger.Cast("Heal", WoWUnit) as long as the wowunit is your current target you dont need to clear it, since after its done your code should get a new target from the object manger that isnt blacklisted. blacklist will not work for spells, just generally things passed by the object manager. hopefully that made sense.