MikuAuahDarkI have no plans on updating this anymore. Consider timerEx 2025 which can be found here!
Description 
This Lua Script just create new function that extends normal
timer function
Features 
Simply it's better than normal
timer 
No more timer issue like number to string
Multi arguments, not like normal timer that only allow 1 parameter(it must use
lua to execute more parameter and allow all types of value)
No limitations on value type(normal timer only allow number and string, timerEx allow to use all type available on Lua)
Fast enough
Allow to use function address instead of name
Also allow function inside table called via string
Able to handle returned values by called function
How to Install 
You should know it. Well if you not know it click spoiler below
Reserved Global Variables 
__timerArg
timerEx
freetimerEx
Data 
Hooks: 0
Lines: 44
Important Function: timerEx, freetimerEx
Functions 
timerEx(miliseconds(number),function(string/function),count(number),addtional arguments)
Parameters:
- miliseconds, delay of timer
- function, function to be executed. It can be function name or function address
- count, how many times to be executed(nil=1)
- addtional arguments, argument that needed for the function "function"
Returns: ID of the timer(can be used for freetimerEx)(number)
Example:1
2
2
timerid=timerEx(1000,"setpos",1,5,0x4552,0x5a41) tmp=timerEx(1000,print,5,"EverySeconds")
freetimerEx(timerid(number))
Parameters:
- timerid, id of the timer that want to be terminated
Returns: true if timer successfully terminated, false otherwise(timerid not exist)(boolean)
Example:1
2
3
4
5
2
3
4
5
if freetimerEx(timerid) then
	print("Timer successfully terminated")
else
	print("Failed to terminate timer")
end
Limitations 
Returned values only handled if "count" is more than 1
Rules 
You can use it for your server
You can edit it
You can upload at another website, say
MikuAuahDark made it
You can't say this is yours
You can't upload on another website without put me on credits
Notes 
1. It uses random function first then call the actual function
2. Tell me if there is any bugs
3. Picture is useless
4. timerEx now able to handle returned values, only when count is more than 1. The returned values is located at __timerArg[timer_id].r
Version History 
v4.0

v3.0

v2.0

v1.0
Another MikuAuahDark Scripts 
edited 13×, last 02.04.25 02:27:31 am
Approved by Starkkz
Download
2 kb, 962 Downloads
Timer Extra function(timerEx) v4.0
Offline

1 
".