asrun is a simple command-line tool that supports executing AngelScript files directly in order to perform simple batch tasks. The API provided by the tool allow the script to interact with the system to read and write files, and execute other system commands.
On Windows it can be associated, for example with the file extension .as, to allow scripts to be executed directly from the file browser with a double click. This makes it a handy tool even without a terminal for command-line input.
asrun [-d] <script file> [<args>] -d inform if the script should be runned with debug <script file> is the script file that should be runned <args> zero or more args for the script
These usage instructions are also presented if the tool is executed without any arguments.
As entry point for executing the scripts, asrun looks for one of the functions int main()
or void main()
. If neither of these functions are found an error will be reported.
The scripts can use the full set of the script language and standard library described in the script language section of this manual.
The script file informed as input on the command line may include additional files with the include directive #include "<file name>"
, so that the script files can be better organized and common logic shared between multiple scripts.
To run a script with the debugger, either add the command line argument -d or include #pragma debug
in the script. When this is done, the debugger will show a prompt like this:
Debugging, waiting for commands. Type 'h' for help. [dbg]>
This will then let you set up breakpoints, step through the code, inspect variables, etc. Type h
on the prompt to get the list of commands available.