VoidExpanse/scope-config: Difference between revisions

From AtomicTorchWiki
No edit summary
Line 12: Line 12:
* string: name|
* string: name|
bool - whether the flag is set or not.|
bool - whether the flag is set or not.|
<nowiki>var a = config.GetFlag("some_var");</nowiki> |
<pre style="margin:0px">var a = config.GetFlag("some_var");</pre> |
Returns a boolean server flag value by name. Basically used to read server config options.
Returns a boolean server flag value by name. Basically used to read server config options.
}}
}}
Line 19: Line 19:
* string: name|
* string: name|
object - a particular value of config.|
object - a particular value of config.|
<nowiki>var a = config.GetSetting("some_var");</nowiki>|
<pre style="margin:0px">var a = config.GetSetting("some_var");</pre>|
Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean.
Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean.
}}
}}
Line 26: Line 26:
* int: time_ms|
* int: time_ms|
void |
void |
<nowiki>config.Wait(1000); //wait for 1 second</nowiki>|
<pre style="margin:0px">config.Wait(1000); //wait for 1 second</pre>|
Makes main thread to wait for specified time in milliseconds.
Makes main thread to wait for specified time in milliseconds.
}}
}}

Revision as of 03:44, 13 February 2014


Config scope

Used to get access to server variables from config file.

Visibility: Global.

List of functions

GetFlag
Arguments Returns Example
  • string: name

bool - whether the flag is set or not.

var a = config.GetFlag("some_var");
Description

Returns a boolean server flag value by name. Basically used to read server config options.


GetSetting
Arguments Returns Example
  • string: name

object - a particular value of config.

var a = config.GetSetting("some_var");
Description

Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean.


Wait
Arguments Returns Example
  • int: time_ms

void

config.Wait(1000); //wait for 1 second
Description

Makes main thread to wait for specified time in milliseconds.