-
Notifications
You must be signed in to change notification settings - Fork 40
Timer
Robert Jelic edited this page May 10, 2022
·
3 revisions
With timers you can call delayed functions.
Here is a list of all available functions for timers:
sets the time the timer should wait after calling your function
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTimer = mainFrame:addTimer("myFirstTimer")
aTimer:setTime(5)
**parameters:**number time[, number repeats] - (time in seconds, if repeats is -1 it will call the function infinitly (every x seconds)
returns: self
starts the timer
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTimer = mainFrame:addTimer("myFirstTimer")
aTimer:setTime(5):start()
parameters: -
returns: self
stops/cancels the timer
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTimer = mainFrame:addTimer("myFirstTimer")
aTimer:setTime(5):start()
aTimer:cancel()
parameters: -
returns: self
adds a function to the timer
local function timerCall(self)
basalt.debug("i got called!")
end
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTimer = mainFrame:addTimer("myFirstTimer")
aTimer:setTime(5):onCall(timerCall):start()
parameters: function func
returns: self
Thanks for checking out our wiki, join our discord for more help: discord.gg/yM7kndJdJJ