• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Custom Class Help.

    Discussion in 'Archives' started by Wildice, May 16, 2011.

    1. Wildice

      Wildice New Member

      Joined:
      May 15, 2011
      Messages:
      19
      Likes Received:
      1
      Trophy Points:
      0
      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.
       
    2. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      Can you rephrase your question, I don't understand what you are trying to do.
       
    3. Wildice

      Wildice New Member

      Joined:
      May 15, 2011
      Messages:
      19
      Likes Received:
      1
      Trophy Points:
      0
      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.
       
    4. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      And why wouldn't you use a Timer function?
       
    5. Wildice

      Wildice New Member

      Joined:
      May 15, 2011
      Messages:
      19
      Likes Received:
      1
      Trophy Points:
      0
      First time using c# and having trouble find something that would work. Looked though 7-10 cc's and found nothing similar.
       
    6. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      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
       
    7. Wildice

      Wildice New Member

      Joined:
      May 15, 2011
      Messages:
      19
      Likes Received:
      1
      Trophy Points:
      0
      Thanks alot for the help! :D
       
    8. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      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.
       
      Last edited: May 16, 2011

    Share This Page