Skip to main content
Version: 1.20.1

ExportVariables

When working with the server scripts, use the independent methods described below.

alert(message)


Use the method to output a string to the Info block after the server script execution. If there are multiple text output commands used, their results are combined.

Parameter(s):

NameTypeMandatoryDefault value
messageStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

alert()
alert('Message');
// Message

echo(messages)


Use the method to output one or more string to the Info block after the server script execution.

Parameter(s):

NameTypeMandatoryDefault value
messagesStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

echo()
echo('Message');
// Message

json(value)


Use the method to output a string containing the JSON representation of the specified value to the Info block under the server script after the execution.

Parameter(s):

NameTypeMandatoryDefault value
valueAnyYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

json()
json('{"key":"value"}')
// "{\"key\":\"value\"}"

print(message)


Use the method to display a string in the Info block after the server script execution.

Parameter(s):

NameTypeMandatoryDefault value
messageAnyYN

Return:

TypeDescription
IntegerThis method returns the number of characters in the transmitted message.

Example:

print()
print('Message')
// Message

Use the method to output human-readable information about the variable in the server script. If a string, integer, or floating point number is given, the value itself will be printed. If an array is given, the values will be presented in the key-value format. Similar designations are used for objects.

Parameter(s):

NameTypeMandatoryDefault value
valueAnyYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

print_r()
print_r({key: 'value'});
//V8Object Object
//(
// [key] => value
//)

sleep(seconds)


Use the method to delay the execution of a server script.

Parameter(s):

NameTypeMandatoryDefault value
secondsIntegerYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

sleep()
ss.info(new SimpleDateTime().getValue());
sleep(10);
ss.info(new SimpleDateTime().getValue());
// Info: 2022-09-28 09:46:59
// Info: 2022-09-28 09:47:09

If the delay exceeds the server script execution timeout, use the ss.eventQueueScheduled() event to execute the delayed part of the script.

var_dump(value)


Use the method to accept a set of parameters of different types, the information about each of them is displayed in the Info block after the server script execution.

Parameter(s):

NameTypeMandatoryDefault value
valueAnyYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

var_dump()
var_dump({key: 'value'});
//object(Object)#835396 (1) {
// ["key"] =>
// string(5) "value"
//}