View Single Post
10-27-13, 03:45 PM   #9
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
Originally Posted by Mayron View Post
My "animation" is not one that I thought an animation method could help me with as I wanted to run a function every set seconds until a condition is met. I thought these animations only let you do simpler things like alpha changes, rotations and others.
Well that's legit, but they can still be used as a timer (and seem to be popular as such).
To use OnUpdate properly, you need to do something along the lines of:

Code:
f.elapsed = 0
f:SetScript ("OnUpdate", function (self, elapsed,...)
    f.elapsed = f.elapsed + elapsed
    if f.elapsed > 0.5 then
        ...
        f.elapsed = 0
    end
end
(Off the top of my head, please don't murder me if I missed something)

Point is, the code you used was simply blocking the game 100% of the time. Being stuck in a while loop means nothing on the screen can update, so the game basically freezes.
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote