1. Hey Guys is it possible to delay an event? I have an addon which automatically "release the corpse" if the character has died : local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_DEAD") f:SetScript("OnEvent", function() RepopMe() end)

    I tried it with the wait function from the wowwiki but it does nothing. Still instantly releases the corpse

    
    local waitTable = {};
    local waitFrame = nil;
    function still__wait(delay, func, ...)
    if(type(delay)~="number" or type(func)~="function") then
        return false;
      end
      if(waitFrame == nil) then
        waitFrame = CreateFrame("Frame","WaitFrame", UIParent);
        waitFrame:SetScript("onUpdate",function (self,elapse)
          local count = #waitTable;
          local i = 1;
          while(i<=count) do
            local waitRecord = tremove(waitTable,i);
            local d = tremove(waitRecord,1);
            local f = tremove(waitRecord,1);
            local p = tremove(waitRecord,1);
            if(d>elapse) then
              tinsert(waitTable,i,{d-elapse,f,p});
              i = i + 1;
            else
              count = count - 1;
              f(unpack(p));
            end
          end
        end);
      end
      tinsert(waitTable,{delay,func,{...}});
      return true;
    end
    
    local f = CreateFrame("Frame")
    f:RegisterEvent("PLAYER_DEAD")
    f:SetScript("OnEvent", function()
    still__wait(2, RepopMe())
    end) 
    

    Would appreciate if someone could tell me another method or if it not possible

  2. Perhaps something like this? http://wowprogramming.com/snippets/Createamini-timerusingOnUpdate_3

  3. You can use AceTimer to make timed operations: http://www.wowace.com/addons/ace3/pages/api/ace-timer-3-0/

    A lot of addons use Ace because it's an unparalleled source of utility.