Timer:IsPastSimMS

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
m (Fixing a little mistake in the code)
m (updating function page)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
{{LuaFunction
{{LuaFunction
-
|function_name       = Timer:IsPastSimMS
+
|function_name =IsPastSimMS
-
|arguments           = [[number]] Time in milliseconds
+
|arguments =* A unsigned long specifying the threshold amount of time in ms.
-
|returns             = [[nil]]
+
|returns =A bool only yielding true if the elapsed time is greater than the passed in value.
-
|description          = This function will check, whether a certain time has passed after the timer has been created.
+
|description =
-
|codedesc            = This will gib the object this script is attached to after 5 seconds have passed.
+
Returns true if the elapsed time is past a certain amount of time.
-
|code                = <code lua n>
+
  }}
-
function create(self)
+
-
    self.LTimer = Timer(); --this is needed for "Timer:IsPastSimMS" to work.
+
-
end
+
-
 
+
-
function update(self)
+
-
    if Timer:IsPastSimMs(5000) == true then --checks if 5 seconds (5000 milliseconds) have passed
+
-
        self:GibThis(); --if 5 seconds have passed, gib(kill) the object!
+
-
    end
+
-
end</code>
+
-
|output              = nil
+
-
|}}
+

Latest revision as of 00:56, 28 June 2012

Function
SyntaxIsPastSimMS( * A unsigned long specifying the threshold amount of time in ms. )
Description:
Returns true if the elapsed time is past a certain amount of time.
ReturnsA bool only yielding true if the elapsed time is greater than the passed in value.




Example
DescriptionPlaceholder!
Code
  1. for k,v in pairs(PagesWithoutExamples) do
  2.     v.MakeExample(NoErrors);
  3. end
OutputPlaceholder!
Personal tools