Difference between revisions of "AppOnIdle"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with "===From the Scripting Manual=== ''procedure AppOnIdle(Ticks: integer);'' '''Parameter Info:''' Ticks (Integer): Current tick count. '''Description:''' This procedure ...")
 
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
   
 
   
 
  '''Description:'''
 
  '''Description:'''
  This procedure will be called every second. You may use this procedure to add timers to your server.
+
  This procedure will be called every second by default. You may use this procedure to add timers to your server.
 
  See below for examples:
 
  See below for examples:
  
Line 24: Line 24:
 
end;</source>
 
end;</source>
  
 
+
==See also==
==External Links==
+
[[AppOnIdleTimer]]
* [http://enesce.com/help/index.html?Events/AppOnIdle.html Scripting Manual page for AppOnIdle]
 
  
 
[[Category:Server Scripting]][[Category:Server Scripting Events]]
 
[[Category:Server Scripting]][[Category:Server Scripting Events]]

Latest revision as of 09:37, 13 March 2013

From the Scripting Manual

procedure AppOnIdle(Ticks: integer);

Parameter Info:
Ticks (Integer): Current tick count.

Description:
This procedure will be called every second by default. You may use this procedure to add timers to your server.
See below for examples:

Examples

A timer to execute every 5 minutes:

if Ticks mod (3600 * 5) = 0 then begin
    WriteLn('5 minutes has passed');
    //More code here
end;

A timer to execute every 30 seconds:

if Ticks mod (60 * 30) = 0 then begin
    WriteLn('30 seconds has passed');
    //More code here
end;

See also

AppOnIdleTimer