About This File
LibTimer is a library that allows the use of a timer function. This is intended for developers, not general players.
The Allods API does not provide a way to call a function after a certain time, at least not without freezing the thread. So I've used something that the API does provide: animation of a widget. To be more exact, when we animate a widget, we can specify the duration of the animation. My library uses that.
Usage is simple. First, include the file in AddonDesc.(UIAddon).xdb, in the <Scripts> section, but before your main script file.
You can use the timer function like so:
StartTimer(functionName,duration,arguments[...])
functionName is the name of the function that you want to execute.
duration is the duration in milliseconds after wich the function will execute
arguments is a list of the arguments that you want to pass to your function. You can pass any number of arguments
This is an example that will run the function TestTimer 2 seconds after writing "Test Start".
function TestTimer(param1, param2, param3) common.LogInfo("",param1.." "..param2.." "..param3) end common.LogInfo("","Test Start") StartTimer(TestTimer,2000,"First String","Second String","Third String") common.LogInfo("","Test End??")
The result will be the following
Test Start Test End?? First String Second String Third String