Skip to content
Garma edited this page Jul 20, 2013 · 23 revisions

Scripting/Server

Script Environment

The script will execute in a global environment, and the return value of the initial execution is the script object.

Some non-standard extensions to JavaScript are present. Since the engine uses an instance of QScriptEngine, Qt's additions are available. If you receive an error, you can get a backtrace using .backtracetext. This is assigned when the exception is thrown and it is a string separated with newlines '\n'.

Script Functions

The script functions are properties of the sys object (with one or two exceptions) and they allow you to interface with the C++ code in a safe way.

List of script functions

Script Events

The script events are called upon the script object. These methods of the script object that are used by the script engine are called "events". Some events may be stopped with sys.stopEvent().

List of script events

Scripting Guide

A basic tutorial on making a simple working script that shows some of the JavaScript concepts at work.

Script Snippets

A list of sample script tips, other than the one in the basic tutorial: