WoW:Using OnUpdate correctly: Difference between revisions

m
Line 25: Line 25:
   -- Functions Section
   -- Functions Section
   function MyAddon_OnUpdate(elapsed)
   function MyAddon_OnUpdate(elapsed)
     this.timeSinceLastUpdate = this.timeSinceLastUpdate + elapsed;
     this.TimeSinceLastUpdate = This.timeSinceLastUpdate + elapsed;
     if (this.timeSinceLastUpdate > MyAddon_updateInterval) then     
     if (this.TimeSinceLastUpdate > MyAddon_updateInterval) then     
       --
       --
       -- Insert your OnUpdate code here
       -- Insert your OnUpdate code here
       --
       --
       this.timeSinceLastUpdate = 0;
       this.TimeSinceLastUpdate = 0;
     end
     end
   end
   end
Anonymous user