- Home
- Downloads
-
Addons & Mods
Featured
World of Warcraft
6,099 Addons
-
Popular Downloads
- Top World of Warcraft Addons
- Top Minecraft Server Mods
- Top Rift Addons
- Top Skyrim Mods
- Top World of Tanks Skins
- Top StarCraft II Maps
- Top Terraria Maps
- Top Runes of Magic Addons
- Top Warhammer Online Addons
- Top The Secret World Mods
- Top Age of Conan Addons
-
- Curse Client
- Premium
- News
- Giveaways
- Forums
- Store
libTimer
- 0 Likes
- Rift
- 9 Monthly Downloads
- Supports: 1.3
- 1,778 Total Downloads
- Updated 06/12/2011
- Created 06/12/2011
- 3 Favorites
- Project Site
- Comments
- Release Type: Beta
- License: GNU General Public License version 2 (GPLv2)
- Newest File: libTimer v0.1
About libTimer
About
This is a simple timer implentation for Rift addons to use.
As jnwhiteh have pointed out, this is technically not the most optimum way of doing it,but it is simple, and it is also pretty fast. Fast enough for the majority of practical uses.
The main problems will be with extremely many and/or very small repeating timers, as it has to update the timers index every time a timer is added or removed.
In those cases you'd probably be better of writing your own custom timer, anyway.
Commands
(params marked with * are optional)
- timer_reference = StartTimer(seconds, callback, data*, repeating*)
- Creates a timer, which will run when "seconds" value of time has passed.
- seconds - Seconds until the timer is run. Can be fractional numbers.
- callback - The callback function to run when the timer is up
- data - (Optional) Data to send to the callback
- repeating - (Optional) If the timer shall be repeating
- Function returns a reference to the timer created
- StopTimer(timer_reference)
- Will stop an existing timer.
- timer_reference - The reference of the timer you want to stop
- libTimer_SetDebug(int)
- Will set the level of debug messages that will be shown.
- int - Value from 0 to 10. 0 means no messages (default), 10 means a lot of messages.
Examples
Very basic example
function myFunc() print("This is a delayed function") end StartTimer(10, myFunc)
Sending data to callback
function myFunc(v) print("This function was called with "..v) end StartTimer(10, myFunc, "The Power of Time!")
Repeating timer
function myFunc() print("I rise! ..again") end wicked = StartTimer(10, myFunc, nil, 1)
Stop that repeating timer
StopTimer(wicked)
Initial
| File Name | Release Type | Game Version | Downloads | Date |
|---|---|---|---|---|
| libTimer v0.1 | Beta | 1.3 | 1,782 | 06/12/2011 |
Comments