1. #1

    Is there a way to slow-down an addon explicitly?

    I'm fed up with some addon authors and their insistence in creating a useful addon that must be working ALWAYS, even in raiding.

    Is there a way to slow down an addon or even make it go very dormant when in certain areas, not in combat, etc.?

    I'm very experienced in programming in general but not on these addons, can I just sleep() somewhere easily?

  2. #2
    The only way to set a function like an addon not being present in combat would be for the author to code that. Even if you knew LUA coding well, adding something like that to an addon could potentially break it.

    What you could do, though, is use an in-game addon manager. Curse has a few of them. I'm not really sure which is the best, as I don't use them.

    It's not the most elegant solution; but you could go in and turn off an addon while you're raiding, then turn it back on when you're done. It's a little bit of extra tedium, but it would work.

  3. #3
    You can't sleep() but it may be possible to find it's alter functions (onUpdate/eventHandlers).
    1. Have a single variable that tracks "last did work at time".\
    2. Whenever you enter an event handler GetTime() to figure out what time it is now.
    3. if the time now minus "last time you did work at" is > (some amount of time) then
    3 a. 1. update "last did work at time" variable
    3 b. 2. Do the rest of the standard trigger/update code
    4. else, do nothing.

    GetTime can throttle but you could of course add in zone checks, group size counts, class/character/spec checks, etc. You'll never completely remove CPU consumption because you'll always need to checking if it's time to do 'the real work'. Further, you're not going to gain anything unless the 'real work' you avoid doing is significantly more expensive than the cost of the 'should I do some work now' check.

    The problem is that this sort of thing can 'break' addons or make them perform unexpectedly. For example, if you've got a damage meter where you try to plug in code like that then it's going to miss almost all of the data so it will become useless. You'll also slow down things like updates so animations will run less smoothly.

    Just because an addon is loaded doesn't mean it's actually doing anything. If you've been collecting data with auctioneer and then bugger off to a raid, auctioneer doesn't actually do anything while you're in the raid. None of the events that would cause auctioneer to 'do stuff' can be fired in a raid so it has as much impact on your frame rate as if it had been disabled. The way addons are written - they should be 'dormant' unless there's a reason for them to be doing work. Things that display how much gold you have only update when your gold count changes - it takes (effectively) zero effort to keep displaying something that doesn't change and no code runs while your gold count is static.

    I suspect you'll discover after profiling your addons you'll discover that few if any would be 'improved' by this sort of trickery.

  4. #4
    You can make a macro in game or make a button in Lua that will disable/enable the addon and reload your UI. But there's not really anything you can do to make it automatic unless you dig deep into its code and alter it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts