Thread Tools Display Modes
01-01-09, 10:08 AM   #1
SetiHunter
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 25
Constantly repeating event

Hello. I would need a repeating event for my addon by contant time intervalls. It seems like ScheduleRepeatingEvent from ACE is propriate but cant get it to work. Maybe anyone can give an example?
It looks like this:
Code:
ScheduleRepeatingEvent(event, delay, ...)
and I tried:
Code:
MyAddon:ScheduleRepeatingEvent(methodToRun, 0.2)
But methodToRun dose not run ^^
  Reply With Quote
01-02-09, 10:09 AM   #2
Bangerz
A Fallenroot Satyr
 
Bangerz's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 27
Have you included Ace Timer when you defined your addon? You also need to include the library using your .toc or embeds.xml.

Code:
MyAddon= LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceTimer-3.0")
Another thing to note is that you dont prefix methodToRun with your addon name i.e. dont do this

MyAddon:ScheduleRepeatingEvent("MyAddon:methodToRun", 0.2)

Do this, note the quote marks

Code:
MyAddon:ScheduleRepeatingEvent("methodToRun", 0.2)

Last edited by Bangerz : 01-02-09 at 10:12 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Constantly repeating event


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off