VoidExpanse/scope-config

From AtomicTorchWiki
Revision as of 07:11, 18 February 2014 by Damonwall (talk | contribs)


Timer scope

Used to create and manage timers - delayed events. Timers only works inside it's script, but they're persistent through savegames.

Visibility: Global.

List of functions

SetTimer
Arguments Returns Example
  • double: time_in_seconds
  • string: function_name
  • object: args
  • int: loops (0 - infinite)

int - ID of created timer

var timer = timer.SetTimer(5, "SomeFunction", {what_to_say: "hello"}, 1);
function SomeFunction( args )
{
	console.Print("I was told to say " + args.what_to_say);
}
Description

Creates a timed event, which will be executed after "time_in_seconds" interval. Can be infinite loop.


ClearTimer
Arguments Returns Example
  • int: timer_id

void

timer.ClearTimer(5);
Description

Removes timer with specified ID.