Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to MineXpert3 10.1.0

8 Scripting Interface

The interface to scripting has been conceived as a console allowing the user to automate a number of tasks. It is, however, currently in a preliminary development state.

8.1 Starting the Scripting Console Invocation

The scripting console window is easily called by pulling down the Scripting menu item from the MineXpertprogram's Utilitiesmenu, as represented in Figure 8.1, “Starting the scripting console window” .

Starting the scripting console window
Figure 8.1: Starting the scripting console window

8.2 The Scripting Console Window

The scripting console window is described at Figure 8.2, “The Scripting Console Window” .

The Scripting Console Window

The window is divided into three vertical panes. The left hand side pane collects all the program's feedback to the user, so they are informed of any new variable that is created in the JavaScript environment and made available to them. The middle pane has two regions. The upper region will display all the return values after any JavaScript command has been run. The lower region is the actual script input region. The right hand side region contains mainly the history of the commands issued during the previous and current scripting sessions.

Figure 8.2: The Scripting Console Window

8.3 Running Scripts in the Scripting Console

The lower part of the middle panel of the scripting window is a text editor that has syntax colouring for JavaScript code. After having entered the script, hitting Enter while maintaining Ctrl pressed will run the script.

Upon running of the script, the output of the script is printed in the upper part of the same middle panel. Most often the output will be undefined (in grey colour), which is just fine. If the output is some actual value, it will be printed in green. If there was an error, the ouptut will be printed in red.

Note that each time a script is run, it is appended in the right hand side panel of the window, in the the History tab. The coloring of the items added to the History> tab follows the same logic as that described above.

8.4 Loading Script Files in the Scripting Console

It is possible to craft ECMAscript-compliant scripts outside of the JavaScript console window, store them in files and open them for running in the JavaScript console window. To do so, select File Load a JavaScript file in the editor .

Once the script has been inserted into the script editor widget, the user can run it by hitting Enter while maintaining Ctrl pressed.

Print this page