Skip to content

Script Engine

Michael Rätzel edited this page Mar 23, 2016 · 3 revisions

With the integrated script engine, you can create a bot using the C# programming language and execute it right away. You won't have to worry much about syntax even if you are new to C# since the editor helps you with that too, as you will see below.

Features

  • coding tools: the script editor highlights syntax errors as you type and displays a list of commands available in the current context.
  • debugging tools: when running a script, the IDE shows you the currently executed statement at any time and lets you execute the script statement by statement to help you track down problems.

coding tools

recommendations and auto-completions

Press CTRL+SPACE anywhere in the script to display a list of symbols available in the current context. The recommendations not only contain API commands but also variables and functions which have been declared in your own script. Insert the item currently selected in the list into the script by pressing TAB to save keystrokes. You can filter the recommendation list by entering parts of a symbols name or just its uppercase letters.

recommendations

assistance with c# syntax

In case the script contains invalid syntax, the editor will underline the offending portion of the script and display a description of the error in a tooltip. In addition, a list with all C# errors and warnings is displayed in the "static diagnostic" section, each with a link which brings you right to the relevant location.

debugging tools

current statement

The next statement to be executed is highlighted in the editor when the script is running or pausing. The statement is also displayed together with a clickable link in the "current / last run"->"current state" section.

single stepping

when the script is paused you can use the "step" button to let the script execute statement by statement.

breakpoints

Using breakpoints, you can instruct the script engine to pause execution once it reaches a particular statement. This works without modifying the script code and can be done while the script is running or pausing.

To set a breakpoint on a statement, click on the editor margin right of the corresponding line number. A red circle will then appear to indicate that the breakpoint is enabled. Click on a enabled breakpoint to disable it.

When the script is about to execute a statement with breakpoint enabled, it will pause execution and create a log entry for this event.

setting a breakpoint

Home

Forum

Bot Authors

Script Engine

Bot Users

Getting Started

Clone this wiki locally