All scripts have access to the following scripting API functions:
-
print(text) - Print the text to the output window. No return value.
-
send(text) - Send the text to the game. No return value.
Non-regex alias scripts have the following script arguments:
- input - The full command that was input.
Regex alias scripts have the following script arguments:
-
input - The full command that was input.
-
match - The regex match array.
Non-regex trigger scripts have the following script arguments:
- line - The full line that the trigger matched on.
Regex trigger scripts have the following script arguments:
-
line - The full line that the trigger matched on.
-
match - The regex match array.
Trigger pattern (non-regex): An orc is DEAD!!
Trigger value (script):
#!javascript
this.deadOrcs = this.deadOrcs || 0;
this.deadOrcs++;
print("deadOrcs: " + this.deadOrcs);
if (this.deadOrcs < 10) {
send("kill orc");
} else {
send("say Already killed 10 orcs.");
}