User Tools

Site Tools


timer_func

Differences

This shows you the differences between two versions of the page.


timer_func [2022/09/03 23:25] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Scripting - Timer control function ======
 +
 +=====Timer Create=====
 +
 +{|style="font-size:85%; border:solid 2px; width: 50%;"
 +|style="font-size:150%;  padding: 2px" colspan="2" | **Create a Named Timer**
 +|- style="background-color:#f0f0f0;"
 +|**Syntax**
 +|style="width: 90%" | Timer.Create(string TimerName, int ms_timer )
 +|-
 +|colspan="2" |**Description:**
 +|-
 +|colspan="2" |Create a timer with the provided name that will expire in ms_timer time (in milliseconds)
 +|- style="background-color:#f0f0f0;"
 +|**Returns**
 +|void
 +|-
 +|**In Object:**
 +|Timer
 +|- style="background-color:#f0f0f0;"
 +|**Parameters:**
 +|none
 +|-
 +|colspan="2" |Example:
 +<code>
 +Timer.Create("Test", 5000)
 +</code>
 +|}
 +
 +=====Timer Check=====
 +
 +{|style="font-size:85%; border:solid 2px; width: 50%;"
 +|style="font-size:150%;  padding: 2px" colspan="2" | **Get remaining time for a named timer**
 +|- style="background-color:#f0f0f0;"
 +|**Syntax**
 +|style="width: 90%" | Timer.Remaining(string TimerName)
 +|-
 +|colspan="2" |**Description:**
 +|-
 +|colspan="2" | Returns the milliseconds remaining for a timer
 +|- style="background-color:#f0f0f0;"
 +|**Returns**
 +| int ms_time 
 +|-
 +|**In Object:**
 +|Timer
 +|- style="background-color:#f0f0f0;"
 +|**Parameters:**
 +|string TimerName
 +|-
 +|colspan="2" |Example:
 +<code>
 +Timer.Create("Test", 5000)
 +#
 +while Timer.Check("Test"):
 +    remain = Timer.Remaining("Test")
 +    Misc.SendMessage("TimeLeft: {}".format(remain))
 +    Misc.Pause(500
 +</code>
 +|}
 +
 +
 +{|style="font-size:85%; border:solid 2px; width: 50%;"
 +|style="font-size:150%;  padding: 2px" colspan="2" | **Check if a timer is expired or not**
 +|- style="background-color:#f0f0f0;"
 +|**Syntax**
 +|style="width: 90%" | Timer.Check(string TimerName)
 +|-
 +|colspan="2" |**Description:**
 +|-
 +|colspan="2" |Check if a timer object is expired or not, 
 +|- style="background-color:#f0f0f0;"
 +|**Returns**
 +|bool - True if not expired, false if expired
 +|-
 +|**In Object:**
 +|Timer
 +|- style="background-color:#f0f0f0;"
 +|**Parameters:**
 +|string TimerName
 +
 +|}
  
timer_func.txt · Last modified: 2022/09/03 23:25 by 127.0.0.1

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.