GetTimerDetails
From Multi Theft Auto: Wiki
This function is for getting the details of a running timer.
Syntax
int, int, int getTimerDetails ( timer theTimer )
OOP Syntax Help! I don't understand this!
- Method: timer:getDetails(...)
Required Arguments
- theTimer: A timer element.
Returns
- Integer one represents the time left in miliseconds (1000th of a second) of the current time left in the loop.
- Integer two represents the amount of times the timer has left to execute.
- Integer three represents the amount of times the timer will execute.
- Returns false if the timer doesn't exist or stopped running. Also, debugscript will say "Bad Argument @ 'getTimerDetails'". To prevent this, you can check if the timer exists with isTimer().
Example
This example creates a 1 second (1000 ms) timer that will run 10 times, and you can see the timer details by using the command: timerdetails.
theTimer = setTimer(function() end, 1000, 10) -- A timer that does nothing. function timerDetails() remaining, executesRemaining, totalExecutes = getTimerDetails(theTimer) -- Get the timers details if (remaining and executesRemaining and totalExecutes) then outputChatBox("Time remaining this second: "..remaining.." Executes remaining: "..executesRemaining.." Total executes: "..totalExecutes) else outputChatBox("Timer no longer exists") end end addCommandHandler("timerdetails", timerDetails)
See Also
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace
- debugSleep
- decodeString
- encodeString
- fromJSON
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getServerConfigSetting
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setServerConfigSetting
- setTimer
- sha256
- split
- teaDecode
- teaEncode