Updated Timer (markdown)
8
Timer.md
8
Timer.md
@@ -6,7 +6,7 @@ Here is a list of all available functions for timers: <br>
|
||||
sets the time the timer should wait after calling your function
|
||||
````lua
|
||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer"):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)<br>
|
||||
@@ -16,7 +16,7 @@ aTimer:setTime(5)
|
||||
starts the timer
|
||||
````lua
|
||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer")
|
||||
aTimer:setTime(5):start()
|
||||
````
|
||||
**parameters:** -<br>
|
||||
@@ -26,7 +26,7 @@ aTimer:setTime(5):start()
|
||||
stops/cancels the timer
|
||||
````lua
|
||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer")
|
||||
aTimer:setTime(5):start()
|
||||
aTimer:cancel()
|
||||
````
|
||||
@@ -41,7 +41,7 @@ local function timerCall(self)
|
||||
basalt.debug("i got called!")
|
||||
end
|
||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer"):show()
|
||||
local aTimer = mainFrame:addTimer("myFirstTimer")
|
||||
aTimer:setTime(5):onCall(timerCall):start()
|
||||
|
||||
````
|
||||
|
||||
Reference in New Issue
Block a user