Jump to content
Alloder.pro: about Allods with love
Search In
  • More options...
Find results that contain...
Find results in...

New program for writers

We turn from quantity to quality and tell you how we will supplement the Allods Team program with rewards in rubles.

More

The new Updater

Let us to introduce the new addon updater software and to share the details

Read more

Alloder 2.0

We have started the process of project evolve, and this relates not only, and not even primarily of the site's view

Read more

1 Screenshot

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

 

 Share


×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use