I have no plans on updating this anymore. Consider timerEx 2020 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")
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
timerEx now able to handle returned values(check Notes 4)
freetimerEx also now deletes the temporary function that used by timerEx internally
v3.0
Function inside table now call-able even using string as function(timerEx(1000,"string.char",1,169))
timerEx only call-able for 1 time(when using "count" parameter more than 1)
v2.0
Function address compatibly
Optimized code
v1.0
timerEx initial release
Another MikuAuahDark Scripts
[UNUSED] Get Player Rank v1.4 (14)
Env_Laser v1.0 (7)
Weapon Hudtxt v1.0 (7)
Improved Badwords v2.0 (5)
edited 12×, last 19.06.20 02:56:56 pm
Approved by Starkkz
Download
2 kb, 688 Downloads