Skip to content

Defscript:preprocessor

shlainn edited this page Sep 14, 2010 · 1 revision

”‘#debug”’

Outputs more information when the script is run.

”‘#onload”’

Opens an onload block. Everything in this block is only executed once the script is loaded. if the script is loaded again, this block will also be executed again.

”‘#/onload”’ or ”‘#endonload”’

Closes an onload block.

”‘#permission=…”’ Sets the permission that is needed to execute this script via an ingame command (“-script…”). (Also check your user permissions).

The permission set here will only be checked at the call; all funcions in the called script will NOT be checked anymore! (-> scripts will be executed with full permission!!)

Has also no effect for scripts executed from the console.

”‘#script=…”’

Starts a new script within a file.

By default, a script is named as its file without the extension. Using #script=… loads the following lines as a new script with the name specified. The lines already loaded before this tag will be finalized and stored.

Note that multiple loading under the same name will ”‘always”’ erase the script previously loaded under that name.

”‘#comments-start”’ or ”‘#cs”’

Starts a comment block. Everything in this block will not be executed.

”‘#comments-end”’ or ”‘#ce”’

Ends a comment block

”‘#linestrip=true/false”’

Activated by default. Used to strip additinal whitespace chars at the end of code lines. This is also required to strip comments that are placed directly after code lines and not in a new line.

”‘#escape-all=true/false”’

When this is turned on, all following lines (until it is turned off again) will be loaded escaped (like ”‘{}”’ in the source will become ”‘{}”’. Useful if many lines in a script should b hooked after another script and must be provided escaped for this.

”‘#tag:…”’

Actually this does nothing, but is the only preload line that is copied into the real script. It will never be executed, but can be used to mark certain regions in the script, which can be used later by a hook script so that it can hook code to a specific script region.

Clone this wiki locally