<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="napi.xsl"?>
<api>
<!--
    NScrAPI.xml - *NScripter API XML definitions
    Created by "Uncle" Mion Sonozaki
	UncleMion@gmail.com

	Contains content from (Unofficial) NScripter API Reference by senzogawa
	<http://senzogawa.s90.xrea.com/reference/NScrAPI.html>, translated
	from the original Japanese; also contains some previous translation
	material by Seung "gp32" Park.

	Extended to provide API support for ONScripter, ONScripter-EN, and
	PONScripter.
-->
  <title>*NScripter API Reference [compiled by senzogawa, translated/annotated/XML-ized by Mion (incorporates former translation by Seung "gp32" Park)]</title>
  <last-edit-date>20100615</last-edit-date>
  <scr-engines>
    <engine id="N" short="NScr" label="NScripter" href="http://www.nscripter.com/">A game scripting engine</engine>
    <engine id="O" short="ONScr" label="ONScripter" href="http://onscripter.sourceforge.jp/onscripter.html">An open-source NScripter emulator</engine>
    <engine id="E" short="ONScr-EN" label="ONScripter-EN" href="http://onscripter.denpa.mobi">English branch of ONScripter</engine>
    <engine id="P" short="PONS" label="PONScripter" href="http://onscripter.denpa.mobi">Proportional ONScripter: supports Unicode and proportional fonts</engine>
  </scr-engines>
  <cmd-types>
    <cmd-type id="S" title="Reserved Syntax" type="Reserved Syntax">Keywords or labels with predefined functions</cmd-type>
    <cmd-type id="F" title="F Commands" type="Definition Block Only">Commands that may only be used in the definition block</cmd-type>
    <cmd-type id="E" title="E Commands" type="Program Block Only">Commands that may only be used in the program block</cmd-type>
    <cmd-type id="FE" title="F/E Commands" type="Definition/Program Block">Commands that may be used in the program or the definition block</cmd-type>
    <cmd-type id="T" title="Special Text Commands" type="Special Text Command">Special characters that may be used as command substitutes within displayed text blocks</cmd-type>
  </cmd-types>
  <arg-types>
    <arg-type type="NAME">Case-insensitive string of alphanumerics and/or '_'; must begin with an alphabet letter or '_'</arg-type>
    <arg-type type="LABEL">Character string consisting of '*' followed by a NAME</arg-type>
    <arg-type type="NUM">Numeric expression: string(s) of numeric digits possibly connected by any of the operators '+', '-', '*', '/'</arg-type>
    <arg-type type="STR">Character string enclosed by '"'s; (originally) intended for full-width Japanese chars</arg-type>
    <arg-type type="%VAR">Variable that may store numeric values</arg-type>
    <arg-type type="$VAR">Variable that may store character strings</arg-type>
    <arg-type type="COLOR">RGB value: '#' followed by 6 hexadecimal chars</arg-type>
    <arg-type type="EFFECT">Built-in effect number w/duration, or number defined by an earlier "effect" command</arg-type>
    <arg-type type="ENUM">Argument must be one of the comma-separated values within the {}s</arg-type>
    <arg-type type="CONDITION">Expression that returns a true/false value</arg-type>
    <arg-type type="SENTENCE">A single command, or multiple commands separated by ':'</arg-type>
    <arg-type type="''">Surrounds a string literal</arg-type>
    <arg-type type="[]">Surrounds optional argument(s)</arg-type>
    <arg-type type="...">Follows an argument pattern that may be repeated</arg-type>
  </arg-types>
  <numbers>
    <number type="Variable" min="0" max="4095">If 4096 is used, the initial value is undefined.</number>
    <number type="Array" min="0">Unbounded?  This could cause memory issues.</number>
    <number type="Sprite" min="0" max="999">Use of 1000 will cause an error.</number>
    <number type="Enhanced Sprite" min="0" max="255">Use of 512 will cause an error.</number>
    <number type="Effect" min="2" max="255">Use of 256 will cause an error.</number>
    <number type="Button" min="1">Unbounded?  This could cause memory issues.</number>
    <number type="Channel" min="0" max="49">NScr ver2.82+ allows (0-199)</number>
  </numbers>
  <categories>
    <category id="startend">Game Start/End/Quit</category>
    <category id="format">Syntax Markers</category>
    <category id="textwindow">Text Window</category>
    <category id="drawtext">Text Display</category>
    <category id="click">Click Wait</category>
    <category id="cursor">Cursor</category>
    <category id="image">Image Display</category>
    <category id="visualeffect">Visual Effects</category>
    <category id="var_bar">Character/Number/Bar Display</category>
    <category id="sound">Music/SFX Playback</category>
    <category id="movieplay">Movie Playback</category>
    <category id="select">Choices</category>
    <category id="jump">Jumps</category>
    <category id="trap">Click Traps</category>
    <category id="button">Image Buttons</category>
    <category id="wait_timer">Wait/Timer</category>
    <category id="calc">Variable Manipulation/Calculations</category>
    <category id="statement">Conditionals/Loops</category>
    <category id="rclick">Right-Click Functionality</category>
    <category id="lookback">Log Mode</category>
    <category id="kidokuskip">Skip Mode</category>
    <category id="log_global">File Access Logs/Global Variables</category>
    <category id="saveload">Save/Load</category>
    <category id="additional">Miscellaneous</category>
    <category id="specialmode">Special Mode Settings</category>
    <category id="plugin_archive">Plugins/Archives</category>
    <category id="information">Console</category>
    <category id="getinfo">Data Acquisition</category>
    <category id="windowmenu">Window Menubar</category>
    <category id="systemcustomize">System Customization</category>
    <category id="screenshot">Screenshot</category>
    <category id="input">Button Extensions</category>
    <category id="ruby">Ruby Text</category>
    <category id="draw">Demo Draw Commands</category>
    <category id="logcustomize">Log Mode Customization</category>
    <category id="tag">Pretext Tags</category>
    <category id="support">Development Support</category>
    <category id="execute">External Command Execution</category>
    <category id="csvfile">CSV File Manipulation</category>
    <category id="textbutton">Text Buttons</category>
    <category id="sprite_ex">Extended Sprites</category>
    <category id="button_ex">New Button Processing</category>
    <category id="ponscr">PONScripter Commands</category>
  </categories>
  <functions>

    <command name="*define" id="define-label" type="S" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>label denoting the start of the definition block</simple-desc>
      <format>
        <format-string>*define</format-string>
      </format>
      <description>A special label that denotes the start of the definition block.</description>
      <example>
        <comment>A definition block that does nothing</comment>
        <code>*define
game</code>
      </example>
      <related cmd="definereset" />
      <related cmd="game" />
    </command>

    <command name="*start" id="start-label" type="S" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>label denoting the start of the program block</simple-desc>
      <format>
        <format-string>*start</format-string>
      </format>
      <description>This label denotes the start of the program block proper.</description>
      <example>
        <comment>A program block that does nothing</comment>
        <code>*start
end</code>
      </example>
      <related cmd="game" />
    </command>

    <command name="game" type="F" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>end definition block and execute game</simple-desc>
      <format>
        <format-string>game</format-string>
      </format>
      <description>Ends the definition block and begins the game.</description>
      <related cmd="*define" />
      <related cmd="*start" />
    </command>

    <command name="reset" type="E" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>reset game</simple-desc>
      <format>
        <format-string>reset</format-string>
      </format>
      <description>Resets the game and returns to the start of the program block.</description>
      <related cmd="*start" />
    </command>

    <command name="definereset" type="E" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>force total script reset</simple-desc>
      <format>
        <format-string>definereset</format-string>
      </format>
      <description>This is a special reset command that forces reinterpretation of the script starting at <b>*define</b>.</description>
      <related cmd="*define" />
    </command>

    <command name="end" type="FE" category="startend">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>end game and close window</simple-desc>
      <format>
        <format-string>end</format-string>
      </format>
      <description>End the program and close the window.</description>
      <related cmd="game" />
    </command>

    <command name="*" id="asterisk" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>prefix for labels</simple-desc>
      <format>
        <format-string desc="*(label-name)">'*'NAME</format-string>
        <arg type="NAME">Label name</arg>
      </format>
      <description>Creates a label with the given name. You can use statements like <b>goto</b> to jump to this label.<br />
The name may contain numbers (except in the first position), single-byte characters, and underscores, but nothing else.<br />
<br />
<indent /><b>OK:</b><br />
<indent /><indent />*HAJIMARI<br />
<indent /><indent />*Mike_Tom<br />
<indent /><indent />*day01<br />
<br />
<indent /><b>NOT OK:</b><br />
<indent /><indent />*始まり (uses double-byte chars)<br />
<indent /><indent />*Mike&amp;Tom (uses ampersand)<br />
<indent /><indent />*01day (starts with a number)</description>
      <notice>Hyphens aren't allowed; use underscores instead.<br />
Since names are case insensitive, "*HAJIMARI" and "*hajimari" are considered to be the same. (by senzogawa)</notice>
      <example>
        <code>*asterisk</code>
      </example>
      <related cmd="gosub" />
      <related cmd="goto" />
    </command>

    <command name=";" id="semicolon" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>prefix for comments</simple-desc>
      <format>
        <format-string>;</format-string>
      </format>
      <description>A command that starts with ';' is a comment - Nscr will skip these.</description>
      <example>
        <code>defsub abs ; This is just a comment.</code>
      </example>
    </command>

    <command name=":" id="colon" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>write and execute multiple commands on a line</simple-desc>
      <format>
        <format-string desc="(command) : (command)">SENTENCE ':' SENTENCE</format-string>
      </format>
      <description>You can use colons in place of carriage returns to separate out distinct commands.<br />
These are most often used in if statements, e.g.<br />
<b>if CONDITION command1:command2:command3 ...</b></description>
      <example>
        <comment>On a right-click, hide sprites and then enter Log Mode</comment>
        <code>btnwait %0
if %0=-1 allsphide:systemcall lookback</code>
      </example>
    </command>

    <command name="%" id="percentsign" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>prefix for numeric variables</simple-desc>
      <format>
        <format-string desc="%(variable-num)">'%'NUM</format-string>
        <arg type="NUM">Variable number (0 - 4095)</arg>
      </format>
      <description>Numeric variables can range from %0 to %4095 -- 4096 total.<br />
0 to 199 are general variables, while 200 and above are globals.<br />
General variables are reinitialized upon game restart, reset, and such, while global variables retain their values.<br />
In other words, general variables are saved and loaded on savetime and loadtime, but global variables remain constant throughout.<br />
Therefore, it's best to use general variables when doing math, and to use global variables for things like stage-clear flags, etc.<br />
To use global variables, you'll have to specify the command <b>globalon</b> in the definition block.<br />
<br />
The default value of a numeric variable is 0.</description>
      <notice>The starting global variable value can be adjusted with the <b>value</b> directive. (by Mion)</notice>
      <related cmd="dollarsign" />
      <related cmd="globalon" />
      <related cmd="value" />
    </command>

    <command name="$" id="dollarsign" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>prefix for character variables</simple-desc>
      <format>
        <format-string desc="$(variable-num)">'$'NUM</format-string>
        <arg type="NUM">Variable number (0 - 4095)</arg>
      </format>
      <description>Works much as for numeric variables -- like the general vs. global designation -- except for character strings.<br />
The default value for character variables is "".</description>
      <notice>The starting global variable value can be adjusted with the <b>value</b> directive. (by Mion)</notice>
      <related cmd="percentsign" />
      <related cmd="globalon" />
      <related cmd="value" />
    </command>

    <command name="?" id="questionmark" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>prefix for array variables</simple-desc>
      <format>
        <format-string desc="?(array-num)">'?'NUM</format-string>
        <arg type="NUM">Array number (0 - 199)</arg>
      </format>
      <description>An array variable, declared via the <b>dim</b> command.<br />
They may range from ?0 to ?199 -- 200 in total.<br />
Arrays may not be used as global variables.</description>
      <related cmd="dim" />
    </command>

    <command name="~" id="tilde" type="S" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>destination point for jumpf/jumpb</simple-desc>
      <format>
        <format-string>~</format-string>
      </format>
      <description>Tags that are targets for jumpf and jumpb.<br />
Please do not place any display text between a jumpf/jumpb command and a ~.</description>
      <related cmd="jumpb" />
      <related cmd="jumpf" />
    </command>

    <command name="/" id="slash" type="T" category="format">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>ignore linefeed</simple-desc>
      <format>
        <format-string>/</format-string>
      </format>
      <description>If you write a newline directly after this slash, then the newline will be ignored.</description>
      <related cmd="jumpb" />
      <related cmd="jumpf" />
    </command>

    <command name="{}" id="curlybraces" type="T" category="format">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>set variables within a text block</simple-desc>
      <format>
        <format-string desc="{(str-var/num-var), (str/num)[, ...]}">'{'$VAR|%VAR,STR|NUM[,...]'}'</format-string>
        <arg type="VAR">A string or numeric variable</arg>
        <arg type="STR">Provide a string value if VAR was a string variable</arg>
        <arg type="NUM">Provide a numeric value if VAR was a numeric variable</arg>
      </format>
      <description>This allows assigning a value to a variable from within a text block.<br />
To do so, enclose the variable and value within parentheses.<br />
Please note that aliases may not be used - only regular variable numbers, numeric and string values.<br />
If multiple variable/value pairs are provided, as in { Var, Value, Var, Value }, then all the given substitutions will be executed.</description>
      <notice>The substitutions will be available for the next command, but not later within the same text block. (by Mion)</notice>
      <example>
        <comment>Sets %2 to 15 and $3 to 'テキスト' within a text command.</comment>
        <code>mov %2,4 : mov $3,"いない"
;the following text sets values
ここでは %2 $3 、@このように{%2,15,$3,テキスト}。@
ここでは %2 $3。\</code>
      </example>
      <example type="O">
        <comment>Sets %2 to 15 and $3 to 'TEXT' within a text command (using single-byte mode).</comment>
        <code>mov %2,4 : mov $3,`zilch`
;the following text sets values
`Right now we have `%2` $3,@ and want to change`{%2,15,$3,`TEXT`}` values.@
`Now we have `%2` $3.\</code>
      </example>
    </command>

    <command name="setwindow" type="E" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set up text window and character display attributes</simple-desc>
      <format>
        <format-string desc="setwindow (text top-left X), (text top-left Y), (num text columns), (num text lines), (text font-size X), (text font-size Y), (spacing X), (spacing Y), (default text speed), (boldface:0=off/1=on), (drop-shadow:0=off/1=on), (window-color), (window top-left X), (window top-left Y), (window bottom-right X), (window bottom-right Y)">setwindow NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,COLOR,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">X-coordinate of top left for text</arg>
        <arg type="NUM">Y-coordinate of top left for text</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font size X</arg>
        <arg type="NUM">Text font size Y</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Default text speed</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="COLOR">Window color</arg>
        <arg type="NUM">Window top left X-coordinate</arg>
        <arg type="NUM">Window top left Y-coordinate</arg>
        <arg type="NUM">Window bottom right X-coordinate</arg>
        <arg type="NUM">Window bottom right Y-coordinate</arg>
      </format>
      <format>
        <format-string desc="setwindow (text top-left X), (text top-left Y), (num text columns), (num text lines), (text font-size X), (text font-size Y), (spacing X), (spacing Y), (default text speed), (boldface:0=off/1=on), (drop-shadow:0=off/1=on), (image-file), (window top-left X), (window top-left Y)">setwindow NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,STR,NUM,NUM</format-string>
        <arg type="NUM">X-coordinate of top left for text</arg>
        <arg type="NUM">Y-coordinate of top left for text</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font size X</arg>
        <arg type="NUM">Text font size Y</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Default text speed</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="STR">Image file name</arg>
        <arg type="NUM">Window top left X-coordinate</arg>
        <arg type="NUM">Window top left Y-coordinate</arg>
      </format>
      <description>Sets up the text window.<br />
The first form is used when the backdrop for the text window is an alpha-layered solid color.<br />
The second form is used when the backdrop for the text window is a graphic file.<br />
<br />
By default, the text window takes up the full screen and is somewhat translucent, the font is 26x26 pixels, the spacing is 0,2, the top left coordinate is 8,16, there are 23 2-byte columns and 16 lines, boldface and drop shadow enabled, 20 speed, and a translucent color of #999999.</description>
      <example>
        <comment>Text window with default settings</comment>
        <code>setwindow 8,16,20,23,26,26,0,2,20,1,1,#999999,0,0,639,479</code>
      </example>
      <example>
        <comment>Text window with default settings, but using image file "bgi.bmp" as backdrop</comment>
        <code>setwindow 8,16,20,23,26,26,0,2,20,1,1,"bg1.bmp",0,0</code>
      </example>
      <related cmd="setwindow2" />
      <related cmd="setwindow3" />
    </command>

    <command name="setwindow2" type="E" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>modify text window appearance</simple-desc>
      <format>
        <format-string desc="setwindow2 #rrggbb">setwindow2 COLOR</format-string>
        <arg type="COLOR">Window color</arg>
      </format>
      <format>
        <format-string desc="setwindow &quot;window image-file&quot;">setwindow2 STR</format-string>
        <arg type="STR">Image file name</arg>
      </format>
      <description>This modifies the appearance of the text window without deleting either it or the text backlog.<br />
This command can only modify the color or image file that was first specified in setwindow, and none of the other parameters.</description>
      <example>
        <comment>This modifies the text window to use image file "twindow2.bmp" as backdrop.</comment>
        <code>setwindow2 ":c;twindow2.bmp"</code>
      </example>
      <related cmd="setwindow" />
      <related cmd="setwindow3" />
    </command>

    <command name="textoff" type="E" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>hide text window</simple-desc>
      <format>
        <format-string>textoff</format-string>
      </format>
      <description>Hide the text window.</description>
      <related cmd="texton" />
    </command>

    <command name="texton" type="E" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>show text window</simple-desc>
      <format>
        <format-string>texton</format-string>
      </format>
      <description>Unhide/show the text window.</description>
      <related cmd="textoff" />
    </command>

    <command name="windoweffect" type="FE" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify an effect for the text window</simple-desc>
      <format>
        <format-string desc="windoweffect (effect-spec)">windoweffect EFFECT</format-string>
        <arg type="EFFECT">Effect specification</arg>
      </format>
      <description>Sets an effect to use when the text window is hidden or unhidden. The parameters are identical to <b>effect</b>, except that there's no effect number parameter here.</description>
      <example>
        <comment>This sets the window effect to do cross-fade for 1 second.</comment>
        <code>windoweffect 10,1000</code>
      </example>
      <related cmd="effect" />
    </command>

    <command name="erasetextwindow" type="E" category="textwindow">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle text display during effect runtime</simple-desc>
      <format>
        <format-string desc="erasetextwindow (0=off/1=on)">erasetextwindow NUM</format-string>
        <arg type="NUM">Flag (0: leave window as is, 1: remove during effects)</arg>
      </format>
      <description>If 0, the text window stays during effect runtime.<br />
If 1 (this is the default), the text window is hidden during effect runtime.</description>
    </command>

    <command name="btnnowindowerase" type="F" category="textwindow">
      <scr>N</scr>
      <simple-desc>text window won't be removed while buttons are in effect</simple-desc>
      <format>
        <format-string>btnnowindowerase</format-string>
      </format>
      <description>The text window won't be erased when buttons are active.</description>
    </command>

    <command name="noteraseman" version="1.99" type="F" category="textwindow">
      <scr>N</scr>
      <simple-desc>people won't be erased when the text window is removed</simple-desc>
      <format>
        <format-string>noteraseman</format-string>
      </format>
      <description>Standing images will not be erased when the text window is removed.</description>
      <notice>Does this actually do anything? (by Mion)</notice>
      <related cmd="textoff" />
    </command>

    <command name="gettext" type="E" category="textwindow">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the contents of the text window</simple-desc>
      <format>
        <format-string desc="gettext $(result-var)">gettext VAR</format-string>
        <arg type="VAR">String variable to hold text window contents</arg>
      </format>
      <description>Retrieves the text currently displayed in the text window.</description>
      <example>
        <comment>Retrieves the contents of the text window and stores in $0.</comment>
        <code>gettext $0</code>
      </example>
    </command>

    <command name="tateyoko" type="E" category="textwindow">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr>
      <simple-desc>toggle text display during effect runtime</simple-desc>
      <format>
        <format-string desc="tateyoko (0=horiz/1=vert)">tateyoko NUM</format-string>
        <arg type="NUM">Flag (1: vertical text mode, 0: horizontal text mode)</arg>
      </format>
      <description>Toggles vertical text display mode. See sample for details.</description>
      <example>
        <comment>Sets vertical text display mode</comment>
        <code>tateyoko 1</code>
      </example>
    </command>

    <command name="windowchip" type="F" category="textwindow">
      <scr ver="2.25">N</scr><scr ver="20080121">O</scr><scr ver="20080310">E</scr>>
      <simple-desc>show the specified sprite whenever the text window is displayed</simple-desc>
      <format>
        <format-string desc="windowchip (chip sprite-num)">windowchip NUM</format-string>
        <arg type="NUM">Sprite number to show with the text window</arg>
      </format>
      <description>Attaches the given sprite to the text window, so it displays and disappears when the window does.</description>
      <example>
        <comment>Sets Sprite 2 to display with the text window.</comment>
        <code>windowchip 2</code>
      </example>
    </command>

    <command name="setwindow3" type="E" category="textwindow">
      <scr ver="2.30">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>same as <b>setwindow</b>, but doesn't clear Log buffer</simple-desc>
      <format>
        <format-string desc="setwindow3 (text top-left X), (text top-left Y), (num text columns), (num text lines), (text font-size X), (text font-size Y), (spacing X), (spacing Y), (default text speed), (boldface:0=off/1=on), (drop-shadow:0=off/1=on), (window-color), (window top-left X), (window top-left Y), (window bottom-right X), (window bottom-right Y)">setwindow3 NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,COLOR,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">X-coordinate of top left for text</arg>
        <arg type="NUM">Y-coordinate of top left for text</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font size X</arg>
        <arg type="NUM">Text font size Y</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Default text speed</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="COLOR">Window color</arg>
        <arg type="NUM">Window top left X-coordinate</arg>
        <arg type="NUM">Window top left Y-coordinate</arg>
        <arg type="NUM">Window bottom right X-coordinate</arg>
        <arg type="NUM">Window bottom right Y-coordinate</arg>
      </format>
      <format>
        <format-string desc="setwindow3 (text top-left X), (text top-left Y), (num text columns), (num text lines), (text font-size X), (text font-size Y), (spacing X), (spacing Y), (default text speed), (boldface:0=off/1=on), (drop-shadow:0=off/1=on), (image-file), (window top-left X), (window top-left Y)">setwindow3 NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,STR,NUM,NUM</format-string>
        <arg type="NUM">X-coordinate of top left for text</arg>
        <arg type="NUM">Y-coordinate of top left for text</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font size X</arg>
        <arg type="NUM">Text font size Y</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Default text speed</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="STR">Image file name</arg>
        <arg type="NUM">Window top left X-coordinate</arg>
        <arg type="NUM">Window top left Y-coordinate</arg>
      </format>
      <description>This behaves the same as <b>setwindow</b> but without clearing the Log mode buffer.</description>
      <notice>Entering Log Mode may be buggy if the text window isn't set to the same width and height.</notice>
      <example>
        <comment>Sets text window with default settings without clearing log</comment>
        <code>setwindow3 8,16,20,23,26,26,0,2,20,1,1,#999999,0,0,639,479</code>
      </example>
      <example>
        <comment>Sets text window with default settings, but using image file "bgi.bmp" as backdrop, without clearing log</comment>
        <code>setwindow3 8,16,20,23,26,26,0,2,20,1,1,"bg1.bmp",0,0</code>
      </example>
      <related cmd="setwindow" />
      <related cmd="setwindow2" />
    </command>

    <command name="textspeeddefault" type="E" category="textwindow">
      <scr ver="2.47">N</scr><scr>E</scr>
      <simple-desc>change to default text display speed</simple-desc>
      <format>
        <format-string>textspeeddefault</format-string>
      </format>
      <description>Sets text display speed to the default.<br />
Same as <b>!sd</b>, this command is especially meant for use in <b>english</b> mode.</description>
      <related cmd="!sd" />
      <related cmd="english" />
    </command>

    <command name="font" version="2.67" type="E" category="textwindow">
      <scr>N</scr>
      <simple-desc>change the text display font</simple-desc>
      <format>
        <format-string desc="font (font-name)">font STR</format-string>
        <arg type="STR">Font name</arg>
      </format>
      <description>Changes the text display font.<br />
If the text window is already displayed, the new font will only take effect the next time the window is cleared.</description>
      <example>
        <comment>Changes display text font to "ＭＳ 明朝"</comment>
        <code>font "ＭＳ 明朝"</code>
      </example>
    </command>

    <command name="defaultfont" type="F" category="drawtext">
      <scr>N</scr>
      <simple-desc>specify default font</simple-desc>
      <format>
        <format-string desc="defaultfont (font-name)">defaultfont STR</format-string>
        <arg type="STR">Font name</arg>
      </format>
      <description>Defines a default font.<br />
NScripter defaults to MS Gothic if this command is not used.</description>
      <notice>In NScripter, until "envdata" file is erased, changing or adding this command will not affect a game font. (by senzogawa)</notice>
      <notice>ONScripter(-EN) technically allows this command, but doesn't do anything with the given font (using a local "default.ttf" font file instead).<br />
PONScripter sets fonts using <b>pmapfont</b>.<br />
Neither use Windows system fonts, only local font files. (by Mion)</notice>
    </command>

    <command name="!s" id="bang-s" type="T" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set the character display speed</simple-desc>
      <format>
        <format-string desc="!s(speed)">!sNUM</format-string>
        <arg type="NUM">Character display speed (msec)</arg>
      </format>
      <description>Changes the speed of text display (in milliseconds).<br />
The number <b>must</b> be a normal number, not a numeric variable. To use a variable, try the <b>textspeed</b> command instead.</description>
      <related cmd="textspeed" />
    </command>

    <command name="#" id="pound" type="T" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change character color</simple-desc>
      <format>
        <format-string>#rrggbb</format-string>
      </format>
      <description>Changes the color of the text, using HTML hexadecimal color codes (e.g. #000000 for black, #ffffff for white, and #ffffaa for pale yellow).<br />
Please note that it only changes the color of text displayed after this command, and not any of the text that came before.</description>
    </command>

    <command name="textclear" type="E" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>clear displayed text</simple-desc>
      <format>
        <format-string>textclear</format-string>
      </format>
      <description>Remove the contents of the text window, but not the window itself.</description>
    </command>

    <command name="locate" type="E" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change the position of character output within the text window</simple-desc>
      <format>
        <format-string desc="locate (text-pos X), (text-pos Y)">locate NUM,NUM</format-string>
        <arg type="NUM">Horizontal position (in full-width chars)</arg>
        <arg type="NUM">Vertical position (in chars)</arg>
      </format>
      <description>Changes the (absolute) position of text insertion within the text window.<br />
Note that the position values are in text metrics, not pixels.</description>
    </command>

    <command name="puttext" type="E" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>output a short bit of text (like after an <b>if</b> statement)</simple-desc>
      <format>
        <format-string desc="puttext (text-str)">puttext STR</format-string>
        <arg type="STR">Character string to display</arg>
      </format>
      <description>Displays the given character string onscreen. This command is most often used within if statements to display some short indicator; otherwise its efficacy is limited.<br />
When using <b>puttext</b>, you may not use any of the variable designation/value functions (e.g. <b>%</b> or <b>$</b>) with it.</description>
    </command>

    <command name="br" type="E" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>insert a carriage return into the displayed text</simple-desc>
      <format>
        <format-string>br</format-string>
      </format>
      <description>Inserts a linefeed into the text window.<br />
Use this when you want a blank line or something similar.</description>
    </command>

    <command name="textspeed" type="E" category="drawtext">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change text display speed</simple-desc>
      <format>
        <format-string desc="textspeed (speed)">textspeed NUM</format-string>
        <arg type="NUM">Character display speed (msec)</arg>
      </format>
      <description>Changes the text display speed.<br />
This has the same functionality as <b>!s</b>, except that you can specify a variable here.</description>
      <related cmd="!s" />
    </command>

    <command name="shadedistance" type="FE" category="drawtext">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify the text shadow offset</simple-desc>
      <format>
        <format-string desc="shadedistance (x-offset), (y-offset)">shadedistance NUM,NUM</format-string>
        <arg type="NUM">Shadow offset width (pixels)</arg>
        <arg type="NUM">Shadow offset height (pixels)</arg>
      </format>
      <description>Sets the text shadow position.</description>
      <notice>NScr Ver.2.62 added this command to the program block as well.<br />
The shadow position will not return to the default setting even at reset. (by senzogawa)</notice>
      <example>
        <comment>Sets the text shadow offset to 2 pixels right and 3 pixels down</comment>
        <code>shadedistance 2,3</code>
      </example>
    </command>

    <command name="setkinsoku" type="F" category="drawtext">
      <scr ver="2.70">N</scr><scr>E</scr>
      <simple-desc>set forbidden start/end characters for Japanese</simple-desc>
      <format>
        <format-string desc="setkinsoku (forbidden-start-chars), (forbidden-end-chars)">addkinsoku STR,STR</format-string>
        <arg type="STR">String of characters forbidden at line start</arg>
        <arg type="STR">String of characters forbidden at line end</arg>
      </format>
      <description>Much as English has linebreak rules, Japanese defines certain characters as "kinsoku" - forbidden from either starting or ending a line of text (e.g. end/start quotes, parentheses, and other punctuation).<br />
<br />
This command specifies which (fullwidth) text characters will be treated as "kinsoku" for the purposes of text display: the first string contains characters forbidden at the start of a line, while the second string contains characters to be forbidden at the end of a line.<br />
<br />
The default kinsoku characters for NScripter are "」』）］｝、。，．・？！ヽヾゝゞ々ー" (start) and "「『（［｛" (end).</description>
      <related cmd="addkinsoku" />
    </command>

    <command name="addkinsoku" type="F" category="drawtext">
      <scr ver="2.70">N</scr><scr>E</scr>
      <simple-desc>add forbidden start/end characters for Japanese</simple-desc>
      <format>
        <format-string desc="addkinsoku (forbidden-start-chars), (forbidden-end-chars)">addkinsoku STR,STR</format-string>
        <arg type="STR">String of characters forbidden at line start</arg>
        <arg type="STR">String of characters forbidden at line end</arg>
      </format>
      <description>This specifies additional characters to be treated as "kinsoku" - forbidden at line start/end - beyond the default sets of kinsoku characters.<br />
The first string contains characters forbidden at the start of a line, while the second string contains characters to be forbidden at the end of a line.</description>
      <related cmd="setkinsoku" />
    </command>

    <command name="kinsoku" type="E" category="drawtext">
      <scr ver="2.73">N</scr><scr>E</scr>
      <simple-desc>toggle enforcement of forbidden Japanese start/end chars</simple-desc>
      <format>
        <format-string desc="kinsoku {on,off}">kinsoku {on,off}</format-string>
        <arg type="ENUM"><b>on</b>: use kinsoku rules; <b>off</b>: ignore kinsoku rules</arg>
      </format>
      <description><b>kinsoku on</b> causes "kinsoku" (forbidden start/end character) rules to be enforced, while <b>kinsoku off</b> causes those rules to be ignored.</description>
      <notice>This works with both regular text display and the <b>strsp</b> command. (by senzogawa)</notice>
      <related cmd="strsp" />
    </command>

    <command name="english" type="F" category="drawtext">
      <scr ver="2.82">N</scr>
      <simple-desc>use NScripter English mode</simple-desc>
      <format>
        <format-string>english</format-string>
      </format>
      <description>Enables NScripter English mode. Only half-width alphabetical sentences will be displayed correctly.<br />
Please begin text with the ">" character when using this mode.</description>
      <notice>This seems to have been added in the 2007/11/04 release. Note that standard text commands like <b>#rrggbb</b> and <b>!sd</b> do not work in this mode; see the related commands for alternatives. (by senzogawa)</notice>
      <notice>ONScripter may support this somewhat, but considering its existing support for single-byte text, and the fact that NScripter <b>english</b> mode doesn't work with most text commands, why bother using it? (by Mion)</notice>
      <example>
        <comment>Displays the text "Peter Piper picked a peck of pickled peppers;"</comment>
        <code>*define
english
game
*start
>Peter Piper picked a peck of pickled peppers;@
end</code>
      </example>
      <related cmd="textcolor" />
      <related cmd="textspeed" />
      <related cmd="textspeeddefault" />
      <related cmd="delay" />
      <related cmd="wait" />
    </command>

    <command name="textcolor" version="(undoc)" type="E" category="drawtext">
      <scr ver="2.82">N</scr>
      <simple-desc>change the color for text output</simple-desc>
      <format>
        <format-string desc="textcolor #rrggbb">textcolor COLOR</format-string>
        <arg type="COLOR">Color to use for text</arg>
      </format>
      <description>Changes the color of the text, using HTML hexadecimal color codes (e.g. #000000 for black, #ffffff for white, and #ffffaa for pale yellow).<br />
Please note that it only changes the color of text displayed after this command, and not any of the text that came before.</description>
      <notice>This seems to have been added in the 2007/11/04 release. You must use this command to change text color if <b>english</b> mode is enabled. (by senzogawa)</notice>
      <example>
        <comment>Displays the text "blue font" in blue.</comment>
        <code>*define
english
game
*start
textcolor #0000ff
>blue font@
end</code>
      </example>
      <related cmd="english" />
    </command>

    <command name="@" id="atsign" type="T" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter click wait state</simple-desc>
      <format>
        <format-string>@</format-string>
      </format>
      <description>Enters click wait state.</description>
      <related cmd="\" />
    </command>

    <command name="\" id="backslash" type="T" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter new-page wait state</simple-desc>
      <format>
        <format-string>\</format-string>
      </format>
      <description>Enters end-of-page wait state -- any new characters following this symbol on the same line are ignored. Once the player clicks, he is sent to the next page.</description>
      <related cmd="@" />
    </command>

    <command name="clickstr" type="F" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter click wait state upon hitting any of the specified chars</simple-desc>
      <format>
        <format-string desc="clickstr (clickwait-chars), (num lines left for pagewait)">clickstr STR,NUM</format-string>
        <arg type="STR">Clickwait characters</arg>
        <arg type="NUM">Lines left on page to activate pagewait</arg>
      </format>
      <description>This function forces a click wait state when the interpreter encounters one of the characters in the given string.<br />
However, if there happens to be a click wait command directly after that character, or if that character is prefaced by a 1-byte underscore (_), then this forced click wait state will not occur.<br />
The second parameter decides whether this will be a simple click-wait or a new-page wait. If the clickstr char occurs on a line past (max textwindow lines - number), then it will use a new-page wait.<br />
This function is convenient, but be careful -- exceptionally long lines may still overflow the textarea. In such situations, you may want to use a standard new-page wait or some other manual adjustment.<br />
Please note that the character string should only contain double-byte chars.</description>
      <example>
        <comment>Cause a clickwait at characters '」', '。', '！', '？'</comment>
        <code>clickstr "」。！？",2</code>
      </example>
      <related cmd="@" />
      <related cmd="\" />
      <related cmd="_" />
    </command>

    <command name="linepage" type="F" category="click">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>wait for click at the end of a line</simple-desc>
      <format>
        <format-string>linepage</format-string>
      </format>
      <description>Setting this causes new-page clickwaits to occur at the end of each line, even if you do not specify it using '<b>\</b>'.<br />
This means that you never have to manually specify a line/page feed.<br />
Please take care if you decide to use <b>@</b>, <b>\</b>, or <b>clickstr</b> along with this command.</description>
      <related cmd="@" />
      <related cmd="\" />
      <related cmd="clickstr" />
      <related cmd="_" />
    </command>

    <command name="_" id="underscore" type="T" category="click">
      <scr ver="1.98">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>ignore the following click</simple-desc>
      <format>
        <format-string>_</format-string>
      </format>
      <description>If you write a click-wait char (or newline, if <b>linepage</b> is active) immediately after this underscore, then the wait state/page feed is ignored.</description>
      <notice>This command got added to NScr ver1.98, but didn't work properly until ver2.48. (by Mion)</notice>
      <related cmd="@" />
      <related cmd="\" />
      <related cmd="clickstr" />
      <related cmd="linepage" />
    </command>

    <command name="clickvoice" type="F" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play a specified sound when a click occurs</simple-desc>
      <format>
        <format-string desc="clickvoice (clickwait sound-file), (pagewait sound-file)">clickvoice STR,STR</format-string>
        <arg type="STR">Sound for click-wait</arg>
        <arg type="STR">Sound for page-wait</arg>
      </format>
      <description>Specifies sounds to play when a button is clicked during a click wait state. The first string is the name of the WAV file played for a click wait state, while the second string is the WAV file played for a new-page click wait state.</description>
    </command>

    <command name="autoclick" type="E" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>wait for click at the end of a line</simple-desc>
      <format>
        <format-string desc="autoclick (wait-time)">autoclick NUM</format-string>
        <arg type="NUM">Click-wait time (msec)</arg>
      </format>
      <description>If the designated time (in milliseconds) passes during a click wait state, proceed automatically as if the mouse button was clicked. This command is especially useful in engine cutscenes.<br />
If the number specified is 0, then this command will not activate.</description>
    </command>

    <command name="click" type="E" category="click">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter click wait state without displaying the click wait cursor</simple-desc>
      <format>
        <format-string>click</format-string>
      </format>
      <description>Wait for a click.</description>
      <related cmd="lrclick" />
    </command>

    <command name="lrclick" type="E" category="click">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr>
      <simple-desc>wait for either a left or right click</simple-desc>
      <format>
        <format-string>lrclick</format-string>
      </format>
      <description>Waits for either a left or right click.<br />
The type of click of occurred can be retrieved using <b>getret</b>:<br />
<indent />getret %0<br />
This will return 0 for a right-click and 1 for a left-click.</description>
      <related cmd="click" />
      <related cmd="getret" />
    </command>

    <command name="clickskippage" type="F" category="click">
      <scr ver="2.60">N</scr><scr>E</scr>
      <simple-desc>skip to the new page clickwait upon click</simple-desc>
      <format>
        <format-string>clickskippage</format-string>
      </format>
      <description>The script will wait at clickwaits as usual, except that if a click happens while text is being output, then display will jump to the next pagewait (instead of the next clickwait as normal).</description>
    </command>

    <command name="setcursor" type="E" category="cursor">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set graphic file and relative position for click wait cursor</simple-desc>
      <format>
        <format-string desc="setcursor (cursor-num:0=clickwait/1=pagewait), (cursor image-file), (relative X-pos), (relative Y-pos)">setcursor NUM,STR,NUM,NUM</format-string>
        <arg type="NUM">Cursor number (0: click-wait cursor, 1: page-wait cursor)</arg>
        <arg type="STR">Cursor image filename</arg>
        <arg type="NUM">Cursor horizontal displacement (right)</arg>
        <arg type="NUM">Cursor vertical displacement (down)</arg>
      </format>
      <description>Loads and displays a cursor definition file for use during click wait states.<br />
The numbers comprise an (x,y) coordinate positioned relative to the upper left pixel of the next text display character.<br />
<br />
The default settings are:<br />
<indent />setcursor 0,":l/3,160,2;cursor0.bmp",0,0<br />
<indent />setcursor 1,":l/3,160,2;cursor1.bmp",0,0</description>
      <related cmd="abssetcursor" />
    </command>

    <command name="abssetcursor" type="E" category="cursor">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set absolute position and graphic file for click wait cursor</simple-desc>
      <format>
        <format-string desc="abssetcursor (cursor-num:0=clickwait/1=pagewait), (cursor image-file), (absolute X-pos), (absolute Y-pos)">abssetcursor NUM,STR,NUM,NUM</format-string>
        <arg type="NUM">Cursor number (0: click-wait cursor, 1: page-wait cursor)</arg>
        <arg type="STR">Cursor image filename</arg>
        <arg type="NUM">Cursor position X-coordinate</arg>
        <arg type="NUM">Cursor position Y-coordinate</arg>
      </format>
      <description>This works the same as <b>setcursor</b>, but uses absolute onscreen coordinates, not text-relative coordinates.</description>
      <related cmd="setcursor" />
    </command>

    <command name="mousecursor" type="FE" category="cursor">
      <scr>N</scr>
      <simple-desc>specify file for general mouse cursor</simple-desc>
      <format>
        <format-string desc="mousecursor (cursor-file)">mousecursor STR</format-string>
        <arg type="STR">Mouse cursor file</arg>
      </format>
      <description>Loads a Windows mouse cursor definition file (.cur) and utilizes it. </description>
      <notice>Non-recommendation of this command is removed as of ver2.93.</notice>
    </command>

    <command name="mousemode" type="E" category="cursor">
      <scr ver="2.93">N</scr><scr ver="20091122">E</scr>
      <simple-desc>toggle mouse cursor display</simple-desc>
      <format>
        <format-string desc="mousemode (cursor-display-flag)">mousemode NUM</format-string>
        <arg type="NUM">Mouse cursor display flag (0: hidden, 1: displayed)</arg>
      </format>
      <description>Setting <b>mousemode 0</b> hides the mouse cursor, while <b>mousemode 1</b> displays it.</description>
    </command>

    <command name="movemousecursor" type="E" category="cursor">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>move the mouse to a particular position on the screen</simple-desc>
      <format>
        <format-string desc="movemousecursor (dest X-pos), (dest Y-pos)">movemousecursor NUM,NUM</format-string>
        <arg type="NUM">X-coordinate for mouse cursor destination</arg>
        <arg type="NUM">Y-coordinate for mouse cursor destination</arg>
      </format>
      <description>Moves the mouse cursor to an arbitrary position on the screen.</description>
      <example>
        <comment>This moves the mouse to (100,10).</comment>
        <code>movemousecursor 100,10</code>
      </example>
    </command>

    <command name="getnextline" type="E" category="cursor">
      <scr>N</scr><scr ver="20100105">E</scr>
      <simple-desc>get the text window coordinates of the start of the following line</simple-desc>
      <format>
        <format-string desc="getnextline %(next-line X-result), %(next-line Y-result)">getnextline %VAR,%VAR</format-string>
        <arg type="VAR">Numeric variable for the text window X-coordinate of the following line</arg>
        <arg type="VAR">Numeric variable for the text window Y-coordinate of the following line</arg>
      </format>
      <description>Retrieves the position of the start of the following line of text in the text window.</description>
      <example>
        <comment>This puts the X and Y coordinates of the next line in %0 and %1.</comment>
        <code>getnextline %0,%1</code>
      </example>
    </command>

    <command name="transmode" type="F" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change alpha blend transparency mode</simple-desc>
      <format>
        <format-string desc="transmode (transparency-mode)">transmode {leftup,copy,alpha}</format-string>
        <arg type="ENUM">leftup: top-left pixel color, copy: no transparency, alpha: alpha-blend</arg>
      </format>
      <description>Change the default transparency mode. <b>leftup</b> is the default setting.<br />
This essentially makes any image-definition string without a transparency setting use "l" for leftup, "c" for copy, or "a" for alpha; see <b>lsp</b> for more details.</description>
    </command>

    <command name="underline" type="FE" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set ground line for standing images</simple-desc>
      <format>
        <format-string desc="underline (ground Y-pos)">underline NUM</format-string>
        <arg type="NUM">Y-coordinate of ground line</arg>
      </format>
      <description>Specifies the ground line for standing pictures. The default value is 479.</description>
      <notice>This command was allowed in the program block since ver2.92.</notice>
      <related cmd="ld" />
    </command>

    <command name="bgalia" type="F" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set parameters for a nonstandard background</simple-desc>
      <format>
        <format-string desc="bgalia (top-left X-pos), (top-left Y-pos), (width), (height)">bgalia NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Background width</arg>
        <arg type="NUM">Background height</arg>
      </format>
      <description>This command should be used when you wish to create a background of special size or position.<br />
A background pane of dimensions (width, height) is set at absolute screen position (X, Y).</description>
      <related cmd="bg" />
    </command>

    <command name="humanz" type="F" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate overlap priority for sprites and standing images</simple-desc>
      <format>
        <format-string desc="humanz (standing-pic sprite-level)">humanz NUM</format-string>
        <arg type="NUM">Sprite number right above the standing image layer</arg>
      </format>
      <description>Designates the image priority when sprites and standing pictures overlap (the z-order).<br />
The sprite of the given number will be drawn immediately above the standing images.<br />
<br />
The default value is 25.</description>
      <related cmd="ld" />
      <related cmd="windowback" />
    </command>

    <command name="windowback" type="F" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>insert text window at the same overlap level as standing image(s)</simple-desc>
      <format>
        <format-string>windowback</format-string>
      </format>
      <description>Inserts the text window at the same level as standing pictures. Can be used for a 'positional subtitle' effect.</description>
      <notice>The text window is drawn on top of the standing image layer, which is drawn on top of the sprite at <b>humanz</b> level. Meanwhile, sprites with number less than the <b>humanz</b> value will appear on top of the text window. (by senzogawa)</notice>
      <notice>In reality, NScr draws the sprite at <b>humanz</b> level above the text window, which is above the standing image layer.<br />
ONScripter-EN draws the sprite with <b>humanz</b> number between the text window and standing image layers when <b>windowback</b> is in effect; this allows placement of a graphic covering the images but under the text. (by Mion)</notice>
      <related cmd="humanz" />
    </command>

    <command name="bg" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set background image</simple-desc>
      <format>
        <format-string desc="bg (image-file), (effect-spec)">bg STR,EFFECT</format-string>
        <arg type="STR">Image filename</arg>
        <arg type="EFFECT">Effect for displaying background</arg>
      </format>
      <format>
        <format-string desc="bg (color), (effect-spec)">bg COLOR,EFFECT</format-string>
        <arg type="COLOR">#rrggbb color for background</arg>
        <arg type="EFFECT">Effect for displaying background</arg>
      </format>
      <format>
        <format-string desc="bg {black|white}, (effect-spec)">bg {black|white},EFFECT</format-string>
        <arg type="ENUM">Use basic black/white for background</arg>
        <arg type="EFFECT">Effect for displaying background</arg>
      </format>
      <description>Loads the background image, using the given effect and final image/color.</description>
      <related cmd="bgalia" />
      <related cmd="effect" />
    </command>

    <command name="ld" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set standing image</simple-desc>
      <format>
        <format-string desc="ld (standing-pic pos), (image-file), (effect-spec)">ld {l,c,r},STR,EFFECT</format-string>
        <arg type="ENUM">standing pic position (l: left, c: center, r: right)</arg>
        <arg type="STR">Image filename</arg>
        <arg type="EFFECT">Effect for displaying standing picture</arg>
      </format>
      <description>Loads a standing picture. Use l for left, r for right, c for center.<br />
The character string is the image filename; the image tag is automatically generated as well.</description>
      <related cmd="cl" />
      <related cmd="effect" />
      <related cmd="humanz" />
    </command>

    <command name="cl" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>erase specified standing image</simple-desc>
      <format>
        <format-string desc="cl (standing-pic pos), (effect-spec)">cl {l,c,r,a},EFFECT</format-string>
        <arg type="ENUM">standing pic position (l: left, c: center, r: right, a: all)</arg>
        <arg type="EFFECT">Effect for removing standing picture(s)</arg>
      </format>
      <description>Clear a standing image from the current picture.<br />
If you specify 'a', then that will clear all of them.</description>
      <related cmd="effect" />
      <related cmd="ld" />
    </command>

    <command name="tal" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>modify standing image opacity</simple-desc>
      <format>
        <format-string desc="tal (standing-pic pos), (transparency)">tal {l,c,r},NUM,EFFECT</format-string>
        <arg type="ENUM">standing pic position (l: left, c: center, r: right)</arg>
        <arg type="NUM">Opacity value (0 - 255)</arg>
        <arg type="EFFECT">Effect for changing standing picture opacity</arg>
      </format>
      <description>Changes the opacity of the specified standing picture to the given value: 0 is fully transparent, 255 is fully opaque.</description>
      <notice>The official manual omits the effect specification, which causes an error. (by senzogawa via "hau")</notice>
      <related cmd="ld" />
    </command>

    <command name="print" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display images while removing those that should be hidden</simple-desc>
      <format>
        <format-string desc="print (effect-spec)">print EFFECT</format-string>
        <arg type="EFFECT">Display effect</arg>
      </format>
      <description>Draws to the screen utilizing the designated effect.<br />
<br />
You may set the effect to use in one of two ways:<br />
<indent />1) By effect tag<br />
<indent /><indent />0: draws only to memory, not to screen<br />
<indent /><indent />1: instantaneous display<br />
<indent /><indent />&gt;1: the tag of an effect defined by the <b>effect</b> command<br />
<br />
<indent />2) Direct designation<br />
<indent /><indent />2-18: Use the same parameters as used for the <b>effect</b> command<br />
<indent /><indent /><b>99</b>: Use for plugin-based effects. You must provide a plugin specification string of format: "plugin-name/plugin-parameters".<br />
<br />
<br />
The following display commands, like <b>print</b>, take effect specs:<br />
<indent /><b>bg</b> <b>ld</b> <b>cl</b><br />
<br />
All other display-related commands must be followed by <b>print</b> or one of the above commands in order to update the screen display.</description>
      <notice>Plugin-based effect support was added in ver.2.03, and the effect plugin api was extended in ver.2.37. Only NScripter supports plugins.<br />
At present, ONScripter-EN supports the following "plugin-based" wipe effects (originally created by Takashi Toyama), via emulation: "breakup.dll", "cascade.dll", "trvswave.dll", "whirl.dll". (by Mion)</notice>
      <example>
        <comment>Display the background "test.jpg" and the standing picture "testman.jpg" simultaneously, then remove the standing picture using set effect 3.</comment>
        <code>bg "test.jpg",0
ld c,"testman.jpg",1
cl c,3</code>
      </example>
      <example>
        <comment>Display the background "test.jpg" via a one-second crossfade, then display the standing picture "testman.jpg" on the left side via a two-second masked fade using "mask.bmp".</comment>
        <code>bg "test.jpg",10,1000
ld "testman.jpg",15,2000,"mask.bmp"</code>
      </example>
      <example>
        <comment>Display the background "test.jpg" via the plugin-effect "clockwip.dll".</comment>
        <code>bg "test.jpg",99,1000,"clockwip.dll/l"</code>
      </example>
      <related cmd="effect" />
    </command>

    <command name="lsp" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load sprite into memory</simple-desc>
      <format>
        <format-string desc="lsp (sprite-num), (image-str), (top-left X-pos), (top-left Y-pos)[, (opacity)]">lsp NUM,STR,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="STR">Image filename or processing tag</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Opacity value (0 - 255)</arg>
      </format>
      <description>Loads and displays a sprite. Sprite numbers may range from 0 to 999.<br />
The other numbers are, from left to right: x coordinate of upper left pixel, y coordinate of upper left pixel, and optional opacity value (0 for transparent up to 255 for opaque).<br />
The only difference between <b>lsp</b> and <b>lsph</b> is the beginning condition of the sprite - <b>lsp</b> displays the sprite, while <b>lsph</b> keeps the sprite hidden (which may later be displayed with <b>vsp</b>).<br />
<br />
<b>Image processing tag format:</b><br />
<indent />"[:<b>(trans-mode)</b>[/<b>(animation)</b>];](filename)"<br />
<indent /><b>OR</b><br />
<indent />"<b>:s</b>[<b>/(string-params);</b>]<b>(color)</b>[(color)...](text-string)" (added Ver.1.80)<br />
<indent /><b>OR</b><br />
<indent />"[:(trans-mode)[/(animation)];]<b>&gt;(width),(height),(color)</b>[(color)...]" (added Ver.2.93)<br />
<br />
The first format is for processing image files - note that the <b>(filename)</b> by itself is fine for single-cell default transparency images. The possible arguments are:<br />
<indent /><b>(transmode)</b>:<br />
<indent /><indent /><b>l</b> - for 'leftup'; the color of the top-left pixel will be used as the transparent color<br />
<indent /><indent /><b>r</b> - for 'rightup'; the color of the top-right pixel will be used as the transparent color<br />
<indent /><indent /><b>c</b> - for 'copy'; shows the image as-is, no transparency settings<br />
<indent /><indent /><b>a</b> - for 'alphablend'; the right half of the image contains alpha-level data for the left half<br />
<indent /><indent /><b>m(filename)</b> - for 'mask'; uses the given file as alpha-level data for the main image<br />
<br />
<indent />Note that for alpha-levels, black (#000000) = opaque and white (#ffffff) = completely transparent.<br />
<indent />If <b>(transmode)</b> is omitted, it assumes the default transparency setting provided via the <b>transmode</b> command.<br />
<br />
<indent /><b>(animation)</b>: <b>(num-cells)</b>,<b>(delay)</b>,<b>(loop-type)</b><br />
<indent />This optional parameter set tells how to animate a sprite with multiple cells.<br />
<indent />The image gets 'cut' into <b>(num-cells)</b> pieces, going from left to right. If the image contains alpha-level data, then each cell contains its own alpha-data in its right-half.<br />
<indent />The <b>(delay)</b> can either be a single value, telling the number of milliseconds to spend on each cell; or else it can have the format <b>&lt;(cell-1-delay),(cell-2-delay,...(cell-n-delay)&gt;</b>, giving varying delays per cell.<br />
<indent />The <b>(loop-type)</b> is a number telling how to cycle between the cells:<br />
<indent /><indent /><b>0</b> - a repeated cycle (0,1,...n,0,1,...)<br />
<indent /><indent /><b>1</b> - single time through (0,1,...n)<br />
<indent /><indent /><b>2</b> - a 'bouncing' cycle (0,1,...n,n-1,...1,0,1,...)<br />
<indent /><indent /><b>3</b> - no cycle (0); cell number is changed via <b>cell</b> command or sprite control (see <b>spstr</b>)<br />
<br />
The second tag format is for creating string sprites:<br />
<indent />"<b>:s</b>[<b>/(string-params);</b>]<b>(color)</b>[(color)...](text-string)"<br />
Note that at least one color setting (#rrggbb) must be provided with the text. Other arguments are:<br />
<indent /><b>(string-params)</b>: (char-width),(char-height),(X-spacing),<b>(decor)</b><br />
<indent />The character width, height, and spacing are the same kinds of numeric values used for <b>setwindow</b>, for example.<br />
<indent />The <b>(decor)</b> value describes a style for the text:<br />
<indent /><indent /><b>0</b> - standard<br />
<indent /><indent /><b>1</b> - none<br />
<indent /><indent /><b>2</b> - open face<br />
<indent />If <b>(string-params)</b> are omitted, the text uses the sizing, spacing and style set by <b>setwindow</b> or <b>spfont</b>.<br />
<indent />If multiple <b>(color)</b> values are provided, it creates a string sprite with multiple cells - each cell with each different color. This can be useful for making text buttons.<br />
For finer control and/or to make multiple-line string sprites, use the <b>strsp</b> command instead.<br />
<br />
The <b>NEW</b> third format is for creating single-color rectangle sprites:<br />
<indent />"[:(trans-mode)[/(animation)];]<b>&gt;(width),(height),(color)</b>[(color)...]"<br />
The <b>(trans-mode)</b> and <b>(animation)</b> have the same syntax as used in the first tag format. The <b>(width)</b> and <b>(height)</b> provide the width and height of the resulting rectangle.<br />
Note that there must be at least one color value provided; if multiple <b>(color)</b> values are provided, it creates a rectangle sprite with multiple cells - one cell for each different color.</description>
      <example>
        <comment>Loads image "thing1.bmp", using default transparency type.</comment>
        <code>lsp 2,"thing1.bmp",0,0</code>
      </example>
      <example>
        <comment>Loads image "thing1.bmp", using "mask1.bmp" for transparency data.</comment>
        <code>lsp 2,":mmask1.bmp;thing1.bmp",0,0</code>
      </example>
      <example>
        <comment>The default clickwait cursor: 'leftup' transmode, bouncing through 3 cells (0,1,2,1,0,...) with 160ms delay per cell.</comment>
        <code>lsp 0,":l/3,160,2;cursor0.bmp",0,0</code>
      </example>
      <example>
        <comment>The default clickwait cursor, but with 'jerky' animation.</comment>
        <code>lsp 0,":l/3,&lt;160,1000,400&gt;,2;cursor0.bmp",0,0</code>
      </example>
      <example>
        <comment>Creates a 100x50 rectangular sprite with 2 cells (white and gray).</comment>
        <code>lsp 0,":c;&gt;100,50,#FFFFFF#888888",200,200</code>
      </example>
      <related cmd="lsph" />
      <related cmd="strsp" />
      <related cmd="spfont" />
    </command>

    <command name="lsph" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load sprite into memory (hidden)</simple-desc>
      <format>
        <format-string desc="lsph (sprite-num), (image-str), (top-left X-pos), (top-left Y-pos)[, (opacity)]">lsph NUM,STR,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Opacity value (0 - 255)</arg>
      </format>
      <description>Loads a sprite in a hidden state.<br />
The only difference between <b>lsp</b> and <b>lsph</b> is the beginning condition of the sprite - <b>lsp</b> displays the sprite, while <b>lsph</b> keeps the sprite hidden (which may later be displayed with <b>vsp</b>).</description>
      <related cmd="lsp" />
    </command>

    <command name="csp" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>delete sprite from memory</simple-desc>
      <format>
        <format-string desc="csp (sprite-num)">csp NUM</format-string>
        <arg type="NUM">Sprite number (0 - 999), or -1 for all</arg>
      </format>
      <description>Erases the given sprite.<br />
If the given value is -1, it erases all sprites.</description>
    </command>

    <command name="vsp" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle display of a loaded sprite</simple-desc>
      <format>
        <format-string desc="vsp (sprite-num), (visible:0=no/1=yes)">vsp NUM,NUM</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="NUM">visibility flag (0: not visible, 1: visible)</arg>
      </format>
      <description>Toggles display of specified sprite. 0 is off, 1 is on.</description>
    </command>

    <command name="spstr" type="E" category="image">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>execute the given control string for complex-button sprite display</simple-desc>
      <format>
        <format-string desc="spstr (control-str)">spstr STR</format-string>
        <arg type="STR">sprite control string</arg>
      </format>
      <description>You can use this command to manually control sprites using the control string format of the <b>exbtn</b> command.<br />
<br />
Just like with <b>csp</b>, <b>lsp</b> and <b>vsp</b>, you need to call <b>print</b> afterwards to have anything show up on screen.</description>
      <example>
        <comment>Clears Sprite 11, displays cell 2 of Sprite 10, and displays Sprite 9.</comment>
        <code>spstr "C11P10,2P9"</code>
      </example>
    </command>

    <command name="msp" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change sprite position (relative)</simple-desc>
      <format>
        <format-string desc="msp (sprite-num), (X-offset), (Y-offset)[, (opacity-offset)]">msp NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="NUM">X-coordinate offset</arg>
        <arg type="NUM">Y-coordinate offset</arg>
        <arg type="NUM">Opacity offset</arg>
      </format>
      <description>Moves the sprite of the designated number, adjusting the position and opacity relative to their current values.<br />
<br />
Like the <b>tal</b> command, and other sprite system commands, The results of <b>msp</b> will not show up immediately on screen (this is for ease and speed of batch processing).<br />
So before you call any text or image display commands after an <b>msp</b>, please call a <b>print</b> command to update the screen before continuing.</description>
      <related cmd="amsp" />
    </command>

    <command name="amsp" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change sprite position (absolute)</simple-desc>
      <format>
        <format-string desc="amsp (sprite-num), (X-pos), (Y-pos)[, (opacity)]">amsp NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="NUM">X-coordinate</arg>
        <arg type="NUM">Y-coordinate</arg>
        <arg type="NUM">Opacity (0 - 255)</arg>
      </format>
      <description>Similar to <b>msp</b>, but moves the sprite to an absolute instead of relative position.</description>
      <example>
        <comment>This moves Sprite 2 to position (5,2) and gives it an opacity of 100 (out of 255).</comment>
        <code>amsp 2,5,2,100</code>
      </example>
      <related cmd="msp" />
    </command>

    <command name="cell" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>manually designate the cell of a sprite</simple-desc>
      <format>
        <format-string desc="cell (sprite-num), (cell-num)">cell NUM,NUM</format-string>
        <arg type="NUM">Sprite number (0 - 999)</arg>
        <arg type="NUM">Cell number (0 - numcells-1)</arg>
      </format>
      <description>Designate the displayed cell for a sprite. As this is an internal state change only, it is your duty to have it reflected on the screen afterward with a <b>print</b> command or other such method.</description>
    </command>

    <command name="blt" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>blit image onto screen instantaneously</simple-desc>
      <format>
        <format-string desc="blt (onscreen X-pos), (onscreen Y-pos), (onscreen width), (onscreen height), (inbutton X-pos), (inbutton Y-pos), (inbutton width), (inbutton height)">blt NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Onscreen top-left X-coordinate</arg>
        <arg type="NUM">Onscreen top-left Y-coordinate</arg>
        <arg type="NUM">Onscreen width</arg>
        <arg type="NUM">Onscreen height</arg>
        <arg type="NUM">In-buffer top-left X-coordinate</arg>
        <arg type="NUM">In-buffer top-left Y-coordinate</arg>
        <arg type="NUM">In-buffer width</arg>
        <arg type="NUM">In-buffer height</arg>
      </format>
      <description>Use this command if you want to blit images instantaneously on screen (as in AIR's opening engine-driven cutscene, for instance).<br />
This utilizes the button image buffer, so please populate said buffer using <b>btndef</b> beforehand.<br />
In cases where the width of the image button is larger than the width of the screen, the image scales accordingly.<br />
(For instance, if one were to load 4 half-sized images and then use <b>blt</b>, then they would instantly be blitted one after another with no afterimage effects, like a high-speed animation. This effect was used in AIR.)<br />
This command writes directly to the screen, not to the backbuffer. Therefore, after the end of the blitting, the contents of the screen may be uncertain, in which case you should use <b>ofscpy</b> (to save the old state) followed by <b>bg</b> (to load a new background).<br />
<br />
Even if one saves in the midst of this blitting, the images will not be screenshotted for the save caption.<br />
Therefore, please limit your usage of this technique (for instance, a demo, or a status screen/save/load menu in an SLG).</description>
      <related cmd="btndef" />
      <related cmd="ofscpy" />
    </command>

    <command name="ofscpy" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>transfer an image drawn by <b>blt</b> to the offscreen buffer</simple-desc>
      <format>
        <format-string>ofscpy</format-string>
      </format>
      <description>Copies things drawn using a <b>blt</b> command to the offscreen buffer.<br />
<b>Explanation:</b><br />
<indent/>Once you have blitted an image onto the screen, and want to use an effect on it, you would use this command to copy it to the offscreen buffer.<br />
<indent/>The offscreen buffer saved by this command may be used in effects, just like any other screen buffer.<br />
<indent/>The image and the effect will display, but they will not be remembered via load/save.<br />
<br />
By using <b>blt</b> and <b>ofscpy</b> together, you can create engine cutscenes and such (like those found in AIR).</description>
      <example>
        <code>btndef "～"
;read animation images

bg ～
ld c,～
;all commands up until this point have been standard image commands, so they will show fine.

resettimer
blt ～
waittimer 100
blt ～
waittimer 100
;in this fashion we display images one after the other for an engine cutscene.

;now that we've blitted a bunch of stuff, to use effects on the image, we need to copy it to the offscreen buffer.
ofscpy
bg ～

;and now you can do anything you want to either the onscreen or the offscreen buffer.
bg ～
ld c,～</code>
      </example>
      <related cmd="blt" />
    </command>

    <command name="repaint" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>redraw screen</simple-desc>
      <format>
        <format-string>repaint</format-string>
      </format>
      <description>Repaints the screen. Call this command if you start getting strange artifacting and such onscreen.</description>
    </command>

    <command name="allsphide" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>hide all sprites at the same time</simple-desc>
      <format>
        <format-string>allsphide</format-string>
      </format>
      <description>Hides all sprites at the same time.</description>
      <related cmd="allspresume" />
    </command>

    <command name="allspresume" type="E" category="image">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>redisplay sprites hidden with <b>allsphide</b></simple-desc>
      <format>
        <format-string>allspresume</format-string>
      </format>
      <description>Redisplays the sprites that were hidden by <b>allsphide</b>.</description>
      <related cmd="allsphide" />
    </command>

    <command name="humanorder" type="E" category="image">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set priority levels for standing image positions</simple-desc>
      <format>
        <format-string desc="humanorder (human-pos-chars), (effect-spec)">humanorder STR,EFFECT</format-string>
        <arg type="STR">Standing image positions in priority order, e.g. "lcr"</arg>
        <arg type="EFFECT">Transition effect to use during image priority change</arg>
      </format>
      <description>Specifies the overlapping priority for standing images.</description>
      <example>
        <comment>Sets the standing picture priorities to display right atop center atop left.</comment>
        <code>humanorder "rcl",1</code>
      </example>
      <related cmd="humanz" />
    </command>

    <command name="humanpos" version="(undoc)" type="FE" category="image">
      <scr ver="2.03">N</scr><scr ver="20091010">E</scr>
      <simple-desc>set coordinates for standing image positions</simple-desc>
      <format>
        <format-string desc="humanpos (left-X-pos), (center-X-pos), (right-X-pos)">humanpos NUM,NUM,NUM</format-string>
        <arg type="NUM">Standard X-coordinate for "l" standing image position</arg>
        <arg type="NUM">Standard X-coordinate for "c" standing image position</arg>
        <arg type="NUM">Standard X-coordinate for "r" standing image position</arg>
      </format>
      <description>Specifies the standard x-coordinates for standing image positions "l", "c", and "r".<br />
The center vertical axis of a standing image will be matched to the coordinates given by this command.<br />
The default values are 160, 320, and 480.</description>
      <notice>This command was allowed in the program block since ver2.92.</notice>
      <related cmd="ld" />
    </command>

    <command name="bgcopy" type="E" category="image">
      <scr ver="2.50">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>copy current screen to the background</simple-desc>
      <format>
        <format-string>bgcopy</format-string>
      </format>
      <description>The same as <b>bgcpy</b>; the current screen gets copied to the background screen.<br />
The text window, etc. can be displayed on top of this.</description>
      <notice>Since ver2.51, NScr has been able to properly save the background created by this command.</notice>
      <related cmd="draw" />
    </command>

    <command name="getspsize" type="E" category="image">
      <scr ver="2.53">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>return the sprite's size</simple-desc>
      <format>
        <format-string desc="getspsize (sprite-num), (width-var), (height-var)[, (cell-var)]">getspsize NUM,%VAR,%VAR[,%VAR]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="VAR">Result numeric variable for sprite width</arg>
        <arg type="VAR">Result numeric variable for sprite height</arg>
        <arg type="VAR">Optional result numeric variable for sprite cell</arg>
      </format>
      <description>Retrieves the size of the given sprite.<br />
This will also return the sprite cell number if the optional variable is provided.</description>
      <notice>The optional cell variable argument was added in ver2.54.</notice>
      <example>
        <comment>Grabs the size of Sprite 0 and assigns %0 its width, %1 its height, and %2 its current cell.</comment>
        <code>getspsize 0,%0,%1,%2</code>
      </example>
    </command>

    <command name="getspmode" type="E" category="image">
      <scr ver="2.61">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>return whether the given sprite is displayed</simple-desc>
      <format>
        <format-string desc="getspmode (result-var), (sprite-num)">getspmode %VAR,NUM</format-string>
        <arg type="VAR">Result numeric variable</arg>
        <arg type="NUM">Sprite number</arg>
      </format>
      <description>This returns 1 if the given sprite is displayed, 0 if the sprite is hidden.</description>
      <example>
        <comment>Sets %2 to 1 if Sprite 10 is displayed, 0 if it is hidden.</comment>
        <code>getspmode %2,10</code>
      </example>
      <related cmd="lsp" />
      <related cmd="lsph" />
    </command>

    <command name="spfont" version="1.99" type="FE" category="image">
      <scr>N</scr>
      <simple-desc>set the font used for string sprites</simple-desc>
      <format>
        <format-string desc="spfont (font-name), (font-width), (font-height), (spacing-X), (spacing-Y), (boldface:0=off/1=on), (drop-shadow:0=off/1=on)">spfont STR,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="STR">Font name</arg>
        <arg type="NUM">(Full-width) text font width</arg>
        <arg type="NUM">Text font height</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
      </format>
      <format>
        <format-string desc="spfont clear">spfont clear</format-string>
        <arg type="ENUM">clear: use font settings from <b>setwindow</b></arg>
      </format>
      <format>
        <format-string desc="spfont (font-name)">spfont STR</format-string>
        <arg type="STR">Font name</arg>
      </format>
      <description>This sets the font to use for string sprites, e.g. ":s;名".<br />
<b>spfont clear</b> reverts to using the font settings from <b>setwindow</b>.<br />
<br />
It's also possible to omit all but the first argument: <b>spfont</b> (font-name)<br />
Doing so will have string sprites use the given font face but all other settings will come from <b>setwindow</b>.</description>
      <notice>This command was allowed in the program block since ver2.62.<br />
Ver2.66 corrected bugs with using <b>spfont</b> and <b>setwindow</b> settings.<br />
The "clear" option was added in ver2.67.</notice>
      <example>
        <comment>Change the string sprite font to (JP) MS Gothic, 16x16, no spacing, bold &amp; drop-shadowed.</comment>
        <code>spfont "ＭＳ ゴシック",16,16,0,0,1,1</code>
      </example>
      <example>
        <comment>Revert to the font settings of <b>setwindow</b> for string sprites.</comment>
        <code>spfont clear</code>
      </example>
      <related cmd="lsp" />
    </command>

    <command name="strsp" type="E" category="image">
      <scr ver="2.62">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create and display a sprite of a multi-line character string</simple-desc>
      <format>
        <format-string desc="strsp (sprite-num), (str), (top-left X-pos), (top-left Y-pos), (num text columns), (num text lines), (char-width), (char-height), (spacing X), (spacing Y), (boldface:0=off/1=on), (drop-shadow:0=off/1=on)[, (color-spec)...]">strsp NUM,STR,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM[,COLOR[,...]]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">String of text to render as a sprite</arg>
        <arg type="NUM">X-coordinate of top left</arg>
        <arg type="NUM">Y-coordinate of top left</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font width</arg>
        <arg type="NUM">Text font height</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="COLOR">Optional color(s)</arg>
      </format>
      <description>This creates a multi-line string sprite, using the font face specified by <b>spfont</b>.<br />
Use "\" to move to the next line. Note that text will run to the end of the available columns and continue onto the next line, without using linebreak or kinsoku conventions, so the "\" are necessary for proper string display.<br />
If optional colors are provided, then the sprite will have a cell for each given color, with the text in that color.</description>
      <notice>This command was originally an alias of <b>logsp2</b>, but was given its own specification in ver2.65.</notice>
      <related cmd="spfont" />
      <related cmd="strsph" />
    </command>

    <command name="strsph" type="E" category="image">
      <scr ver="2.81">N</scr><scr>E</scr>
      <simple-desc>create a sprite of a multi-line character string, hidden</simple-desc>
      <format>
        <format-string desc="strsph (sprite-num), (str), (top-left X-pos), (top-left Y-pos), (num text columns), (num text lines), (char-width), (char-height), (spacing X), (spacing Y), (boldface:0=off/1=on), (drop-shadow:0=off/1=on)[, (color-spec)...]">strsph NUM,STR,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM[,COLOR[,...]]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">String of text to render as a sprite</arg>
        <arg type="NUM">X-coordinate of top left</arg>
        <arg type="NUM">Y-coordinate of top left</arg>
        <arg type="NUM">Number of (full-width) text columns</arg>
        <arg type="NUM">Number of text lines</arg>
        <arg type="NUM">(Full-width) text font width</arg>
        <arg type="NUM">Text font height</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="COLOR">Optional color(s)</arg>
      </format>
      <description>Works the same as <b>strsp</b>, except that the sprite starts out hidden.</description>
      <related cmd="spfont" />
      <related cmd="strsp" />
    </command>

    <command name="effect" type="F" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate an effect</simple-desc>
      <format>
        <format-string desc="effect (effect-num), (built-in effect-num), (effect duration)[, (mask-file)]">effect NUM,NUM[,NUM[,STR]]</format-string>
        <arg type="NUM">Effect number (2 - 255)</arg>
        <arg type="NUM">Built-in effect number (1 - 18,)</arg>
        <arg type="NUM">Duration (msec)</arg>
        <arg type="STR">Mask filename</arg>
      </format>
      <description>Build an Effect Number from a built-in effect.<br />
Once you have an Effect Number assigned, you can use it in image display commands.<br />
From left to right, the variables are: effect number, built-in effect index, effect runtime (in milliseconds), and pattern image filename.<br />
For some built-in effects, you may omit the last two variables.<br />
<br />
Effect 0 is reserved for storing image changes to be displayed at the next image display command, so please number your effects starting at 1.<br />
When you use Effect 0, please remember to call an image display command as soon as possible afterwards.<br />
<br />
By default, built-in effect 1 is not an effect at all - it sets the effect runtime to 0 for instantaneous display.<br />
<br />
<b>Built-in effect index:</b>
<br />
<indent />1. Instantaneous display. No runtime variable needed.<br />
<indent />2. Left-sided shutter<br />
<indent />3. Right-sided shutter<br />
<indent />4. Upwards shutter<br />
<indent />5. Downwards shutter<br />
<indent />6. Left-moving curtain<br />
<indent />7. Right-moving curtain<br />
<indent />8. Upwards curtain<br />
<indent />9. Downwards curtain<br />
<indent />10. Pixelwise crossfade<br />
<indent />11. Left-moving scroll<br />
<indent />12. Right-moving scroll<br />
<indent />13. Upwards scroll<br />
<indent />14. Downwards scroll<br />
<indent />15. Fade via mask pattern. You must provide a filename pointing to a mask image (of either 256 colors or full color). Within a masked image, the white areas fade slowly, and the black areas fade quickly.<br />
<indent />16. Mosaic out. After this effect is called, the state of the screen will be uncertain (like with Effect 0), so please call a display command, like print, immediately afterwards.<br />
<indent />17. Mosaic in<br />
<indent />18. Crossfade via mask. This works similarly to Effect 15, except it is far more processor intensive, so use it with care.<br />
<br />
<b>Special Plugin Effects:</b> (added NScr ver2.03)<br />
<indent />99. This "built-in effect" is a placeholder for plugin-provided effects, but cannot be used to define an Effect Number using <b>effect</b> (in Nscripter). It may be used anywhere else an effect specification is allowed. See <b>print</b> for more details.</description>
      <example>
        <comment>Sets Effect 2 to be an upwards shutter of one second.</comment>
        <code>effect 2,4,1000</code>
      </example>
      <example>
        <comment>Sets Effect 3 to be a two second masked fade.</comment>
        <code>effect 3,15,2000,"m3.bmp"</code>
      </example>
      <related cmd="print" />
    </command>

    <command name="effectblank" type="F" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate wait duration after an effect is over</simple-desc>
      <format>
        <format-string desc="effectblank (effect wait-time)">effectblank NUM</format-string>
        <arg type="NUM">Wait time before next command (msec)</arg>
      </format>
      <description>This simply sets (in milliseconds) how long the interpreter should wait after an effect is finished before interpreting the next command.<br />
If the effect was built-in effect 1, then the delay from this command doesn't take place.</description>
    </command>

    <command name="effectcut" type="F" category="visualeffect">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle effect runtime during "skip to next choice" mode</simple-desc>
      <format>
        <format-string>effectcut</format-string>
      </format>
      <description>Skip all effects in "skip to next choice" mode.</description>
    </command>

    <command name="effectskip" type="E" category="visualeffect">
      <scr ver="2.92">N</scr><scr>E</scr>
      <simple-desc>specify whether effects can be skipped</simple-desc>
      <format>
        <format-string desc="effectskip (allow-skip-flag)">effectskip NUM</format-string>
        <arg type="NUM">Effect skip flag (0: skip not allowed, 1: skip allowed)</arg>
      </format>
      <description>Specifies whether effects can be skipped if a click occurs during the effect.<br />
The default value is 1 (skip allowed); setting this to 0 means effects cannot be skipped using mouse clicks.</description>
      <example>
        <comment>Allows skipping during an effect with click.</comment>
        <code>effectskip 1</code>
      </example>
      <related cmd="effect" />
      <related cmd="print" />
    </command>

    <command name="quake" type="E" category="visualeffect">
      <scr ver="1.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>cause a shaking screen effect</simple-desc>
      <format>
        <format-string desc="quake (amplitude), (duration)">quake NUM,NUM</format-string>
        <arg type="NUM">Amplitude (pixels)</arg>
        <arg type="NUM">Duration (msec)</arg>
      </format>
      <description>Causes an onscreen random quake effect of the given amplitude and duration. Can be slow on older graphics cards.</description>
      <example>
        <comment>This shakes the screen for 1 second with an 8-pixel amplitude.</comment>
        <code>quake 8,1000</code>
      </example>
      <related cmd="quakex" />
      <related cmd="quakey" />
    </command>

    <command name="quakex" type="E" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>cause a horizontal shaking effect</simple-desc>
      <format>
        <format-string desc="quakex (amplitude), (duration)">quakex NUM,NUM</format-string>
        <arg type="NUM">Amplitude (pixels)</arg>
        <arg type="NUM">Duration (msec)</arg>
      </format>
      <description>Works just like <b>quake</b>, except it only shakes the screen from side-to-side (horizontally).</description>
      <related cmd="quake" />
    </command>

    <command name="quakey" type="E" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>cause a vertical shaking effect</simple-desc>
      <format>
        <format-string desc="quakey (amplitude), (duration)">quakey NUM,NUM</format-string>
        <arg type="NUM">Amplitude (pixels)</arg>
        <arg type="NUM">Duration (msec)</arg>
      </format>
      <description>Works just like <b>quake</b>, except it only shakes the screen up-and-down (vertically).</description>
      <related cmd="quake" />
    </command>

    <command name="monocro" type="E" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>make screen monochrome/color-toned</simple-desc>
      <format>
        <format-string desc="monocro (base-color)">monocro COLOR</format-string>
        <arg type="COLOR">Base color</arg>
      </format>
      <format>
        <format-string desc="monocro off">monocro off</format-string>
      </format>
      <description>Fades the screen to monochrome, using the given color as a base.<br />
The text window and cursor will not follow suit.<br />
Use "off" as the parameter to make the colors return to normal.</description>
    </command>

    <command name="nega" type="E" category="visualeffect">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set negative screen display</simple-desc>
      <format>
        <format-string desc="nega (display-flag)">nega NUM</format-string>
        <arg type="NUM">Display flag (0: off, 1: monochrome-priority, 2: negative-priority)</arg>
      </format>
      <description>If flag is 1 or 2, it causes a negative of the current image.<br />
Use 1 to apply (any) <b>monocro</b> on top of the <b>nega</b>, 2 to apply <b>nega</b> atop the <b>monocro</b> (i.e. 1 applies <b>nega</b> first, 2 applies <b>monocro first</b>).<br />
If 0, the image flips back to positive.<br />
Neither <b>monocro</b> nor <b>nega</b> update the screen themselves, so please call <b>print</b> afterwards.</description>
      <related cmd="monocro" />
    </command>

    <command name="flushout" type="E" category="visualeffect">
      <scr ver="2.48">N</scr><scr ver="20100102">E</scr>
      <simple-desc>execute flushout effect</simple-desc>
      <format>
        <format-string desc="flushout (duration)">flushout NUM</format-string>
        <arg type="NUM">Duration (msec)</arg>
      </format>
      <description>Special effect; may be graphic-intensive.<br />
Ends with a white background, so please load a background in one of the next instructions.</description>
      <related cmd="bg" />
    </command>

    <command name="%" id="percentchar" type="T" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display contents of numeric variable</simple-desc>
      <format>
        <format-string desc="%(var-num)">%NUM</format-string>
        <arg type="NUM">Numeric variable number</arg>
      </format>
      <description>Tag for numeric variables. Use this to access their contents within text.</description>
      <related cmd="dollarchar" />
    </command>

    <command name="$" id="dollarchar" type="T" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display contents of string variable</simple-desc>
      <format>
        <format-string desc="$(var-num)">$NUM</format-string>
        <arg type="NUM">String variable number</arg>
      </format>
      <description>Tag for character string variables. Use this to access their contents within text.</description>
      <related cmd="percentchar" />
    </command>

    <command name="?" id="questionchar" type="T" category="var_bar">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display contents of array variable</simple-desc>
      <format>
        <format-string desc="?(var-num)">?NUM</format-string>
        <arg type="NUM">Array number</arg>
      </format>
      <description>Tag for array variables. Use this to access their contents within text, but note that you must reference exactly one array element within the array range(s) defined by <b>dim</b>.</description>
      <example>
        <comment>An example of array usage in text</comment>
        <code>*define
dim ?0[10][20]
start
;populate ?0[2][5] with value 20.
mov ?0[2][5],20
;used in text
ＶＡＬ＝?0[2][3]@</code>
      </example>
      <example type="O">
        <comment>An example of array usage in single-byte text</comment>
        <code>`Array value = `?0[2][5]`.@</code>
      </example>
      <related cmd="dim" />
      <related cmd="percentchar" />
    </command>

    <command name="bar" type="E" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create and display a (graph) bar</simple-desc>
      <format>
        <format-string desc="bar (bar-num), (current-value), (top-left X-pos), (top-left Y-pos), (width), (height), (max-value), (color)">bar NUM,NUM,NUM,NUM,NUM,NUM,NUM,COLOR</format-string>
        <arg type="NUM">Bar number</arg>
        <arg type="NUM">Bar current value</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Bar width</arg>
        <arg type="NUM">Bar height</arg>
        <arg type="NUM">Bar maximum value</arg>
        <arg type="COLOR">Bar color</arg>
      </format>
      <description>Initializes and displays a (horizontal) bar. The width and height variables denote how large the bar will be when it is at max value. When it is not at max value, the bar will be proportionally smaller, of course. The bar is left-justified. As the bar simply is filled in left-to-right in the designated color, please make sure that the background color for the non-filled in area doesn't match the bar color itself. Finally, if you do not call a print command (or something similar), then of course the bar (or the bar's current status) will not be displayed onscreen.</description>
    </command>

    <command name="barclear" type="E" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>clear bar display</simple-desc>
      <format>
        <format-string>barclear</format-string>
      </format>
      <description>Clears out bars.<br />
You can think of the bars as being like life bars in fighting games, kind of.</description>
      <related cmd="bar" />
    </command>

    <command name="prnum" type="E" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>initialize a numeric label</simple-desc>
      <format>
        <format-string desc="prnum (numeric-label-num), (current-value), (top-left X-pos), (top-left Y-pos), (char-width), (char-height), (color)">prnum NUM,NUM,NUM,NUM,NUM,NUM,COLOR</format-string>
        <arg type="NUM">Numeric label number</arg>
        <arg type="NUM">Current value</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Character width</arg>
        <arg type="NUM">Character height</arg>
        <arg type="COLOR">Label color</arg>
      </format>
      <description>Creates a numeric value label, and then blits its current value in the given position at the given size and color.<br />
A label can take 3 columns, so they can range from 0 to 999 in value.<br />
You need to call a print command or something like it to actually display this onscreen.<br />
<br />
<b>bar</b> and <b>prnum</b> were specifically created for <b>mode_saya</b>, which was in-turn specifically created for the doujin game "Saya ~Labyrinth of Immorality~".<br />
There are plans to replace these commands with something a little bit more generalized and powerful.</description>
      <notice>Deprecated since ver2.93; the behavior of this command is environment-dependent.</notice>
    </command>

    <command name="prnumclear" type="E" category="var_bar">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>clear numeric labels</simple-desc>
      <format>
        <format-string>prnumclear</format-string>
      </format>
      <description>Clears the numeric value labels.</description>
      <related cmd="prnum" />
    </command>

    <command name="cdfadeout" type="F" category="sound">
      <scr>N</scr>
      <simple-desc>specify duration of CD-DA fade-out</simple-desc>
      <format>
        <format-string desc="cdfadeout (duration)">cdfadeout NUM</format-string>
        <arg type="NUM">CD playback fade-out time (msec)</arg>
      </format>
      <description>Designate the fade-out time of CD-DA audio, in milliseconds.</description>
      <notice>Currently, (P)ONScripter <b>cannot</b> support this command, as SDL does not support changing the CD volume. (by Mion)</notice>
    </command>

    <command name="chkcdfile" version="1.99" type="F" category="sound">
      <scr>N</scr>
      <simple-desc>determine if CD drive contains a file called "filename"</simple-desc>
      <format>
        <format-string desc="chkcdfile (filename),(error-msg)">chkcdfile STR,STR</format-string>
        <arg type="STR">File name to check for</arg>
        <arg type="STR">Error message to display</arg>
      </format>
      <description>This checks for the given file on the CD drive.<br />
If it cannot find the file, it displays the given error message in a popup box with buttons "Retry" and "Cancel".</description>
      <example>
        <comment>This checks the CD for "file.dat".</comment>
        <code>chkcdfile "file.dat","CDがありません"</code>
      </example>
      <related cmd="chkcdfile_ex" />
    </command>

    <command name="chkcdfile_ex" version="2.20" type="F" category="sound">
      <scr>N</scr>
      <simple-desc>determine if CD drive contains a file called "filename"</simple-desc>
      <format>
        <format-string desc="chkcdfile_ex %(result-var),(filename)">chkcdfile_ex %VAR,STR</format-string>
        <arg type="VAR">Result numeric variable</arg>
        <arg type="STR">File name to check for</arg>
      </format>
      <description>This checks for the given file on the CD drive.<br />
It sets the result to 1 if it finds the file, 0 otherwise.</description>
      <example>
        <comment>This checks the CD for "file.dat" and assigns the result to %0.</comment>
        <code>chkcdfile_ex %0,"file.dat"</code>
      </example>
      <related cmd="chkcdfile" />
    </command>

    <command name="mp3fadeout" type="FE" category="sound">
      <scr>N</scr><scr ver="20060621">E</scr>
      <simple-desc>specify duration of BGM fade-out</simple-desc>
      <format>
        <format-string desc="mp3fadeout (duration)">mp3fadeout NUM</format-string>
        <arg type="NUM">MP3 playback fade-out time (msec)</arg>
      </format>
      <description>Sets MP3 (BGM) fadeout time in milliseconds. Same as <b>bgmfadeout</b> (added in Ver2.21).</description>
      <notice>In versions of ONScripter-EN before 20090417, <b>mp3fadeout</b> did an immediate fadeout instead of setting the behavior for <b>mp3stop</b>. (by Mion)</notice>
      <related cmd="bgmfadein" />
    </command>

    <command name="play" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play specified CD-DA track or MIDI file in a loop</simple-desc>
      <format>
        <format-string desc="play (MIDI-file/CD-tracknum)">play STR</format-string>
        <arg type="STR">MIDI filename or CD track number label</arg>
      </format>
      <description>Plays a MIDI file or CD audio track.<br />
<br />
If you specify a file name, then the corresponding MIDI file will be played, but if you specify "*(number)", then the appropriate CD track will play.<br />
<br />
<b>play</b> will loop the MIDI file/CD audio; if you want a file/track to play once, use the <b>playonce</b> command.</description>
      <related cmd="playstop" />
    </command>

    <command name="playonce" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play specified CD-DA track or MIDI file only once</simple-desc>
      <format>
        <format-string desc="playonce (MIDI-file/CD-tracknum)">playonce STR</format-string>
        <arg type="STR">MIDI filename or CD track number label</arg>
      </format>
      <description>Plays a MIDI file or CD audio track.<br />
<br />
If you specify a file name, then the corresponding MIDI file will be played, but if you specify "*(number)", then the appropriate CD track will play.<br />
<br />
Use <b>play</b> to loop the MIDI file/CD audio instead of playing just once.</description>
      <related cmd="playstop" />
    </command>

    <command name="playstop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop playback of CD track or MIDI file</simple-desc>
      <format>
        <format-string>playstop</format-string>
      </format>
      <description>Stops MIDI/CD audio playback.</description>
    </command>

    <command name="wave" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play a WAV file only once</simple-desc>
      <format>
        <format-string desc="wave (WAV-file)">wave STR</format-string>
        <arg type="STR">WAV filename</arg>
      </format>
      <description>Plays the specified WAV file.<br />
<b>wave</b> plays it once, while <b>waveloop</b> loops it.</description>
      <related cmd="wavestop" />
    </command>

    <command name="waveloop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>loop WAV file playback</simple-desc>
      <format>
        <format-string desc="waveloop (WAV-file)">waveloop STR</format-string>
        <arg type="STR">WAV filename</arg>
      </format>
      <description>Plays the specified WAV file.<br />
<b>wave</b> plays it once, while <b>waveloop</b> loops it.</description>
      <related cmd="wavestop" />
    </command>

    <command name="wavestop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop WAV file playback</simple-desc>
      <format>
        <format-string>wavestop</format-string>
      </format>
      <description>Stops WAV file playback.</description>
    </command>

    <command name="mp3" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play compressed music file only once</simple-desc>
      <format>
        <format-string desc="mp3 (MP3-file)">mp3 STR</format-string>
        <arg type="STR">MP3 filename</arg>
      </format>
      <description>If mp3dec.dll is used (this functionality is built into ONScripter), you can use this to play an mp3 file. <b>mp3</b> plays the file only once, while <b>mp3loop</b> loops the file. You may issue wave commands while mp3's are playing with no ill effects.</description>
    </command>

    <command name="mp3loop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play compressed music file in a loop</simple-desc>
      <format>
        <format-string desc="mp3loop (MP3-file)">mp3loop STR</format-string>
        <arg type="STR">MP3 filename</arg>
      </format>
      <description>If mp3dec.dll is used (this functionality is built into ONScripter), you can use this to play an mp3 file. <b>mp3</b> plays the file only once, while <b>mp3loop</b> loops the file. You may issue wave commands while mp3's are playing with no ill effects.</description>
    </command>

    <command name="mp3save" type="E" category="sound">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>if game saved during playback, resume playing upon reload</simple-desc>
      <format>
        <format-string>mp3save</format-string>
      </format>
      <description>Just like the <b>mp3</b> command, this plays back an mp3 only once; however, if the player saves during playback, the mp3 will start playing upon reload.</description>
    </command>

    <command name="dsound" type="F" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>declare that you are using DirectSound (unnecessary in latest versions)</simple-desc>
      <format>
        <format-string>dsound</format-string>
      </format>
      <description>You use this in the define block in order to turn on DirectSound. You'll need DirectX 2+ in order to use this command. In the later versions of NScripter (1.97+), it is no longer necessary to set this command. </description>
    </command>

    <command name="dwave" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play WAV file using DirectSound only once</simple-desc>
      <format>
        <format-string desc="dwave (channel-num), (WAV-file)">dwave NUM,STR</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
        <arg type="STR">WAV filename</arg>
      </format>
      <description>Plays a WAV file using DirectSound, using the specified number as the channel number (from 0-49). Different WAV files will be mixed automatically this way as they are encountered. If you wanted all voices to be played in succession (text waits for voice) in Auto Mode, you'd set all voices to channel 0. Only PCM files can be played using this command.<br />
This command is used in the same way as the wave command, with the added advantage of the mixing -- so if you were playing an mp3 as background music, you'd want to use dwave for voices and sound effects.</description>
      <notice>If a WAV file from an NSA archive is played via the <b>wave</b> command, and then an attempt is made to play it with <b>dwave</b> without first using <b>wavestop</b> or <b>stop</b>, this will cause an error (since Ver.2.54). (by senzagawa)</notice>
      <notice>The number of available channels was increased from 50 to 200 (0-199) in NScr ver2.82. (by Mion)</notice>
      <example>
        <comment>This plays "test.wav" in channel 0 just once.</comment>
        <code>dwave 0,"test.wav"</code>
      </example>
      <related cmd="dwavestop" />
    </command>

    <command name="dwaveloop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>loop-play a WAV file using DirectSound</simple-desc>
      <format>
        <format-string desc="dwaveloop (channel-num), (WAV-file)">dwaveloop NUM,STR</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
        <arg type="STR">WAV filename</arg>
      </format>
      <description>The same as <b>dwave</b>, but in this case it loops the WAV file.</description>
      <notice>If a WAV file from an NSA archive is played via the <b>wave</b> command, and then an attempt is made to play it with <b>dwaveloop</b> without first using <b>wavestop</b> or <b>stop</b>, this will cause an error (since Ver.2.54). (by senzagawa)</notice>
      <related cmd="dwavestop" />
    </command>

    <command name="dwavestop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop DirectSound WAV file playback</simple-desc>
      <format>
        <format-string desc="dwavestop (channel-num)">dwavestop NUM</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
      </format>
      <description>Silences that particular channel.</description>
    </command>

    <command name="dwaveload" type="E" category="sound">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load WAV file into memory</simple-desc>
      <format>
        <format-string desc="dwaveloop (channel-num), (WAV-file)">dwaveload NUM,STR</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
        <arg type="STR">WAV filename</arg>
      </format>
      <description>Loads a WAV file into memory for use with the commands <b>dwaveplay</b> and <b>dwaveplayloop</b>.</description>
      <notice>Trying a <b>dwaveplay</b> without first loading will cause an error. (by senzagawa)<br />
Also, this command can't be used with OGG files. (by senzogawa)</notice>
      <example>
        <comment>This loads "test.wav" into channel 0, then plays it just once.</comment>
        <code>dwaveload 0,"test.wav"
dwaveplay 0</code>
      </example>
    </command>

    <command name="dwaveplay" type="E" category="sound">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play a preloaded WAV file only once</simple-desc>
      <format>
        <format-string desc="dwaveplay (channel-num)">dwaveplay NUM</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
      </format>
      <description>Plays the file loaded by <b>dwaveload</b>.</description>
      <notice>Trying a <b>dwaveplay</b> without first loading will cause an error. Also, this command can't be used with OGG files. (by senzogawa)<br />
But it doesn't cause a error (in NScr) if you use ogg.dll. (by senzogawa)<br />
After this instruction, it seems you need to use <b>chvol</b> to change the volume. (by senzogawa)</notice>
      <related cmd="dwaveload" />
    </command>

    <command name="dwaveplayloop" type="E" category="sound">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>loop-play a preloaded WAV file</simple-desc>
      <format>
        <format-string desc="dwaveplayloop (channel-num)">dwaveplayloop NUM</format-string>
        <arg type="NUM">Channel number (0 - 49)</arg>
      </format>
      <description>Loops the WAV file loaded by <b>dwaveload</b>.</description>
      <related cmd="dwaveload" />
    </command>

    <command name="stop" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop all music playback</simple-desc>
      <format>
        <format-string>stop</format-string>
      </format>
      <description>Stop playback of <b>all</b> sound.</description>
      <notice>Here, "all sound" means bgm and wave playback, but not loopbgm or dwave playback. (by Mion)</notice>
    </command>

    <command name="mp3stop" type="E" category="sound">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop playback of compressed music</simple-desc>
      <format>
        <format-string>mp3stop</format-string>
      </format>
      <description>Stops playback of compressed music.</description>
    </command>

    <command name="mp3fadein" type="FE" category="sound">
      <scr ver="2.24">N</scr><scr>E</scr>
      <simple-desc>specify duration of BGM fade-in</simple-desc>
      <format>
        <format-string desc="mp3fadein (duration)">mp3fadein NUM</format-string>
        <arg type="NUM">BGM playback fade-in time (msec)</arg>
      </format>
      <description>The same as <b>bgmfadein</b>.</description>
      <related cmd="bgmfadeout" />
    </command>

    <command name="bgm" type="E" category="sound">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play compressed music file in a loop</simple-desc>
      <format>
        <format-string desc="bgm (music-file)">bgm STR</format-string>
        <arg type="STR">Music filename</arg>
      </format>
      <description>Plays the given compressed music file in a loop. Equivalent to the <b>mp3loop</b> command.</description>
      <example>
        <comment>Plays "bgm01.mp3" in a loop</comment>
        <code>bgm "bgm01.mp3"</code>
      </example>
      <related cmd="bgmonce" />
      <related cmd="bgmvol" />
    </command>

    <command name="bgmonce" type="E" category="sound">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play compressed music file only once</simple-desc>
      <format>
        <format-string desc="bgmonce (music-file)">bgmonce STR</format-string>
        <arg type="STR">Music filename</arg>
      </format>
      <description>Plays the given compressed music file one time through. Equivalent to the <b>mp3</b> command.</description>
      <example>
        <comment>Plays "bgm01.mid" once</comment>
        <code>bgm "bgm01.mid"</code>
      </example>
      <related cmd="bgm" />
      <related cmd="bgmvol" />
    </command>

    <command name="bgmstop" type="E" category="sound">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop playback of compressed music</simple-desc>
      <format>
        <format-string>bgmstop</format-string>
      </format>
      <description>Stops playback of compressed music.</description>
    </command>

    <command name="bgmfadeout" type="FE" category="sound">
      <scr ver="2.21">N</scr><scr>E</scr>
      <simple-desc>specify duration of BGM fade-out</simple-desc>
      <format>
        <format-string desc="bgmfadeout (duration)">bgmfadeout NUM</format-string>
        <arg type="NUM">BGM playback fade-out time (msec)</arg>
      </format>
      <description>Sets BGM fadeout time in milliseconds.</description>
      <related cmd="bgmfadein" />
    </command>

    <command name="bgmfadein" type="FE" category="sound">
      <scr ver="2.24">N</scr><scr>E</scr>
      <simple-desc>specify duration of BGM fade-in</simple-desc>
      <format>
        <format-string desc="bgmfadein (duration)">bgmfadein NUM</format-string>
        <arg type="NUM">BGM playback fade-in time (msec)</arg>
      </format>
      <description>The same as <b>bgmfadeout</b>, except that this is for fadein time.</description>
      <related cmd="bgmfadeout" />
    </command>

    <command name="loopbgm" type="E" category="sound">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play intro, then loop repeatedly</simple-desc>
      <format>
        <format-string desc="loopbgm (intro-file), (looped-file)">loopbgm STR,STR</format-string>
        <arg type="STR">Intro music filename</arg>
        <arg type="STR">Looped music filename</arg>
      </format>
      <description>Plays the first music file, then once it's finished, loops the second file until stopped.</description>
      <example>
        <comment>First plays "bgm_s.wav" then loops "bgm_l.wav" ("bgm_s.wav" -> "bgm_l.wav" -> "bgm_l.wav" -> ...)</comment>
        <code>loopbgm "bgm_s.wav","bgm_l.wav"</code>
      </example>
      <related cmd="loopbgmstop" />
    </command>

    <command name="loopbgmstop" type="E" category="sound">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>stop playback of <b>loopbgm</b></simple-desc>
      <format>
        <format-string>loopbgmstop</format-string>
      </format>
      <description>Stops playback of <b>loopbgm</b> music.</description>
    </command>

    <command name="mp3vol" type="E" category="sound">
      <scr ver="1.98">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change BGM sound volume</simple-desc>
      <format>
        <format-string desc="mp3vol (volume)">mp3vol NUM</format-string>
        <arg type="NUM">Sound volume (0-100)</arg>
      </format>
      <description>Changes the volume of the BGM. This applies to both <b>bgm</b> and <b>mp3</b> commands.</description>
      <notice>Volume changes are not saved, so manage them manually or with variables.<br />
This does not affect the <b>play</b> instruction. (by senzogawa)</notice>
      <example>
        <comment>Sets BGM volume to maximum (100)</comment>
        <code>mp3vol 100</code>
      </example>
      <related cmd="chvol" />
      <related cmd="voicevol" />
      <related cmd="sevol" />
      <related cmd="bgmvol" />
    </command>

    <command name="chvol" type="E" category="sound">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change sound volume of the given <b>dwave</b> channel</simple-desc>
      <format>
        <format-string desc="chvol (channel-num), (volume)">chvol NUM,NUM</format-string>
        <arg type="NUM">DWAVE channel number (0 - 49)</arg>
        <arg type="NUM">Sound volume (0-100)</arg>
      </format>
      <description>Changes the volume of the given DWAVE channel.</description>
      <notice>Channel volume changes are not saved, so manage them manually or with variables.</notice>
      <example>
        <comment>Sets Channel 3 volume to maximum (100)</comment>
        <code>chvol 3,100</code>
      </example>
    </command>

    <command name="voicevol" type="E" category="sound">
      <scr ver="1.98">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change voice sound volume</simple-desc>
      <format>
        <format-string desc="voicevol (volume)">voicevol NUM</format-string>
        <arg type="NUM">Sound volume (0-100)</arg>
      </format>
      <description>Changes the sound volume for voices.</description>
      <notice>Volume changes are not saved, so manage them manually or with variables.</notice>
      <example>
        <comment>Sets voice volume to maximum (100)</comment>
        <code>voicevol 100</code>
      </example>
      <related cmd="chvol" />
      <related cmd="mp3vol" />
      <related cmd="sevol" />
      <related cmd="bgmvol" />
    </command>

    <command name="sevol" type="E" category="sound">
      <scr ver="1.98">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change SFX sound volume</simple-desc>
      <format>
        <format-string desc="sevol (volume)">sevol NUM</format-string>
        <arg type="NUM">Sound volume (0-100)</arg>
      </format>
      <description>Changes the sound volume.</description>
      <notice>Volume changes are not saved, so manage them manually or with variables.</notice>
      <example>
        <comment>Sets sound effect volume to maximum (100)</comment>
        <code>sevol 100</code>
      </example>
      <related cmd="chvol" />
      <related cmd="mp3vol" />
      <related cmd="voicevol" />
      <related cmd="bgmvol" />
    </command>

    <command name="bgmvol" type="E" category="sound">
      <scr ver="2.21">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change BGM sound volume</simple-desc>
      <format>
        <format-string desc="bgmvol (volume)">bgmvol NUM</format-string>
        <arg type="NUM">Sound volume (0-100)</arg>
      </format>
      <description>Changes the volume of the BGM. This applies to both <b>bgm</b> and <b>mp3</b> commands.</description>
      <notice>Volume changes are not saved, so manage them manually or with variables.<br />
This does not affect the <b>play</b> instruction. (by senzogawa)</notice>
      <example>
        <comment>Sets BGM volume to maximum (100)</comment>
        <code>bgmvol 100</code>
      </example>
      <related cmd="chvol" />
      <related cmd="mp3vol" />
      <related cmd="voicevol" />
      <related cmd="sevol" />
    </command>

    <command name="v" type="E" category="sound">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>voice playback, shorthand cmd (<b>wave</b>)</simple-desc>
      <format>
        <format-string desc="v(voice-file num):">'v'NUM':'</format-string>
        <arg type="NUM">Voice file number</arg>
      </format>
      <description>This is a shorthand command for playing voice files.<br />
It is equivalent to <b>wave "voice\(num).wav"</b>.</description>
      <notice>(p)onscr seem to map this command to <b>wave "wav\(num).wav"</b> instead. (by Mion)</notice>
      <example>
        <comment>This plays "voice\0001.wav" via the <b>wave</b> command before outputting text.</comment>
        <code>v0001:「これが０００１番のせりふだよー」</code>
      </example>
      <related cmd="wave" />
      <related cmd="dv" />
    </command>

    <command name="dv" type="E" category="sound">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>voice playback, shorthand cmd (<b>dwave</b>)</simple-desc>
      <format>
        <format-string desc="dv(voice-file num):">'dv'NUM':'</format-string>
        <arg type="NUM">Voice file number</arg>
      </format>
      <description>This is a shorthand command for playing voice files.<br />
It is equivalent to <b>dwave 0,"voice\(num).wav"</b>.</description>
      <example>
        <comment>This plays "voice\0001.wav" via the <b>dwave</b> command on channel 0 before outputting text.</comment>
        <code>dv0001:「これが０００１番のせりふだよー」</code>
      </example>
      <related cmd="dwave" />
      <related cmd="v" />
    </command>

    <command name="mv" type="E" category="sound">
      <scr ver="2.20">N</scr><scr ver="20091122">E</scr>
      <simple-desc>playback an mp3 voice file</simple-desc>
      <format>
        <format-string desc="mv(voice-file num):">'mv'NUM':'</format-string>
        <arg type="NUM">Voice file number</arg>
      </format>
      <description>This is a shorthand command for playing mp3 voice files.<br />
It is equivalent to <b>mp3 "voice\(num).mp3"</b>.</description>
      <example>
        <comment>This plays "voice\0001.mp3" via the <b>mp3</b> command before outputting text.</comment>
        <code>mv0001:「これが０００１番のせりふだよー」</code>
      </example>
    </command>

    <command name="bgmdownmode" type="FE" category="sound">
      <scr ver="2.30">N</scr><scr ver="20091230">E</scr>
      <simple-desc>toggle turning down BGM volume when voices are played</simple-desc>
      <format>
        <format-string desc="bgmdownmode (0=off/1=on)">bgmdownmode NUM</format-string>
        <arg type="NUM">0: off, 1: on</arg>
      </format>
      <description>Sets whether the BGM volume should be lowered while a voice sound is playing.</description>
      <example>
        <comment>Sets to have music volume turned down during voice playback.</comment>
        <code>bgmdownmode 1</code>
      </example>
    </command>

    <command name="avi" type="E" category="movieplay">
      <scr>N</scr>
      <simple-desc>playback an AVI file</simple-desc>
      <format>
        <format-string desc="avi (filename), (interruptible:0=no/1=yes)">avi STR,NUM</format-string>
        <arg type="STR">Movie filename</arg>
        <arg type="NUM">Interrupt flag (0: play whole thing, 1: click-interruptible)</arg>
      </format>
      <description>Plays the designated AVI file. If the number is 1, then if the player clicks in the middle of movie playback, the movie will be cut short. If the number is 0, then the player is forced to watch the movie in its entirety.</description>
    </command>

    <command name="mpegplay" type="E" category="movieplay">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>playback an MPEG movie</simple-desc>
      <format>
        <format-string desc="mpegplay (filename), (interruptible:0=no/1=yes)">mpegplay STR,NUM</format-string>
        <arg type="STR">Movie filename</arg>
        <arg type="NUM">Interrupt flag (0: play whole thing, 1: click-interruptible)</arg>
      </format>
      <description>Plays an MPEG video file. The second parameter can be 0 or 1, and determines whether the player must watch the whole movie (0) or can skip the movie by clicking (1).</description>
      <example>
        <comment>This plays "test.mpeg", click-interruptible.</comment>
        <code>mpegplay "test.mpeg",1</code>
      </example>
    </command>

    <command name="movie" type="E" category="movieplay">
      <scr ver="2.49">N</scr><scr ver="20090116">O</scr><scr ver="20090419">E</scr>
      <simple-desc>play a movie</simple-desc>
      <format>
        <format-string desc="movie (movie-file)[, 'pos', (x1), (y1), (width), (height)][, 'click'][, 'loop'][, 'async']">movie STR[,'pos',NUM,NUM,NUM,NUM][,'click'][,'loop'][,'async']</format-string>
        <arg type="STR">Movie filename</arg>
        <arg type="NUM">Movie window top-left X coordinate</arg>
        <arg type="NUM">Movie window top-left Y coordinate</arg>
        <arg type="NUM">Movie window width</arg>
        <arg type="NUM">Movie window height</arg>
      </format>
      <format>
        <format-string>movie stop</format-string>
      </format>
      <description>This movie playback command is intended to replace <b>mpegplay</b>.<br />
<br />
The following options may be combined:<br />
<indent/><b>movie "filename"</b> ;Plays until completion, can't be interrupted<br />
<indent/><b>movie "filename",pos,10,20,320,240</b> ;Positions the movie within a 320x240 window with top-left at (10,20)<br />
<indent/><b>movie "filename",click</b> ;Movie playback is click-interruptible (not valid in <b>async</b> mode)<br />
<indent/><b>movie "filename",loop</b> ;Plays the movie repeatedly (must be combined with either <b>click</b> or <b>async</b>, otherwise it can't be stopped!)<br />
<indent/><b>movie "filename",async</b> ;Asynchronous playback. The script returns to command interpretation while playback continues. The movie will always be the top layer on-screen, even atop text.<br />
<indent/><b>movie stop</b> ;Use this to stop <b>async</b> movie playback</description>
      <notice>The movie image remains on-screen after playback finishes.<br />
Since the movie is considered invalid data, it's possible to revert to the screen as it was beforehand by using <b>print</b>.</notice>
      <example>
        <comment>This plays "test.mpg" looped, within a 320x240 window at coordinate (10,20), and asynchronously; it then stops playback after a 30 second wait.</comment>
        <code>movie "test.mpg",pos,10,20,320,240,async,loop
wait 30*1000
movie stop</code>
      </example>
      <example>
        <comment>This plays "test.mpg", click-interruptible, then crossfades to the previous screen after playback is complete.</comment>
        <code>movie "test.mpg",click
print 10,1000</code>
      </example>
      <related cmd="mpegplay" />
    </command>

    <command name="selectcolor" type="F" category="select">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate the text colors for choices</simple-desc>
      <format>
        <format-string desc="selectcolor (mouseover-color), (mouseoff-color)">selectcolor COLOR,COLOR</format-string>
        <arg type="COLOR">Mouseover color</arg>
        <arg type="COLOR">Mouseoff color</arg>
      </format>
      <description>Specifies, in order, the mouseover and the mouseoff colors for choice text.</description>
    </command>

    <command name="selectvoice" type="F" category="select">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate sound(s) to play during choice selection</simple-desc>
      <format>
        <format-string desc="selectvoice (choice-entry WAV), (choice-mouseover WAV), (choice-click WAV)">selectvoice STR,STR,STR</format-string>
        <arg type="STR">WAV file that plays at choice dialog entry</arg>
        <arg type="STR">WAV file that plays upon mouseover of a choice</arg>
        <arg type="STR">WAV file that plays when a choice is clicked</arg>
      </format>
      <description>Designate WAV files to play in the choice dialog. From left to right: upon entry into choice dialog, upon mouseover of choice text, and finally upon clicking on a choice text.</description>
    </command>

    <command name="select" type="E" category="select">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a choice</simple-desc>
      <format>
        <format-string desc="select (choice-STR), (label), ... ">select STR,LABEL[,STR,LABEL[,...]]</format-string>
        <arg type="STR">Displayed choice</arg>
        <arg type="LABEL">Choice select destination</arg>
      </format>
      <description>Displays a selection of choices, and then jumps to the label associated with the selected choice.<br />
If the character string is set to "", then that choice will not be displayed.<br />
(This works the same way as <b>selnum</b> and <b>selgosub</b>.)<br />
But be careful, as this command will cause the interpreter to hang if you do not specify even a single choice as a parameter.</description>
    </command>

    <command name="selgosub" type="E" category="select">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a choice that jumps to a subroutine</simple-desc>
      <format>
        <format-string desc="selgosub (choice-STR), (label), ... ">selgosub STR,LABEL[,STR,LABEL[,...]]</format-string>
        <arg type="STR">Displayed choice</arg>
        <arg type="LABEL">Choice select destination</arg>
      </format>
      <description>Works the same as <b>select</b>, except this command jumps to a subroutine, not a generalized label.</description>
      <related cmd="select" />
    </command>

    <command name="selnum" type="E" category="select">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a choice that returns a number based on selection</simple-desc>
      <format>
        <format-string desc="selnum (result-var), (choice-STR), ... ">selnum %VAR,STR[,STR[,...]]</format-string>
        <arg type="VAR">Numeric result variable</arg>
        <arg type="STR">Displayed choice</arg>
      </format>
      <description>Works somewhat like <b>select</b> and <b>selgosub</b>, except that there are no jumps - instead, depending on which character string is clicked, a number (starting at 0, then incrementing by 1 for each string) is loaded into the given numeric variable.</description>
      <notice>Unlike with <b>select</b> and <b>selgosub</b>, a null character string ("") can't be provided as a choice. (by senzogawa)</notice>
      <related cmd="select" />
    </command>

    <command name="goto" type="FE" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to designated label</simple-desc>
      <format>
        <format-string desc="goto (dest-label)">goto LABEL</format-string>
        <arg type="LABEL">Jump destination</arg>
      </format>
      <description>Jump to the given label name. (Can cause spaghetti code.)</description>
    </command>

    <command name="skip" type="FE" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>skip the next n lines of script</simple-desc>
      <format>
        <format-string desc="skip (num-lines)">skip NUM</format-string>
        <arg type="NUM">Number of script lines to skip</arg>
      </format>
      <description>Skips the designated number of lines. Can skip forward (-) or backward (+).</description>
    </command>

    <command name="gosub" type="FE" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>call a subroutine</simple-desc>
      <format>
        <format-string desc="gosub (dest-label)">gosub LABEL</format-string>
        <arg type="LABEL">Jump destination</arg>
      </format>
      <description>Jumps to and begins execution at the given label name.<br />
Jumps back to the command directly after the original <b>gosub</b> when a <b>return</b> command is encountered.</description>
      <related cmd="return" />
    </command>

    <command name="return" type="FE" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>return from a subroutine</simple-desc>
      <format>
        <format-string desc="return (dest-label)">return [LABEL]</format-string>
        <arg type="LABEL">Optional return destination</arg>
      </format>
      <description>Used at the end of a routine called by <b>gosub</b> to return to the next command after the <b>gosub</b> call itself.</description>
      <notice>The optional return destination label was added in Ver.2.67. (by senzogawa)</notice>
      <related cmd="gosub" />
    </command>

    <command name="jumpf" type="E" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump forward to the next ~ symbol</simple-desc>
      <format>
        <format-string>jumpf</format-string>
      </format>
      <description>Jumps to the next appearance of a ~ symbol. Use this when it's bothersome to use a proper label. However, as you can't really do deeply nested control with this kind of command, try not to overuse it.</description>
      <notice>Be careful about "~" chars in comments and such around this command. (by senzogawa)</notice>
      <example>
        <code>jumpf
;I am a line that gets skipped.
~
;I am a line that isn't skipped.</code>
      </example>
    </command>

    <command name="jumpb" type="E" category="jump">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump back to the previous ~ symbol</simple-desc>
      <format>
        <format-string>jumpb</format-string>
      </format>
      <description>Return to the last ~ symbol.</description>
      <notice>Be careful about "~" chars in comments and such around this command. (by senzogawa)</notice>
    </command>

    <command name="tablegoto" type="FE" category="jump">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to a label in the table based on the numeric value</simple-desc>
      <format>
        <format-string desc="tablegoto %(num-var), (*label0)[, (*label1),...]">tablegoto %VAR,LABEL[,LABEL[,...]]</format-string>
        <arg type="VAR">Numeric variable with an index into the jumptable</arg>
        <arg type="LABEL">A jump destination label within the table</arg>
      </format>
      <description>Creates a jump table.<br />
If the variable is set to 0, it jumps to the first label; if 1, the second label; and so forth.</description>
      <example>
        <comment>Jumps to one of *label0 - *label3, depending on the value of %0</comment>
        <code>tablegoto %0,*label0,*label1,*label2,*label3</code>
      </example>
      <related cmd="goto" />
    </command>

    <command name="trap" type="E" category="trap">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to specified label on left click</simple-desc>
      <format>
        <format-string desc="trap (dest-label)">trap LABEL</format-string>
        <arg type="LABEL">Destination for jump upon left-click</arg>
      </format>
      <format>
        <format-string>trap off</format-string>
      </format>
      <description>After this command, a left-click will cause a jump to the specified label.<br />
This trap mode deactivates itself immediately thereafter, or you can deactivate it manually (before the jump happens) by using <b>trap off</b>.</description>
    </command>

    <command name="r_trap" type="E" category="trap">
      <scr ver="2.55">N</scr><scr ver="20091122">E</scr>
      <simple-desc>jump to specified label on right click</simple-desc>
      <format>
        <format-string desc="r_trap (dest-label)">r_trap LABEL</format-string>
        <arg type="LABEL">Destination for jump upon right-click</arg>
      </format>
      <format>
        <format-string>r_trap off</format-string>
      </format>
      <description>After this command, a right-click will cause a jump to the specified label.<br />
This trap mode deactivates itself immediately thereafter, or you can deactivate it manually (before the jump happens) by using <b>r_trap off</b>.<br />
It behaves the same as <b>trap</b> and <b>lr_trap</b>, except that it only activates on right-clicks.</description>
      <notice>This command also reacts to left-clicks since ver2.75. (by senzogawa) -WHY? isn't that what <b>lr_trap</b> is for? (by Mion)</notice>
      <related cmd="trap" />
      <related cmd="lr_trap" />
    </command>

    <command name="lr_trap" type="E" category="trap">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to specified label on left or right click</simple-desc>
      <format>
        <format-string desc="lr_trap (dest-label)">lr_trap LABEL</format-string>
        <arg type="LABEL">Destination for jump upon click</arg>
      </format>
      <format>
        <format-string>lr_trap off</format-string>
      </format>
      <description>Traps left and right clicks (or turns said trap off), directing the interpreter to the given label name.</description>
    </command>

    <command name="trap2" type="E" category="trap">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to label on left click when "skip to next choice" mode is set</simple-desc>
      <format>
        <format-string desc="trap2 (dest-label)">trap2 LABEL</format-string>
        <arg type="LABEL">Destination for jump upon left-click during skip mode</arg>
      </format>
      <format>
        <format-string>trap2 off</format-string>
      </format>
      <description>This is the same as <b>trap</b>, except it is the one that should be used when "skip to next choice" mode is active.</description>
      <related cmd="trap" />
    </command>

    <command name="lr_trap2" type="E" category="trap">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to label on left or right click when "skip to next choice" mode is set</simple-desc>
      <format>
        <format-string desc="lr_trap2 (dest-label)">lr_trap2 LABEL</format-string>
        <arg type="LABEL">Destination for jump upon click during skip mode</arg>
      </format>
      <format>
        <format-string>lr_trap2 off</format-string>
      </format>
      <description>Similar to <b>lr_trap</b>, except this one functions in "skip to next choice" mode.</description>
      <related cmd="lr_trap" />
    </command>

    <command name="btndef" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load image file into button memory buffer</simple-desc>
      <format>
        <format-string desc="btndef (image-file)">btndef STR</format-string>
        <arg type="STR">button image filename</arg>
      </format>
      <format>
        <format-string>btndef clear</format-string>
      </format>
      <description>Sets up an image button. The previously-defined button is cleared.<br />
For an example, see the "btndemo" folder in the NScr SDK.</description>
    </command>

    <command name="btn" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>initialize image as button (method 1)</simple-desc>
      <format>
        <format-string desc="btn (button-num), (top-left X-pos), (top-left Y-pos), (width), (height), (shift X-offset), (shift Y-offset)">btn NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Button number</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Button width</arg>
        <arg type="NUM">Button height</arg>
        <arg type="NUM">X-shift</arg>
        <arg type="NUM">Y-shift</arg>
      </format>
      <description>From left to right, this is: button #, x, y, width, height, x3, y3.<br />
This is the command you use to create and initialize buttons. Button numbers start from 1.<br />
The resultant button starts at position (x,y) and is (width,height) big.<br />
When a mouse cursor comes over the button, it will shift leftward and upward by x3 and y3 pixels, respectively.<br />
Look in the "btndemo" folder of the SDK for an example script.</description>
    </command>

    <command name="btnwait" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display image button and enter a click-wait state (method 1)</simple-desc>
      <format>
        <format-string desc="btnwait (result-var)">btnwait %VAR</format-string>
        <arg type="STR">Numeric result variable</arg>
      </format>
      <description>This serves as a button listener. The result value of the button is returned in the numeric variable.<br />
<br />
<b>Return Values</b>:<br />
<indent />0: no button was clicked<br />
<indent />-1: A right-click occured<br />
<indent />&gt;=1: Number of clicked button<br />
<br />
If btnwait returns a value &lt;=0 (no button clicked), then you can invoke btnwait again to enter the identical button wait state. But if btnwait returns a value &gt;=1 (some button was pressed), then the images will stay, but all button definitions will be cleared (to save memory).<br />
Please consult the "btndemo" folder in the SDK for examples.</description>
    </command>

    <command name="btnwait2" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>display image button and enter a click-wait state (method 2)</simple-desc>
      <format>
        <format-string desc="btnwait2 (result-var)">btnwait2 %VAR</format-string>
        <arg type="VAR">Numeric result variable</arg>
      </format>
      <description>This serves as a button listener. The result value of the button is returned in the numeric variable.<br />
<br />
Unlike <b>btnwait</b>, this command does not clear any button definitions. Therefore, it will keep reading the button graphic files.<br />
Since the buttons remain in memory even after there is no use for them, you should call <b>btndef ""</b> after you're finished using them in order to free up the memory.<br />
<br />
<b>All Possible Return Values for btnwait</b> (most require a separate cmd to activate):<br />
<indent />&gt;=1: Number of clicked button (user-defined via <b>spbtn</b>)<br />
<indent />0: left-click, not on a button<br />
<indent />-1: right-click<br />
<br />
<indent />-2: <b>btntime</b> timeout (without <b>usewheel</b>)<br />
<indent />-2: mouse wheel-up (if <b>usewheel</b>)<br />
<indent />-3: mouse wheel-down (if <b>usewheel</b>)<br />
<indent />-4: btnarea mouse-over (if <b>btnarea</b>)<br />
<indent />-5: <b>btntime</b> timeout (if <b>usewheel</b>)<br />
<br />
<indent />-10: Esc key (if <b>useescspc</b>)<br />
<indent />-11: Spacebar (if <b>useescspc</b>)<br />
<indent />-12: PageUp key (if <b>getpage</b>)<br />
<indent />-13: PageDown key (if <b>getpage</b>)<br />
<indent />-19: Enter key (if <b>getenter</b>)<br />
<indent />-20: Tab key (if <b>gettab</b>)<br />
<indent />-21 to -32: F1 to F12 key (if <b>getfunction</b>)<br />
<indent />-40 to -43: ↑→↓← key (if <b>getcursor</b>)<br />
<indent />-50: Insert key (if <b>getinsert</b>)<br />
<indent />-51 to -53: Z, X, C key (if <b>getzxc</b>)<br />
<indent />-60: Skip Mode turned off (if <b>getskipoff</b>)<br />
<indent />-61: Auto Mode turned off (if <b>getskipoff</b>)<br />
<indent />-70: Mouse middle-button click (if <b>getmclick</b>)</description>
    </command>

    <command name="spbtn" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate a sprite as an image button</simple-desc>
      <format>
        <format-string desc="spbtn (sprite-num), (button-num)">spbtn NUM,NUM</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Button number</arg>
      </format>
      <description>Just like the <b>btn</b> command, except it sets up an image button using a sprite. It uses cell 0 as the graphic for the nonclicked state and cell 1 for the clicked state.<br />
When the button is pressed during a <b>btnwait</b>, it returns the given button number as a value.</description>
    </command>

    <command name="cellcheckspbtn" type="E" category="button">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate a sprite as a button only if the sprite has at least 2 cells</simple-desc>
      <format>
        <format-string desc="cellcheckspbtn (sprite-num), (button-num)">cellcheckspbtn NUM,NUM</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Button number</arg>
      </format>
      <description>Works the same as <b>spbtn</b>, except that it doesn't make buttons from sprites with less than two cells.<br />
This can be used effectively during CG mode.<br />
(In other words, this version of <b>spbtn</b> can be quickly looped over a set of thumbnails that may have single cells.)</description>
      <example>
        <comment>Makes buttons from Sprites 0-9, but only for each sprite with more than one cell</comment>
        <code>for %0=0 to 9
  cellcheckspbtn %0,%0+1
next</code>
      </example>
      <related cmd="spbtn" />
    </command>

    <command name="getbtntimer" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>acquire how much time passed during <b>btnwait</b></simple-desc>
      <format>
        <format-string desc="getbtntimer (result-var)">getbtntimer %VAR</format-string>
        <arg type="VAR">Numeric variable for elapsed time</arg>
      </format>
      <description>Gets the amount of time (in milliseconds) spent in <b>btnwait</b>. You would use this to, say, restart the button timer in its proper place after a pause initiated by the player (by right-clicking, perhaps).</description>
    </command>

    <command name="btntime" type="E" category="button">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set a time limit for image button functionality</simple-desc>
      <format>
        <format-string desc="btntime (time-limit)">btntime NUM</format-string>
        <arg type="NUM">Time limit for button wait (msec)</arg>
      </format>
      <description>This designates a time limit in milliseconds for the next <b>btnwait</b> or <b>btnwait2</b> period. When this command is used and a <b>btnwait</b> is activated, and if nothing happens in the specified time period, then <b>btnwait</b> will return -2.</description>
      <notice>If <b>usewheel</b> is set, then <b>btnwait</b> will return -5 instead of -2 in this case. (by senzogawa)</notice>
    </command>

    <command name="btntime2" type="E" category="button">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>same as <b>btntime</b>, but waits for voice to finish</simple-desc>
      <format>
        <format-string desc="btntime2 (time-limit)">btntime2 NUM</format-string>
        <arg type="NUM">Time limit for button wait (msec)</arg>
      </format>
      <description>This is the same as <b>btntime</b>, except that the timeout will wait for voices to finish.</description>
      <example>
        <comment>Sets so the next <b>btnwait</b> will have a 1 second timeout.</comment>
        <code>btntime2 1000</code>
      </example>
      <related cmd="btntime" />
    </command>

    <command name="exbtn" type="E" category="button">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a complex button</simple-desc>
      <format>
        <format-string desc="exbtn (sprite-num), (button-num), (control-str)">exbtn NUM,NUM,STR</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Button number</arg>
        <arg type="STR">Sprite control string</arg>
      </format>
      <description>This is exactly the same as <b>spbtn</b>, with the addition of a trailing control string.<br />
In short, when the player mouses over a button controlled by <b>exbtn</b>, the button isn't just shifted - control over screen graphics is exerted as per the sprite control string.<br />
<br />
The control string can contain any of the following commands:<br />
<indent />"<b>C</b>(sprite-num)": hides the sprite with the given number.<br />
<indent />"<b>P</b>(sprite-num)": displays the sprite with the given number.<br />
<indent />"<b>P</b>(sprite-num),(cell-num)": displays a particular cell of the given sprite.<br />
<indent />"<b>M</b>(sprite-num),(x),(y)": moves the given sprite to coordinates (x,y).<br />
<indent />"<b>S</b>{channel-num},({sound-file})": plays the given sound file.<br />
<indent /><indent />For example: "S1(beep.wav)" plays "beep.wav" on channel 1.<br />
<br />
You can combine any number of these options in your control string.<br />
<br />
When using composite buttons, there needs to be an assignment for what occurs when the mouse cursor isn't touching any part of the button - set this using <b>exbtn_d</b>.<br />
<br />
Buttons, like any other graphic, can be loaded as image filename character strings or as sprites.</description>
      <example>
        <comment>Clears Sprite 10.</comment>
        <code>spstr "C10"</code>
      </example>
      <example>
        <comment>Clears Sprite 11 and displays Sprite 10.</comment>
        <code>spstr "C11P10"</code>
      </example>
      <example>
        <comment>Clears Sprite 11, displays cell 2 of Sprite 10, and displays Sprite 9.</comment>
        <code>spstr "C11P10,2P9"</code>
      </example>
      <related cmd="exbtn_d" />
    </command>

    <command name="cellcheckexbtn" type="E" category="button">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a complex button only if the sprite has at least 2 cells</simple-desc>
      <format>
        <format-string desc="cellcheckexbtn (sprite-num), (button-num), (control-str)">exbtn NUM,NUM,STR</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Button number</arg>
        <arg type="STR">Sprite control string</arg>
      </format>
      <description>This is the <b>exbtn</b> version of <b>cellcheckspbtn</b>, with the same arguments as <b>exbtn</b>.<br />
It will only generate a complex button for sprites with two or more cells.<br />
Check the Samples and Customization for more information on making complex buttons.</description>
      <example>
        <comment>Creates Button 100 from Sprite 1, which will display Cell 1 of Sprite 1 and Sprite 2 when moused-over - but only if Sprite 1 has at least two cells.</comment>
        <code>cellcheckexbtn 1,100,"P1,1P2"</code>
      </example>
      <related cmd="exbtn" />
      <related cmd="cellcheckspbtn" />
    </command>

    <command name="exbtn_d" type="E" category="button">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify default behavior for when complex buttons are used</simple-desc>
      <format>
        <format-string desc="exbtn_d (control-str)">exbtn_d STR</format-string>
        <arg type="STR">Sprite control string</arg>
      </format>
      <description>Determines the state of the composite button when the mouse cursor is on no part of it. See the documentation for <b>exbtn</b> for the format of the control string.</description>
      <example>
        <comment>When the mouse is off the composite button, this displays Sprite 3, clears Sprites 4 5 &amp; 6, and displays cell 0 of Sprite 7.</comment>
        <code>exbtn_d "P3C4C5C6P7,0"</code>
      </example>
    </command>

    <command name="transbtn" type="E" category="button">
      <scr ver="1.99">N</scr><scr ver="20091122">E</scr>
      <simple-desc>ignore transparent areas when creating a button from an image</simple-desc>
      <format>
        <format-string>transbtn</format-string>
      </format>
      <description>This will prevent transparent areas of a button image from activating the button.<br />
Please use this command after a <b>btndef</b> but before the <b>btnwait</b> command.</description>
      <related cmd="btndef" />
      <related cmd="btnwait" />
    </command>

    <command name="!d" id="bang-d" type="T" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>wait for the specified time</simple-desc>
      <format>
        <format-string desc="!d(wait-time)">!dNUM</format-string>
        <arg type="NUM">Amount of time to wait (msec)</arg>
      </format>
      <description>Waits for the specified number of milliseconds, then continues. This state can be canceled with a click.<br />
The given number must be a normal number, not a variable - if you want to use a variable, please use the <b>delay</b> command.</description>
      <related cmd="delay" />
    </command>

    <command name="!w" id="bang-w" type="T" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>wait for the specified time, ignoring clicks</simple-desc>
      <format>
        <format-string desc="!w(wait-time)">!wNUM</format-string>
        <arg type="NUM">Amount of time to wait (msec)</arg>
      </format>
      <description>Waits for the specified number of milliseconds, then continues. This state cannot be canceled with a click.<br />
The given number must be a normal number, not a variable - if you want to use a variable, please use the <b>wait</b> command.</description>
      <related cmd="wait" />
    </command>

    <command name="delay" type="E" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>cause a time delay (method 1)</simple-desc>
      <format>
        <format-string desc="delay (wait-time)">delay NUM</format-string>
        <arg type="NUM">Amount of time to wait (msec)</arg>
      </format>
      <description>Causes a delay of specified time (in milliseconds) that may be escaped out of by clicking.<br />
This works the same as the special text command '!d', but here you can supply a variable as the argument.</description>
      <related cmd="!d" />
    </command>

    <command name="wait" type="E" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>cause a time delay (method 2)</simple-desc>
      <format>
        <format-string desc="wait (wait-time)">wait NUM</format-string>
        <arg type="NUM">Amount of time to wait (msec)</arg>
      </format>
      <description>Causes a delay of specified time (in milliseconds) that may not be escaped out of by clicking.<br />
This works the same as the special text command '!w', but here you can supply a variable as the argument.</description>
      <related cmd="!w" />
    </command>

    <command name="resettimer" type="E" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>reset the internal timer</simple-desc>
      <format>
        <format-string>resettimer</format-string>
      </format>
      <description>Sets the internal timer back to 0. This timer runs on a millisecond scale.</description>
    </command>

    <command name="waittimer" type="E" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>wait until the internal timer reaches the specified time value</simple-desc>
      <format>
        <format-string desc="waittimer (wait-time)">waittimer NUM</format-string>
        <arg type="NUM">Time-value to wait for on the internal timer (msec)</arg>
      </format>
      <description>Waits until the internal timer has passed the specified time before proceeding.<br />
This command is the single most accurate timing measure in all of NScripter.<br />
The timing intervals of things like image effect runtimes are not nearly this accurate, so be careful when you mix and match timing methods.</description>
      <notice>It may be necessary to do <b>wait 0</b> in cases where sprite animation stalls due a mismatch with the internal timer. (by BBS)</notice>
    </command>

    <command name="gettimer" type="E" category="wait_timer">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the value of the internal timer</simple-desc>
      <format>
        <format-string desc="gettimer (time-result-var)">gettimer %VAR</format-string>
        <arg type="VAR">Current value of the internal timer (msec)</arg>
      </format>
      <description>Retrieves the current state of the internal timer.<br />
This returns a value in milliseconds corresponding to the amount of time that has elapsed since <b>resettimer</b> was last called.</description>
    </command>

    <command name="spwait" version="1.97" type="E" category="wait_timer">
      <scr>N</scr>
      <simple-desc>wait until the designated sprite's animation has ended</simple-desc>
      <format>
        <format-string desc="spwait (sprite-num)">spwait NUM</format-string>
        <arg type="NUM">Sprite number</arg>
      </format>
      <description>Waits for the animation of the given sprite number to be either finished or cut short by the user.</description>
      <example>
        <comment>Waits for the animation of Sprite 0 to finish.</comment>
        <code>spwait 0</code>
      </example>
    </command>

    <command name="stralias" type="F" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create an alias for a filename or character string</simple-desc>
      <format>
        <format-string desc="stralias (name), (str-val)">stralias NAME,STR</format-string>
        <arg type="NAME">Alias name</arg>
        <arg type="STR">String value given by alias</arg>
      </format>
      <description>Makes an alias for the given character string as then given name - in other words, after this declaration, you can refer to that character string using that NAME in all cases.</description>
      <example>
        <comment>Use an alias "man_a0" for the file ":a/10,20,2;man_alpha.bmp".</comment>
        <code>stralias man_a0,":a/10,20,2;man_alpha.bmp"
;Now the following 2 lines are equivalent.
ld c,man_a0,1
ld c,":a/10,20,2;man_alpha.bmp",1</code>
      </example>
    </command>

    <command name="numalias" type="F" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create an alias for a numeric value</simple-desc>
      <format>
        <format-string desc="numalias (name), (num-val)">numalias NAME,NUM</format-string>
        <arg type="NAME">Alias name</arg>
        <arg type="NUM">Numeric value given by alias</arg>
      </format>
      <description>Creates a name that serves as an alias for a numeric value.</description>
      <example>
        <comment>Use an alias "ef_lshutter" for the number 2.</comment>
        <code>numalias ef_lshutter,2
;Now the following 2 lines are equivalent.
bg "test.bmp",ef_lshutter
bg "test.bmp",2</code>
      </example>
      <example>
        <comment>(Advanced) Use a numeric alias for a variable number.</comment>
        <code>numalias akari_love,0
;Now the following 2 lines are equivalent.
add %akari_love,10
add %0,10</code>
      </example>
    </command>

    <command name="intlimit" type="F" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set the allowed range for a numeric variable</simple-desc>
      <format>
        <format-string desc="intlimit (var-num), (min-val), (max-val)">intlimit NUM,NUM,NUM</format-string>
        <arg type="NUM">Numeric variable number</arg>
        <arg type="NUM">Minimum allowed value</arg>
        <arg type="NUM">Maximum allowed value</arg>
      </format>
      <description>Restricts the value of an numerical variable. If it exceeds the set maximum, it becomes reset to the set maximum; if it goes below the set minimum, it resets to the set minimum.<br />
In order, the numbers in the command are: numerical variable number, min value, max value.</description>
      <example>
        <comment>This sets the allowed range for numeric variable 0 to be 10 to 20.</comment>
        <code>intlimit 0,10,20</code>
      </example>
    </command>

    <command name="dim" type="F" category="calc">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>declare an array variable</simple-desc>
      <format>
        <format-string desc="dim ?(array-num)[(dim1-len)][(dim2-len)]...">dim '?'NUM'['NUM']' [ '['NUM']'... ]</format-string>
        <arg type="NUM">Array number (0 - 199)</arg>
        <arg type="NUM">Dimension length (actual # of elements is length+1)</arg>
      </format>
      <description>This defines BASIC-style arrays. For example, "dim ?0[10][20]" makes an array named ?0, with array slots from 0-10, and each slot has subslots from 0-20.<br />
In this fashion, you can use arrayed variables as if they were simple numeric variables.<br />
You can also make your code easier to read by using <b>numalias</b>, as in the second example.</description>
      <notice>Remember, the contents of an array start at 0, so please be careful when allocating them!</notice>
      <example>
        <comment>An example of array usage</comment>
        <code>mov ?0[2][5],20
;populates ?0[2][5] with value 20.
mov %4,?0[3][1]
; populates %4 with the value from ?0[3][1].
ＶＡＬ＝?0[2][3]@
;used in text</code>
      </example>
      <example>
        <comment>Using an alias with an array</comment>
        <code>numalias enemyparam,10
dim ?enemyparam[10]</code>
      </example>
    </command>

    <command name="mov" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load a numeric/string variable with a value</simple-desc>
      <format>
        <format-string desc="mov (num-var), (num-val)">mov %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value</arg>
      </format>
      <format>
        <format-string desc="mov (str-var), (strm-val)">mov $VAR,STR</format-string>
        <arg type="VAR">String variable</arg>
        <arg type="STR">Character string value</arg>
      </format>
      <description>Assigns a variable with a new value.</description>
      <example>
        <comment>Sets numeric variable %3 to 24.</comment>
        <code>mov %3,24</code>
      </example>
      <example>
        <comment>Sets string variable $0 to a filename.</comment>
        <code>mov $0,"myfile.jpg"</code>
      </example>
    </command>

    <command name="mov3" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 3 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov3 (num-var), (num-val), (num-val), (num-val)">mov3 %VAR,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
      </format>
      <description>This command fills 3 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.<br />
<br />
<b>mov4</b>, <b>mov5</b>, <b>mov6</b>, <b>mov7</b>, <b>mov8</b>, <b>mov9</b>, and <b>mov10</b> all follow suit from this.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, and %5 to 6.</comment>
        <code>mov3 %3,2,4,6
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov4" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 4 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov4 (num-var), (num-val), (num-val), (num-val), (num-val)">mov4 %VAR,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
      </format>
      <description>This command fills 4 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov5" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 5 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov5 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val)">mov5 %VAR,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
      </format>
      <description>This command fills 5 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov6" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 6 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov6 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val)">mov6 %VAR,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
        <arg type="NUM">Numeric value #6</arg>
      </format>
      <description>This command fills 6 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10,12
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10
;mov %8,12</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov7" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 7 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov7 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val)">mov7 %VAR,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
        <arg type="NUM">Numeric value #6</arg>
        <arg type="NUM">Numeric value #7</arg>
      </format>
      <description>This command fills 7 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10,12,14
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10
;mov %8,12
;mov %9,14</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov8" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov8" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 8 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov8 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val)">mov8 %VAR,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
        <arg type="NUM">Numeric value #6</arg>
        <arg type="NUM">Numeric value #7</arg>
        <arg type="NUM">Numeric value #8</arg>
      </format>
      <description>This command fills 8 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10,12,14,16
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10
;mov %8,12
;mov %9,14
;mov %10,16</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov9" />
      <related cmd="mov10" />
    </command>

    <command name="mov9" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 9 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov9 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val)">mov9 %VAR,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
        <arg type="NUM">Numeric value #6</arg>
        <arg type="NUM">Numeric value #7</arg>
        <arg type="NUM">Numeric value #8</arg>
        <arg type="NUM">Numeric value #9</arg>
      </format>
      <description>This command fills 9 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10,12,14,16,18
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10
;mov %8,12
;mov %9,14
;mov %10,16
;mov %11,18</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov10" />
    </command>

    <command name="mov10" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load numeric values into 10 consecutive variables</simple-desc>
      <format>
        <format-string desc="mov10 (num-var), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val), (num-val)">mov10 %VAR,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value #1</arg>
        <arg type="NUM">Numeric value #2</arg>
        <arg type="NUM">Numeric value #3</arg>
        <arg type="NUM">Numeric value #4</arg>
        <arg type="NUM">Numeric value #5</arg>
        <arg type="NUM">Numeric value #6</arg>
        <arg type="NUM">Numeric value #7</arg>
        <arg type="NUM">Numeric value #8</arg>
        <arg type="NUM">Numeric value #9</arg>
        <arg type="NUM">Numeric value #10</arg>
      </format>
      <description>This command fills 10 numeric variables - starting from the one specified and incrementing upward - with the specified numbers.</description>
      <notice>This can't be used with string variables. (by senzogawa)</notice>
      <example>
        <comment>Sets %3 to 2, %4 to 4, %5 to 6, and so forth.</comment>
        <code>mov3 %3,2,4,6,8,10,12,14,16,18,20
;is equivalent to
;mov %3,2
;mov %4,4
;mov %5,6
;mov %6,8
;mov %7,10
;mov %8,12
;mov %9,14
;mov %10,16
;mov %11,18
;mov %12,20</code>
      </example>
      <related cmd="mov" />
      <related cmd="mov3" />
      <related cmd="mov4" />
      <related cmd="mov5" />
      <related cmd="mov6" />
      <related cmd="mov7" />
      <related cmd="mov8" />
      <related cmd="mov9" />
    </command>

    <command name="movl" type="FE" category="calc">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load a line of numbers into an array</simple-desc>
      <format>
        <format-string desc="movl (array-var), (num-val),...">movl ARRAY,NUM[,NUM[,...]]</format-string>
        <arg type="ARRAY">Array variable</arg>
        <arg type="NUM">Numeric value</arg>
      </format>
      <description>Enters numbers into an array all at once.</description>
      <example>
        <comment>Define an array ?10 of length 5 and populate it.</comment>
        <code>dim ?10[4]
movl ?10,0,1,2,3,4</code>
      </example>
      <example>
        <comment>Define a two-dimensional array ?20 of size 3x4 and populate it, line by line.</comment>
        <code>dim ?20[2][3]
movl ?20[0],0,1,2,3
movl ?20[1],0,2,4,6
movl ?20[2],0,3,6,9</code>
      </example>
    </command>

    <command name="add" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>add/concatenate to variable</simple-desc>
      <format>
        <format-string desc="add (num-var), (num-val)">add %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value to add</arg>
      </format>
      <format>
        <format-string desc="add (str-var), (str-val)">add $VAR,STR</format-string>
        <arg type="VAR">String variable</arg>
        <arg type="STR">Character string to concatenate</arg>
      </format>
      <description>Add a number to a numeric variable. If used with strings, performs string concatenation instead.</description>
      <example>
        <comment>Replace the value stored at %0 with %0 + 6.</comment>
        <code>add %0,6</code>
      </example>
      <example>
        <comment>Take the string variable $5 and tack "ああああ" to the end.</comment>
        <code>add $5,"ああああ"</code>
      </example>
      <related cmd="sub" />
    </command>

    <command name="+" id="plus-sign" type="FE" category="calc">
      <scr ver="2.10">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>do addition/concatenation</simple-desc>
      <format>
        <format-string desc="(num)+(num)">NUM'+'NUM</format-string>
        <arg type="NUM">Numeric value to add</arg>
        <arg type="NUM">Numeric value to add</arg>
      </format>
      <format>
        <format-string desc="(str)+(str)">STR'+'STR</format-string>
        <arg type="STR">Character string to be augmented</arg>
        <arg type="STR">Character string to concatenate</arg>
      </format>
      <description>Builds an expression, where the second number/string is added/concatenated to the first number/string.<br />
This will cause an error if the arguments are not both strings or both numbers.<br />
The expression result is used as a numeric/string argument for a command.</description>
      <notice>String concatenation with '+' was added in ver2.72.</notice>
      <example>
        <comment>Adds 1 to the value of Array 0 Element 0.</comment>
        <code>mov ?0[0],?0[0]+1</code>
      </example>
      <example>
        <comment>Assigns "●" to $1, then sets $2 to the concatenation of "あいうえお", $1, and "さしすせそ".</comment>
        <code>mov $1,"●"
mov $2,"あいうえお"+$1+"さしすせそ"
;Now $2 contains "あいうえお●さしすせそ".</code>
      </example>
      <example type="O">
        <comment>Assigns "Text" to $0, then concatenates " String" onto it.</comment>
        <code>mov $0,`Text`
mov $0,$0+` String`
;Now $0 contains "Text String".</code>
      </example>
      <related cmd="add" />
    </command>

    <command name="sub" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>subtract a number from a variable</simple-desc>
      <format>
        <format-string desc="sub (num-var), (num-val)">sub %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value to subtract</arg>
      </format>
      <description>Subtract a number from a numeric variable.</description>
      <example>
        <comment>Subtract 6 from %0, then subtract the value of %2.</comment>
        <code>sub %0,6
sub %0,%2</code>
      </example>
      <related cmd="add" />
    </command>

    <command name="-" id="minus-sign" type="FE" category="calc">
      <scr ver="2.10">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>do subtraction</simple-desc>
      <format>
        <format-string desc="(num)-(num)">NUM'-'NUM</format-string>
        <arg type="NUM">Numeric value to be subtracted from</arg>
        <arg type="NUM">Numeric value to subtract</arg>
      </format>
      <description>Builds an expression, where the second number is subtracted from the first number.<br />
The expression result is used as a numeric argument for a command.</description>
      <related cmd="sub" />
    </command>

    <command name="inc" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>increment a variable</simple-desc>
      <format>
        <format-string desc="inc (num-var)">inc %VAR</format-string>
        <arg type="VAR">Numeric variable to increment</arg>
      </format>
      <description>Increments the value of the numerical variable by one.</description>
    </command>

    <command name="dec" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>decrement a variable</simple-desc>
      <format>
        <format-string desc="dec (num-var)">dec %VAR</format-string>
        <arg type="VAR">Numeric variable to decrement</arg>
      </format>
      <description>Decrements said variable by 1.</description>
    </command>

    <command name="mul" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>multiply variable by a number</simple-desc>
      <format>
        <format-string desc="mul (num-var), (num-val)">mul %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value to multiply</arg>
      </format>
      <description>Multiplies the variable by the number and stores the result in the variable.</description>
    </command>

    <command name="*" id="multiplication-sign" type="FE" category="calc">
      <scr ver="2.10">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>do multiplication</simple-desc>
      <format>
        <format-string desc="(num)*(num)">NUM'*'NUM</format-string>
        <arg type="NUM">Numeric value to multiply</arg>
        <arg type="NUM">Numeric value to multiply</arg>
      </format>
      <description>Builds an expression, where the first number is multiplied by the second number.<br />
The expression result is used as a numeric argument for a command.</description>
      <related cmd="mul" />
    </command>

    <command name="div" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>divide variable by a number</simple-desc>
      <format>
        <format-string desc="div (num-var), (num-val)">div %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value to divide by</arg>
      </format>
      <description>Divides the variable by the number, truncating the remainder.</description>
    </command>

    <command name="/" id="division-sign" type="FE" category="calc">
      <scr ver="2.10">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>do division</simple-desc>
      <format>
        <format-string desc="(num)/(num)">NUM'/'NUM</format-string>
        <arg type="NUM">Numeric value to divide</arg>
        <arg type="NUM">Numeric value to use as divisor</arg>
      </format>
      <description>Builds an expression, where the first number is divided by the second number.<br />
The expression result is used as a numeric argument for a command.</description>
      <related cmd="div" />
    </command>

    <command name="mod" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the remainder (modulo)</simple-desc>
      <format>
        <format-string desc="mod (num-var), (num-val)">mod %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Numeric value to divide by and get remainder</arg>
      </format>
      <description>Finds the remainder after the variable is divided by the number (same as the x % y command in C).</description>
      <notice>You can also use <b>mod</b> as an expression operator, as follows:<br />
mov %0,%1 mod 2</notice>
    </command>

    <command name="rnd" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>generate a random number (method 1)</simple-desc>
      <format>
        <format-string desc="rnd (num-var), (high-val)">rnd %VAR,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Upper range for the random number (0 to n-1)</arg>
      </format>
      <description>Generates a random number and sticks it in the numerical variable, ranging from 0 to (number - 1).</description>
      <notice>The command has no effect if 0 is given as the second number. (by senzogawa)</notice>
      <example>
        <comment>Get a random value from 0 to 99 and assign it to %5.</comment>
        <code>rnd %5,100</code>
      </example>
    </command>

    <command name="rnd2" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>generate a random number (method 2)</simple-desc>
      <format>
        <format-string desc="rnd (num-var), (low-val), (high-val)">rnd %VAR,NUM,NUM</format-string>
        <arg type="VAR">Numeric variable</arg>
        <arg type="NUM">Lower range for the random number</arg>
        <arg type="NUM">Upper range for the random number</arg>
      </format>
      <description>Generates a random number ranging from number 1 to number 2.</description>
      <example>
        <comment>Get a random value from 10 to 20 and assign it to %3.</comment>
        <code>rnd2 %3,10,20</code>
      </example>
    </command>

    <command name="itoa" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>convert a numeric value into a string</simple-desc>
      <format>
        <format-string desc="itoa (str-var), (num-val)">itoa $VAR,NUM</format-string>
        <arg type="VAR">String result variable</arg>
        <arg type="NUM">Numeric value to convert</arg>
      </format>
      <description>Converts a number into a (half-width digit) character string. Similar to the itoa function in C.</description>
      <example>
        <comment>Populates $0 with "120", and $1 with the string conversion of %2.</comment>
        <code>itoa $0,120
itoa $1,%2</code>
      </example>
    </command>

    <command name="itoa2" type="FE" category="calc">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>convert a numeric value into a fullwidth character string</simple-desc>
      <format>
        <format-string desc="itoa (str-var), (num-val)">itoa $VAR,NUM</format-string>
        <arg type="VAR">String variable for the fullwidth result</arg>
        <arg type="NUM">Numeric value to convert</arg>
      </format>
      <description>This is the same as <b>itoa</b>, except that it converts a number into a full-width digit character string, for more convenient Japanese text display.</description>
      <example>
        <comment>The numeric value of %4 is converted to a fullwidth string, which is then assigned to $0.</comment>
        <code>itoa2 $0,%4</code>
      </example>
      <related cmd="itoa" />
    </command>

    <command name="atoi" type="FE" category="calc">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>convert a string into a numeric</simple-desc>
      <format>
        <format-string desc="atoi (num-var), (str-val)">atoi %VAR,STR</format-string>
        <arg type="VAR">Numeric result variable</arg>
        <arg type="STR">Character string to convert</arg>
      </format>
      <description>Converts a character string into a numeric variable. This works the same way as the corresponding command in C.</description>
      <notice>This won't convert full-width digit strings. (by senzogawa)</notice>
      <example>
        <comment>Populates %0 with 123, and %3 with the number extracted from $0.</comment>
        <code>atoi %0,"123"
atoi %3,$0</code>
      </example>
    </command>

    <command name="len" type="FE" category="calc">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>find the length of a character string</simple-desc>
      <format>
        <format-string desc="len %(result-var), (str)">len %VAR,STR</format-string>
        <arg type="VAR">Length result variable</arg>
        <arg type="STR">Character string to measure</arg>
      </format>
      <description>Finds the length of the given character string.</description>
      <example>
        <comment>Sets %0 to the length of $0</comment>
        <code>len %0,$0</code>
      </example>
      <related cmd="mid" />
    </command>

    <command name="mid" type="FE" category="calc">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get a substring of the given character string</simple-desc>
      <format>
        <format-string desc="mid $(result-var), (str-val), (start-pos), (num-chars)">mid $VAR,STR,NUM,NUM</format-string>
        <arg type="VAR">String variable to receive the substring</arg>
        <arg type="STR">Character string to extract from</arg>
        <arg type="NUM">Starting index of the substring</arg>
        <arg type="NUM">Number of (half-width) characters to extract</arg>
      </format>
      <description>Extracts a substring from the given character string.</description>
      <notice>Use starting index 0 for the first character. Also, to get exactly 1 full-width character, specify 2 as the number of chars to extract.</notice>
      <example>
        <comment>Extracts a substring of length %1 starting at index %0 from string $1, and assigns the result to $0.</comment>
        <code>mid $0,$1,%0,%1</code>
      </example>
      <example>
        <comment>Grabs the first 5 characters of $1 and assigns the substring to $0.</comment>
        <code>mid $0,$1,0,5</code>
      </example>
      <related cmd="len" />
    </command>

    <command name="split" type="FE" category="calc">
      <scr ver="2.40">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>split a character string using the given delimiter</simple-desc>
      <format>
        <format-string desc="split (str), (delim), (var)[, ...]">split STR,STR,$VAR|%VAR,$VAR|%VAR[,...]</format-string>
        <arg type="STR">Character string to split</arg>
        <arg type="STR">Delimiter (must be just one character)</arg>
        <arg type="VAR">Result variable</arg>
      </format>
      <description>Splits the given string at each occurrence of the given delimiter, and assigns the resulting portions to the given variables.<br />
Use this command to process the results returned by <b>readfile</b>.</description>
      <notice>If a variable is repeated, its final result will be the last value portion assigned to it. (by eijipou)<br />
If the string cannot be split (i.e. the delimiter never occurs), then numeric variables will be assigned the value 0 and string variables will receive the entire "split" string. (by senzogawa)</notice>
      <example>
        <comment>Splits $0 at every occurrence of "/", assigning the results to $1, $2, %0, %1, and $3.</comment>
        <code>mov $0,"あいうえお/かきくけこ/15/25/さしすせそ"
split $0,"/",$1,$2,%0,%1,$3

＄１＝$1 ; あいうえお
＄２＝$2 ; かきくけこ
％０＝%0 ; 15
％１＝%1 ; 25
＄３＝$3 ; さしすせそ
\</code>
      </example>
      <related cmd="readfile" />
    </command>

    <command name="sin" type="FE" category="calc">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>find the sine of the given angle</simple-desc>
      <format>
        <format-string desc="sin (num-var), (angle)">sin %VAR,NUM</format-string>
        <arg type="VAR">Numeric result variable</arg>
        <arg type="NUM">Angle (in degrees)</arg>
      </format>
      <description>Acquires the trigonometric sine of the given angle, and returns the value multiplied by 1000.</description>
      <example>
        <comment>Assigns the sine of 90 degrees to %0.</comment>
        <code>sin %0,90
;%0=1000, since sin(90)=1</code>
      </example>
      <related cmd="cos" />
      <related cmd="tan" />
    </command>

    <command name="cos" type="FE" category="calc">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>find the cosine of the given angle</simple-desc>
      <format>
        <format-string desc="cos (num-var), (angle)">cos %VAR,NUM</format-string>
        <arg type="VAR">Numeric result variable</arg>
        <arg type="NUM">Angle (in degrees)</arg>
      </format>
      <description>Acquires the trigonometric cosine of the given angle, and returns the value multiplied by 1000.</description>
      <example>
        <comment>Assigns the cosine of 60 degrees to %1.</comment>
        <code>cos %1,60
;%1=500, since cos(60)=0.5</code>
      </example>
      <related cmd="sin" />
      <related cmd="tan" />
    </command>

    <command name="tan" type="FE" category="calc">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>find the tangent of the given angle</simple-desc>
      <format>
        <format-string desc="tan (num-var), (angle)">tan %VAR,NUM</format-string>
        <arg type="VAR">Numeric result variable</arg>
        <arg type="NUM">Angle (in degrees)</arg>
      </format>
      <description>Acquires the trigonometric tangent of the given angle, and returns the value multiplied by 1000.</description>
      <notice>Please note that tan will return infinity if given values 90 and 270.</notice>
      <example>
        <comment>Assigns the tangent of 45 degrees to %2.</comment>
        <code>tan %2,45
;%2=1000, since tan(45)=1</code>
      </example>
      <related cmd="sin" />
      <related cmd="cos" />
    </command>

    <command name="if" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>evaluate if a condition is true</simple-desc>
      <format>
        <format-string desc="if (condition) (command)">if CONDITION[{&amp;&amp;,&amp;} CONDITION[...]] SENTENCE</format-string>
        <arg type="CONDITION">Relative operation, check instruction, or some other truth-value returning expression</arg>
        <arg type="SENTENCE">Command(s) to execute if the condition was True</arg>
      </format>
      <description>The commands following the if statement are executed if the conditional statement(s) evaluate true; if you want branch control in which a command executes if a conditional statement is false, use <b>notif</b>.<br />
The conditions compare numerical values, else you can employ <b>fchk</b>.<br />
<b>&amp;</b> and <b>&amp;&amp;</b> are logical 'ands', and are equivalent to each another.<br />
<br />
<indent /><b>Conditions:</b><br />
<indent />(numerical variable) {&gt;,&lt;,=,&gt;=,&lt;=,==,!=,&lt;&gt;} (numeric variable)<br />
<indent />- or -<br />
<indent /><b>fchk</b> (character string)<br />
<br />
<indent /><b>&lt;</b>, <b>&gt;</b>, <b>=</b>, <b>&gt;=</b>, and <b>&lt;=</b> should already be known to you.<br />
<indent /><b>==</b> and <b>=</b> are identical, as are <b>!=</b> and <b>&lt;&gt;</b>.<br />
<indent /><b>fchk</b> returns true when the image whose name corresponds to the character string is being used.</description>
      <example>
        <comment>If %0 equals 1, do a 1/2 second horizontal screen shake.</comment>
        <code>if %0=1 quakex 2,500 ;basic conditional form</code>
      </example>
      <example>
        <comment>End the program if %0 equals 1 and %2 equals 5.</comment>
        <code>if %0=1 &amp;&amp; %2=5 end ;more complex form - both conditionals must be true</code>
      </example>
      <example>
        <comment>If %0 equals 2, assign 1 to %1 and then skip the next 2 lines.</comment>
        <code>if %0=2 mov %1,1:skip 2 ;execute multiple commands sep. by ':'</code>
      </example>
      <related cmd="notif" />
    </command>

    <command name="notif" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>evaluate if a condition is false</simple-desc>
      <format>
        <format-string desc="notif (condition) (command)">notif CONDITION[{&amp;&amp;,&amp;} CONDITION[...]] SENTENCE</format-string>
        <arg type="CONDITION">Relative operation, check instruction, or some other truth-value returning expression</arg>
        <arg type="SENTENCE">Command(s) to execute if the condition was False</arg>
      </format>
      <description>The commands following the if statement are executed if the conditional statement(s) evaluate false; if you want branch control in which a command executes if a conditional statement is true, use <b>if</b>.<br />
The conditions compare numerical values, else you can employ <b>fchk</b>.<br />
<b>&amp;</b> and <b>&amp;&amp;</b> are logical 'ands', and are equivalent to each another.<br />
<br />
<indent /><b>Conditions:</b><br />
<indent />(numerical variable) {&gt;,&lt;,=,&gt;=,&lt;=,==,!=,&lt;&gt;} (numeric variable)<br />
<indent />- or -<br />
<indent /><b>fchk</b> (character string)</description>
      <example>
        <comment>If %0 is not equal to 1, do a 1/2 second horizontal screen shake.</comment>
        <code>notif %0=1 quakex 2,500</code>
      </example>
      <related cmd="if" />
    </command>

    <command name="cmp" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>compare character strings</simple-desc>
      <format>
        <format-string desc="cmp (result-var), (str-val1), (str-val2)">cmp %VAR,STR,STR</format-string>
        <arg type="VAR">Numeric variable for result of comparison</arg>
        <arg type="STR">Character string #1</arg>
        <arg type="STR">Character string #2</arg>
      </format>
      <description>Compares two character strings. Returns 0 if equal, a positive value if the first string comes before in sorting order, and a negative value if the second string comes before in sorting order.</description>
      <notice>In recent NScripter, if you just need to see if strings are equal, <b>==</b> and <b>!=</b> will do the job - you needn't use <b>cmp</b>. (by senzogawa)</notice>
    </command>

    <command name="fchk" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>check whether or not a image file has been loaded (and tagged)</simple-desc>
      <format>
        <format-string desc="fchk (filename)">fchk STR</format-string>
        <arg type="STR">Filename of image to confirm</arg>
      </format>
      <description>Checks to see whether an image tag has been recorded in the file log.<br />
This is used as a conditional for an <b>if</b> statement. If the image has been loaded and may be used in-game, this returns true; if not, or if the filename was incorrect, this returns false.</description>
      <example>
        <code>ld c,":a;test.bmp",1
if fchk ":a;test.bmp" ;returns true
if fchk "test.bmp"    ;same result</code>
      </example>
    </command>

    <command name="lchk" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>check whether or not a label has been accessed</simple-desc>
      <format>
        <format-string desc="lchk (label)">lchk LABEL</format-string>
        <arg type="LABEL">Label to confirm</arg>
      </format>
      <description>Like <b>fchk</b>, this command is used in <b>if</b> statement conditionals. It checks to see whether the given label has been used/accessed.<br />
Any of the following are allowed syntax:<br />
<indent />lchk *test<br />
<indent />lchk "*test"<br />
<indent />lchk $0</description>
    </command>

    <command name="for" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>loop instruction</simple-desc>
      <format>
        <format-string desc="for (counter-var)=(init-val) to (end-val)[ step (inc-val)]">for %VAR=NUM to NUM[ step NUM]</format-string>
        <arg type="VAR">Numeric variable used as counter</arg>
        <arg type="NUM">Initial value for counter</arg>
        <arg type="NUM">Ending value for counter</arg>
        <arg type="NUM">Increment step for counter</arg>
      </format>
      <description>This is essentially the same as a BASIC loop. The <b>for</b> loop starts at the first number, and then increments (or decrements) by the step value until it has gone beyond the second number (or below, in the case of a negative step). The step value is 1 by default.<br />
<br />
If you use commands like <b>goto</b> or <b>select</b> inside a <b>for</b> loop, this will leave the NScripter stack in an inconsistent and easily-crashable state - so please don't do that.<br />
<br />
All commands in the loop between the <b>FOR</b> and the <b>NEXT</b> will be executed. If you wish to prematurely break out of the loop, issue a <b>BREAK</b> command.<br />
You can also use <b>gosub</b> commands to no ill effect within a loop; thus, it is highly recommended that you compartmentalize what is <b>inside</b> a loop from what is <b>outside</b> of it.</description>
      <example>
        <comment>Looping %0 from 1 to 10, add each value of the counter to %1.</comment>
        <code>for %0=1 to 10
add %1,%0
next</code>
      </example>
      <related cmd="next" />
    </command>

    <command name="next" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>end a loop</simple-desc>
      <format>
        <format-string>next</format-string>
      </format>
      <description>This ends a <b>for</b> block. Please refer to the documentation of <b>for</b> for more details.</description>
      <related cmd="for" />
    </command>

    <command name="break" type="FE" category="statement">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>break out of a <b>for</b> loop</simple-desc>
      <format>
        <format-string>break</format-string>
      </format>
      <description>Breaks out of a single loop, proceeding to the line immediately after the loop's <b>next</b> statement.<br />
<br />
You cannot use this command by itself to break completely out of nested loops - you'll need to first <b>break</b> out of the inner loop, then <b>break</b> out of the outer loop.<br />
<br />
<b>Unrecommended method:</b><br />
<indent />BREAK *(label name)<br />
This syntax does exist; it has the same functionality as a goto statement.<br />
It can break you out of nested loops, but leaves the state of the inner loop intact.<br />
This causes a fragmentation of the stack, making it hard to debug your script later, so use this syntax with extreme caution.</description>
      <example>
        <comment>This displays "%0, %1", with %0 increasing from 1 to 8, and the inner loop counter %1 decreasing as the sequence (6,4,2). However, it breaks out of the inner loop after displaying a %0 or %1 that's equal to 4.</comment>
        <code>*define
game
*start
for %0=1 to 8
for %1=6 to 2 step -2
%0, %1
if %0=4 &amp; %1=4 break
next
next
click
end</code>
      </example>
      <related cmd="for" />
    </command>

    <command name="rmenu" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>initialize menu to display upon right-click</simple-desc>
      <format>
        <format-string desc="rmenu (str-val), (menu-name)[, ...]">rmenu STR,{skip,reset,save,load,lookback,windowerase}[,...]</format-string>
        <arg type="STR">Right-click menu display string</arg>
        <arg type="STR">Right-click menu function name</arg>
      </format>
      <description>Defines a system menu to show upon right-click.<br />
The character string is menu item text, and the function is picked from the list defined below.<br />
<br />
SYSTEM MENU FUNCTION NAMES:<br />
<b>skip</b> - same as "skip to next choice"<br />
<b>reset</b> - reset program<br />
<b>resetdlg</b> - same as <b>reset</b>?
<b>save</b> - go to save menu<br />
<b>load</b> - go to load menu<br />
<b>lookback</b> - go to log mode<br />
<b>windowerase</b> - remove text window<br />
<b>end</b> - exit the program</description>
      <example>
        <comment>Display 3 elements in the right-click menu: "セーブ" for the Save menu function, "ロード" for the Load menu function, and "回想" for Log Mode.</comment>
        <code>rmenu "セーブ",save,"ロード",load,"回想",lookback</code>
      </example>
    </command>

    <command name="menusetwindow" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>initialize window for right-click menu</simple-desc>
      <format>
        <format-string desc="menusetwindow (char-width), (char-height), (spacing-X), (spacing-Y), (boldface:0=off/1=on), (drop-shadow:0=off/1=on), (window-color)">menusetwindow NUM,NUM,NUM,NUM,NUM,NUM,COLOR</format-string>
        <arg type="NUM">(Full-width) text font width</arg>
        <arg type="NUM">Text font height</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="NUM">Boldface toggle (0=off/1=on)</arg>
        <arg type="NUM">Drop shadow toggle (0=off/1=on)</arg>
        <arg type="COLOR">Window color</arg>
      </format>
      <description>Creates a menu dialog window.<br />
This window displays above all other items in the screen when active.<br />
From left to right, the arguments are: character font size x, character font size y, kerning x, kerning y, boldface (1 - yes; 0 - no), drop shadow (1 - yes; 0 - no); the final #rrggbb parameter is the window color.</description>
    </command>

    <command name="savename" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify names to use for savefiles in right-click menu</simple-desc>
      <format>
        <format-string desc="savename (save-title), (load-title), (line-heading)">savename STR,STR,STR</format-string>
        <arg type="STR">Save menu title</arg>
        <arg type="STR">Load menu title</arg>
        <arg type="STR">Savefile line heading</arg>
      </format>
      <description>Designates the display strings for savefiles.<br />
From left to right, the strings are: title for the save menu, title for the load menu, and then the name of the save itself.<br />
By default, these are "＜セーブ＞","＜ロード＞","しおり" -- note that these are all double-byte character strings.</description>
      <notice>ONScripter-EN and PONScripter have the following for defaults: "Save", "Load", "Slot".</notice>
    </command>

    <command name="menuselectcolor" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate the text colors for choices</simple-desc>
      <format>
        <format-string desc="menuselectcolor (mouseover-color), (mouseoff-color), (no-savefile-color)">menuselectcolor COLOR,COLOR,COLOR</format-string>
        <arg type="COLOR">Mouseover color</arg>
        <arg type="COLOR">Mouseoff color</arg>
        <arg type="COLOR">Empty savefile slot color</arg>
      </format>
      <description>This command sets the colors of the right-click menu when the right-click menu functionality is enabled. In order, the colors are the mouseover color, the mouseout color, and the "no savefile exists" color.</description>
    </command>

    <command name="menuselectvoice" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify right-click menu system sounds</simple-desc>
      <format>
        <format-string desc="menuselectvoice (menu-open-sound), (cancel-sound), (mouseover-sound), (click-sound), (error-sound), ('yes'-sound), ('no'-sound)">menuselectvoice STR,STR,STR,STR,STR,STR,STR</format-string>
        <arg type="STR">Sound file that plays when a menu opens</arg>
        <arg type="STR">Sound file that plays at menu cancel</arg>
        <arg type="STR">Sound file that plays upon mouseover of a menu item</arg>
        <arg type="STR">Sound file that plays when a menu item is clicked</arg>
        <arg type="STR">Sound file that plays at an error</arg>
        <arg type="STR">Sound file that plays when 'Yes' option chosen</arg>
        <arg type="STR">Sound file that plays when 'No' option chosen</arg>
      </format>
      <description>Designates the WAV files that are played for menu choices, and other system sounds.<br />
<br />
From left to right, the strings are: menu open, menu cancel, menu item mouseover, on click, forbidden operation, "yes" confirmation, "no" confirmation.<br />
<br />
If any of these are set to "", no sound plays.<br />
By default, all of these sounds are set to "".</description>
    </command>

    <command name="rlookback" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to Log Mode upon right-click</simple-desc>
      <format>
        <format-string>rlookback</format-string>
      </format>
      <description>Activate Log Mode by using a right click.</description>
    </command>

    <command name="rgosub" version="(undoc)" type="F" category="rclick">
      <scr>N</scr><scr ver="20091122">E</scr>
      <simple-desc>set a routine to call upon right-click</simple-desc>
      <format>
        <format-string desc="rgosub *(label)">rgosub LABEL</format-string>
        <arg type="LABEL">Destination to jump to upon right-click</arg>
      </format>
      <description>This sets a routine to call at right-clicks.<br />
The given label will be called using a <b>gosub</b>, so that a <b>return</b> will go back to the waiting point where the right-click was detected.</description>
      <notice>The <b>systemcall</b> command doesn't work if rgosub is defined (by BBS)</notice>
      <related cmd="rmenu" />
    </command>

    <command name="roff" type="F" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>ignore right-clicks</simple-desc>
      <format>
        <format-string>roff</format-string>
      </format>
      <description>Set default behavior of right-click as null/do nothing.</description>
    </command>

    <command name="rmode" type="E" category="rclick">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle availability of right-click menu</simple-desc>
      <format>
        <format-string desc="rmode (flag:0=off/1=on)">rmode NUM</format-string>
        <arg type="NUM">Right-click active toggle (0:off, 1:on)</arg>
      </format>
      <description>Toggles right-click functionality on (1) or off (0).</description>
    </command>

    <command name="lookbackbutton" type="F" category="lookback">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify button images for Log Mode</simple-desc>
      <format>
        <format-string desc="lookbackbutton (pageup-mouseover), (pageup-mouseoff), (pagedown-mouseover), (pagedown-mouseoff)">lookbackbutton STR,STR,STR,STR</format-string>
        <arg type="STR">Page-up active button image</arg>
        <arg type="STR">Page-up inactive button image</arg>
        <arg type="STR">Page-down active button image</arg>
        <arg type="STR">Page-down inactive button image</arg>
      </format>
      <description>Loads buttons for use in Log Mode.<br />
By default, these are "uoncur.bmp","uoffcur.bmp","doncur.bmp","doffcur.bmp".<br />
The images must be of the same size or else this command will fail.<br />
Log mode buttons cannot be animated.<br />
The button to enter log mode is located at the upper right of the text window. Its position cannot be changed once set, so please make sure you set it right the first time around.</description>
    </command>

    <command name="lookbackcolor" type="F" category="lookback">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate text color for Log Mode</simple-desc>
      <format>
        <format-string desc="lookbackcolor (text-color)">lookbackcolor COLOR</format-string>
        <arg type="COLOR">Log Mode text color</arg>
      </format>
      <description>Sets the text color for Log Mode.<br />
The color is an #rrggbb hex value, like that used in HTML.</description>
    </command>

    <command name="lookbackvoice" type="F" category="lookback">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play a sound when paging through Log Mode</simple-desc>
      <format>
        <format-string desc="lookbackvoice (sound-file)">lookbackvoice STR</format-string>
        <arg type="STR">Paging sound filename</arg>
      </format>
      <description>Designates a WAV file to play back when the pageup/pagedown button is clicked in Log Mode.</description>
    </command>

    <command name="lookbacksp" type="F" category="lookback">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>use sprites instead of the default Log Mode buttons</simple-desc>
      <format>
        <format-string desc="lookbacksp (pageup-sprite), (pagedown-sprite)">lookbacksp NUM,NUM</format-string>
        <arg type="NUM">PageUp button sprite number</arg>
        <arg type="NUM">PageDown button sprite number</arg>
      </format>
      <description>Uses the given sprites as lookback buttons instead of the defaults.</description>
      <example>
        <comment>Uses Sprites 2 and 3 as the Log Mode Pageup and Pagedown buttons.</comment>
        <code>lookbacksp 2,3</code>
      </example>
      <related cmd="lookbackbutton" />
    </command>

    <command name="maxkaisoupage" type="F" category="lookback">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set maximum number of pages to store for Log Mode</simple-desc>
      <format>
        <format-string desc="maxkaisoupage (max-pages)">maxkaisoupage NUM</format-string>
        <arg type="NUM">Maximum number of pages to store in backlog buffer</arg>
      </format>
      <description>Sets the maximum number of pages that may be stored for Log Mode.</description>
      <example>
        <comment>Allows access to only the previous 10 pages in Log Mode.</comment>
        <code>maxkaisoupage 10</code>
      </example>
    </command>

    <command name="lookbackflush" type="E" category="lookback">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>clear Log Mode buffer</simple-desc>
      <format>
        <format-string>lookbackflush</format-string>
      </format>
      <description>Flushes the Log Mode buffer.</description>
    </command>

    <command name="lookbackoff" type="E" category="lookback">
      <scr>N</scr>
      <simple-desc>stop accumulating Log Mode data</simple-desc>
      <format>
        <format-string>lookbackon</format-string>
      </format>
      <description>Stops collecting Log Mode data; data collection can be restarted with <b>lookbackon</b>.</description>
      <related cmd="lookbackon" />
    </command>

    <command name="lookbackon" type="E" category="lookback">
      <scr>N</scr>
      <simple-desc>begin accumulating Log Mode data</simple-desc>
      <format>
        <format-string>lookbackon</format-string>
      </format>
      <description>Turns on accumulation of Log Mode data; use this to return regular log buffering after turning it off with <b>lookbackoff</b>.</description>
      <related cmd="lookbackoff" />
    </command>

    <command name="kidokuskip" type="F" category="kidokuskip">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enable 'stop at unread' in Skip Mode</simple-desc>
      <format>
        <format-string>kidokuskip</format-string>
      </format>
      <description>If you use this command, you can enter "skip to next choice" mode. The script will keep track of previously-read text, so that whenever you encounter unread text, Skip Mode will automatically terminate.<br />
Kidoku (read text) data is stored in the file "kidoku.dat".</description>
      <related cmd="kidokumode" />
    </command>

    <command name="mode_wave_demo" type="F" category="kidokuskip">
      <scr>N</scr><scr>E</scr><scr>P</scr>
      <simple-desc>play WAV files even during Skip Mode</simple-desc>
      <format>
        <format-string>mode_wave_demo</format-string>
      </format>
      <description>Usually WAV files are not played during "skip to next choice" mode, but specifying this command will have them be played.</description>
      <notice>ONScripter doesn't recognize this command, but plays WAV files during skip mode anyway. ONScripter-EN supports this command since ver.20090816 (as does PONScripter since ver.20100205) by playing WAV files during skips only if <b>mode_wave_demo</b> is used. (by Mion)</notice>
    </command>

    <command name="skipoff" type="E" category="kidokuskip">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>turn off Skip Mode</simple-desc>
      <format>
        <format-string>skipoff</format-string>
      </format>
      <description>Exits both "skip to next choice" mode and "auto mode".</description>
      <notice>Skip Mode can be enabled with "systemcall skip".<br />
So, using <b>defsub</b>, you can create a "skipon" command with the follow code. (by senzogawa)<br />
*skipon<br />
systemcall skip<br />
return</notice>
      <example>
        <comment>Exits any Skip Mode that may have been active.</comment>
        <code>skipoff</code>
      </example>
    </command>

    <command name="kidokumode" type="E" category="kidokuskip">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle Skip Mode's 'stop at unread' setting</simple-desc>
      <format>
        <format-string desc="kidokumode (stop-at-unread:0=no/1=yes)">kidokumode NUM</format-string>
        <arg type="NUM">Mode setting (0: regular skip, 1: skip to unread)</arg>
      </format>
      <description>Toggles between regular kidoku skip (stops at first unread text) and forced "skip to next choice" mode.</description>
      <related cmd="kidokuskip" />
    </command>

    <command name="filelog" type="F" category="log_global">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enable file access logging</simple-desc>
      <format>
        <format-string>filelog</format-string>
      </format>
      <description>This allows for creation of a file log.<br />
Every single resource used by the program will be recorded in that file log as a tag.<br />
If you specify neither this command nor <b>globalon</b>, then nscr.exe will not generate any files, and will be able to run from CD.</description>
    </command>

    <command name="globalon" type="F" category="log_global">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enable use of global variables</simple-desc>
      <format>
        <format-string>globalon</format-string>
      </format>
      <description>Turns on the use of global variables. If you enable this or <b>filelog</b>, nscr.exe cannot be run from write-protected media.</description>
    </command>

    <command name="labellog" type="F" category="log_global">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enable label access logging</simple-desc>
      <format>
        <format-string>labellog</format-string>
      </format>
      <description>This command behaves somewhat like <b>filelog</b>, except in this case it keeps a record of labels.<br />
Whenever a <b>goto</b>, <b>gosub</b> or similar command is called, a record of which label was called will be stored if <b>labellog</b> was specified.</description>
    </command>

    <command name="savenumber" type="F" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set the maximum number of saves allowed</simple-desc>
      <format>
        <format-string desc="savenumber (max-savenum)">savenumber NUM</format-string>
        <arg type="NUM">Savefile capacity</arg>
      </format>
      <description>Change the limit on the number of save files. At most, this can be 20, and the default is 9.<br />
If you are not careful to make sure that the save menu does not overflow the bottom of the screen (using <b>menusetwindow</b>), this command could cause the interpreter to hard crash.</description>
      <related cmd="menusetwindow" />
    </command>

    <command name="savedir" type="F" category="saveload">
      <scr ver="2.49">N</scr><scr>E</scr>
      <simple-desc>store save data in the designated folder</simple-desc>
      <format>
        <format-string desc="savedir (savedata-folder)">savedir STR</format-string>
        <arg type="STR">Name of directory where save data will be stored</arg>
      </format>
      <description>This specifies a folder to use for storing save data.</description>
      <notice>When this command is used (in NScripter), only the file "envdata" will be stored in the same location as "nscr.exe".<br />
Be sure the savedir exists beforehand.</notice>
      <notice>ONScripter-EN and PONScripter already store game &amp; save data in a separate folder from the game; this location can be adjusted via the "-s" command line option.<br />
This behavior is separate from the <b>savedir</b> command, which is used to specify a directory relative to the game/save folder (holding all but "envdata". (by Mion)</notice>
      <example>
        <comment>Sets so that save data files will be stored in the folder "savedata".</comment>
        <code>savedir "savedata"</code>
      </example>
      <related cmd="savegame" />
    </command>

    <command name="loadgame" type="E" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load game from the designated savefile</simple-desc>
      <format>
        <format-string desc="loadgame (save-num)">loadgame NUM</format-string>
        <arg type="NUM">Savefile number</arg>
      </format>
      <description>Loads the save data corresponding to the given save number. This does not prompt for confirmation, so be careful.<br />
This command gives no error indication if savefile cannot be loaded, and simply proceeds to the next command without stopping.</description>
    </command>

    <command name="savegame" type="E" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>save game in the designated savefile</simple-desc>
      <format>
        <format-string desc="savegame (save-num)">savegame NUM</format-string>
        <arg type="NUM">Savefile number</arg>
      </format>
      <description>Saves the game under the given save number. This does not ask for confirmation, so be careful.</description>
    </command>

    <command name="savegame2" type="E" category="saveload">
      <scr ver="2.60">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>store a particular character string along with the savefile</simple-desc>
      <format>
        <format-string desc="savegame2 (save-num), (str)">savegame2 NUM,STR</format-string>
        <arg type="NUM">Savefile number</arg>
        <arg type="STR">String to store with the save</arg>
      </format>
      <description>Stores a particular character string with each save file; otherwise, it works the same as <b>savegame</b>.</description>
      <example>
        <comment>Along with Save Game 12, this stores the string "８月５日　ヒロインＡルート"</comment>
        <code>savegame2 12,"８月５日　ヒロインＡルート"</code>
      </example>
      <example type="O">
        <comment>Along with Save Game 12, this stores the string "Aug. 5 -Heroine A route-"</comment>
        <code>savegame2 12,`Aug. 5 -Heroine A route-`</code>
      </example>
      <related cmd="savegame" />
      <related cmd="getsavestr" />
    </command>

    <command name="getsavestr" type="E" category="saveload">
      <scr ver="2.60">N</scr><scr>O</scr><scr>E</scr>
      <simple-desc>retrieve the string stored with a savefile using <b>savegame2</b></simple-desc>
      <format>
        <format-string desc="getsavestr (str-var), (save-num)">getsavestr $VAR,NUM</format-string>
        <arg type="VAR">Result string variable</arg>
        <arg type="NUM">Savefile number</arg>
      </format>
      <description>Retrieves the character string that was stored with a particular save number using <b>savegame2</b>.</description>
      <example>
        <comment>Gets the string stored with Save Game 12 by <b>savegame2</b> and assigns it to $1.</comment>
        <code>getsavestr $1,12</code>
      </example>
      <related cmd="savegame2" />
    </command>

    <command name="savefileexist" type="E" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>check whether or not a savefile exists</simple-desc>
      <format>
        <format-string desc="savefileexist (result-var), (save-num)">savefileexist %VAR,NUM</format-string>
        <arg type="VAR">Result numeric variable (0: doesn't exist, 1: exists)</arg>
        <arg type="NUM">Savefile number</arg>
      </format>
      <description>Returns 1 if the savefile exists, 0 if it does not.</description>
    </command>

    <command name="saveon" type="E" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>turn on Save Mode</simple-desc>
      <format>
        <format-string>saveon</format-string>
      </format>
      <description>Turns Save Mode back on (also see <b>saveoff</b> for more details).</description>
      <related cmd="saveoff" />
    </command>

    <command name="saveoff" type="E" category="saveload">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>turn off Save Mode</simple-desc>
      <format>
        <format-string>saveoff</format-string>
      </format>
      <description>Turns Save Mode off.<br />
This does not mean that you cannot save; it means that when you load, the position at which the player starts will be at the last place where <b>saveon</b> was set.<br />
Why would you ever want to turn save mode off? When save mode is on, it records every sprite ever loaded into a log -- causing moderate to massive amounts of slowdown when you are attempting to do a fast animation. In these cases, you should definitely call <b>saveoff</b> before you start the animation, then call <b>saveon</b> once you've finished.</description>
    </command>

    <command name="loadgosub" type="F" category="saveload">
      <scr ver="2.40">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set a routine to call immediately after loading a game</simple-desc>
      <format>
        <format-string desc="loadgosub *(label)">loadgosub LABEL</format-string>
        <arg type="LABEL">Subroutine to call upon game load</arg>
      </format>
      <description>Specifies a routine to call immediately after a game is loaded and its save state has been restored.<br />
Please take care when scripting to be sure that all saveable points will work properly when restored with this <b>loadgosub</b> routine.<br />
This command was created especially to handle games that use plugins for music reproduction.</description>
      <notice>This command is necessary in NScr if a plugin is being used for music playback.</notice>
      <example>
        <comment>Specifies that the script should call *loadlb whenever a game is loaded.</comment>
        <code>loadgosub *loadlb</code>
      </example>
    </command>

    <command name="errorsave" version="1.99" type="F" category="saveload">
      <scr>N</scr>
      <simple-desc>automatically save game status in savefile 999 when an error occurs</simple-desc>
      <format>
        <format-string>errorsave</format-string>
      </format>
      <description>This command specifies that, when an error occurs, the current game state should be stored automatically in Savefile 999; this may be useful for game debugging purposes.</description>
    </command>

    <command name="autosaveoff" version="2.93" type="F" category="saveload">
      <scr>N</scr>
      <simple-desc>disable (most) automatic save points</simple-desc>
      <format>
        <format-string>autosaveoff</format-string>
      </format>
      <description>Disables automatic save points beyond the first displayed sentence.<br />
<b>saveon</b> and <b>saveoff</b> commands will be ignored if this is used.<br />
(Savepoints will still be updated at the beginning of a display sentence, as usual.)<br />
Use the <b>savepoint</b> command to manually update savepoints at places other than the beginning of sentences (e.g. at a clickable map).<br />
Timing issues may slow down returns from data updates, for example when recording a save point after drawing over the entire screen, so please use common sense.</description>
      <related cmd="savepoint" />
      <related cmd="saveoff" />
      <related cmd="saveon" />
    </command>

    <command name="savepoint" version="2.93" type="E" category="saveload">
      <scr>N</scr>
      <simple-desc>update the save point</simple-desc>
      <format>
        <format-string>savepoint</format-string>
      </format>
      <description>Updates the save point.<br />
Use this when the <b>autosaveoff</b> command is used in the define block.<br />
Timing issues may slow down returns from data updates, for example when updating a save point after drawing over the entire screen, so please use common sense.</description>
      <related cmd="autosaveoff" />
    </command>

    <command name="mesbox" type="FE" category="additional">
      <scr>N</scr>
      <simple-desc>create a message box</simple-desc>
      <format>
        <format-string desc="mesbox (message-str), (title-str)">mesbox STR,STR</format-string>
        <arg type="STR">Message to display</arg>
        <arg type="STR">Messagebox title</arg>
      </format>
      <description>Shows a message box.<br />
The first string is the contents of the box, the second string is the title of said box.</description>
    </command>

    <command name="okcancelbox" version="2.47" type="FE" category="additional">
      <scr>N</scr>
      <simple-desc>create an OK/Cancel dialog box</simple-desc>
      <format>
        <format-string desc="okcancelbox %(result-var), (message-str), (title-str)">okcancelbox %VAR,STR,STR</format-string>
        <arg type="VAR">Result: 1 for OK, 0 for Cancel</arg>
        <arg type="STR">Message to display</arg>
        <arg type="STR">Dialog box title</arg>
      </format>
      <description>Shows a Windows OK/Cancel dialog box and retrieves user input.</description>
      <example>
        <comment>Creates an OK/Cancel dialog titled "セーブ確認" (Confirm Save) with the message "セーブします。" (About to Save).</comment>
        <code>okcancelbox %0,"セーブします。","セーブ確認"</code>
      </example>
      <related cmd="yesnobox" />
    </command>

    <command name="yesnobox" version="2.47" type="FE" category="additional">
      <scr>N</scr>
      <simple-desc>create a Yes/No dialog box</simple-desc>
      <format>
        <format-string desc="yesnobox %(result-var), (message-str), (title-str)">yesnobox %VAR,STR,STR</format-string>
        <arg type="VAR">Result: 1 for Yes, 0 for No</arg>
        <arg type="STR">Message to display</arg>
        <arg type="STR">Dialog box title</arg>
      </format>
      <description>Shows a Windows Yes/No dialog box and retrieves user input.</description>
      <example>
        <comment>Creates Yes/No dialog titled "ロード確認" (Confirm Load) with the message "ロードしますか？" (Perform Load?).</comment>
        <code>yesnobox %0,"ロードしますか？","ロード確認"</code>
      </example>
      <related cmd="okcancelbox" />
    </command>

    <command name="inputstr" type="E" category="additional">
      <scr>N</scr>
      <simple-desc>wait for player to give character input (method 1)</simple-desc>
      <format>
        <format-string desc="inputstr (result-var), (message-str), (max-len), (force-fullwidth:0=no/1=yes), (window-width), (window-height), (textarea-width), (textarea-height)">inputstr $VAR,STR,NUM,NUM[,NUM,NUM,NUM,NUM]</format-string>
        <arg type="VAR">Input result string variable</arg>
        <arg type="STR">Message to display</arg>
        <arg type="NUM">Maximum input length</arg>
        <arg type="NUM">Force double-byte input (0: allow half-width, 1: full-width only)</arg>
        <arg type="NUM">Window width (optional)</arg>
        <arg type="NUM">Window height (optional)</arg>
        <arg type="NUM">Input area width (optional)</arg>
        <arg type="NUM">Input area height (optional)</arg>
      </format>
      <description>Creates an input dialog that captures all input to the character variable.<br />
The character string serves as the dialog message text.<br />
The first number is the max input length, the second (0 or 1) determines whether the user is forced to enter 2-byte characters or not.<br />
The last 4 arguments may be omitted; in order they are (window size x), (window size y), (text input window size x), (text input window size y).</description>
      <related cmd="input" />
      <related cmd="inputnum" />
      <related cmd="textfield" />
    </command>

    <command name="inputnum" version="(undoc)" type="E" category="additional">
      <scr>N</scr>
      <simple-desc>wait for player to give numeric input</simple-desc>
      <format>
        <format-string desc="inputnum (result-var), (message-str), (window-width), (window-height), (input-width), (input-height)">inputstr %VAR,STR[,NUM,NUM,NUM,NUM]</format-string>
        <arg type="VAR">Input result numeric variable</arg>
        <arg type="STR">Message to display</arg>
        <arg type="NUM">Window width (optional)</arg>
        <arg type="NUM">Window height (optional)</arg>
        <arg type="NUM">Input area width (optional)</arg>
        <arg type="NUM">Input area height (optional)</arg>
      </format>
      <description>Creates an input dialog that assigns the user's input to the given numeric variable.<br />
The character string serves as the dialog message text.<br />
The last 4 arguments may be omitted; in order they are (window size x), (window size y), (text input window size x), (text input window size y).</description>
      <related cmd="input" />
      <related cmd="inputstr" />
      <related cmd="textfield" />
    </command>

    <command name="input" type="E" category="additional">
      <scr>N</scr>
      <simple-desc>wait for player to give character input (method 2)</simple-desc>
      <format>
        <format-string desc="input (result-var), (message-str), (default-str), (max-len), (force-fullwidth:0=no/1=yes)">input $VAR,STR,STR,NUM,NUM</format-string>
        <arg type="VAR">Input result string variable</arg>
        <arg type="STR">Message to display</arg>
        <arg type="STR">Default input string</arg>
        <arg type="NUM">Maximum input length</arg>
        <arg type="NUM">Force double-byte input (0: allow half-width, 1: full-width only)</arg>
      </format>
      <description>Presents a text input box, much like <b>inputstr</b>; however, <b>input</b> must have a default character string.<br />
Depending on whether the double-byte flag is 0 or 1, you can force your user to input 2-byte characters or not.</description>
      <notice>(P)ONScripter "supports" this command by assigning the default string to the result variable.</notice>
      <related cmd="inputstr" />
      <related cmd="inputnum" />
      <related cmd="textfield" />
    </command>

    <command name="textfield" version="2.49" type="E" category="additional">
      <scr>N</scr>
      <simple-desc>create a text input window</simple-desc>
      <format>
        <format-string desc="input (result-var), (top-left X-pos), (top-left Y-pos), (bottom-right X-pos), (bottom-right Y-pos), (1byte-char-width), (char-height), (force-fullwidth:0=no/1=yes)">textfield $VAR,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="VAR">String variable that stores both the default and input result strings</arg>
        <arg type="NUM">Window top left X-coordinate</arg>
        <arg type="NUM">Window top left Y-coordinate</arg>
        <arg type="NUM">Window bottom right X-coordinate</arg>
        <arg type="NUM">Window bottom right Y-coordinate</arg>
        <arg type="NUM">Character width (single-byte)</arg>
        <arg type="NUM">Character height</arg>
        <arg type="NUM">Double-byte text (0: allow half-width, 1: full-width only)</arg>
      </format>
      <description>This creates a text input window on the screen (not a dialog box) and waits for input.<br />
The prior contents of the given string variable will be used as the default text.<br />
Input is returned by hitting the Escape, Tab or Enter keys, or by left-clicking on-screen outside the textfield area.<br />
To see if the Tab key was pressed, use <b>getret %0</b><br />
If %0 is 0, then Tab was not pressed, but if %0 is 1 then the Tab key was pressed to return input.</description>
      <example>
        <comment>Produces a text input area within (100,50) to (320,70) that takes 10x20 (half-width) characters, with forced full-width input.</comment>
        <code>textfield $0,100,50,320,70,10,20,1</code>
      </example>
      <related cmd="input" />
      <related cmd="inputstr" />
      <related cmd="inputnum" />
    </command>

    <command name="clickpos" type="E" category="additional">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the cursor coordinates at the last click</simple-desc>
      <format>
        <format-string desc="clickpos (X-pos-var), (Y-pos-var)">clickpos %VAR,%VAR</format-string>
        <arg type="VAR">X-coordinate at last click</arg>
        <arg type="VAR">Y-coordinate at last click</arg>
      </format>
      <description>Returns the position of the last click - the first variable is x, the second variable is y.</description>
    </command>

    <command name="systemcall" type="E" category="additional">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>perform a function as though called from the right-click menu</simple-desc>
      <format>
        <format-string desc="systemcall (menu-function)">systemcall NAME</format-string>
        <arg type="NAME">Menu function name</arg>
      </format>
      <description>Works identically to the system menu functions.<br />
The available function names are similar to the ones used by <b>rmenu</b>:<br />
SYSTEMCALL MENU FUNCTION NAMES:<br />
<b>skip</b> - same as "skip to next choice"<br />
<b>reset</b> - reset program<br />
<b>resetdlg</b> - same as <b>reset</b>?<br />
<b>save</b> - go to save menu<br />
<b>load</b> - go to load menu<br />
<b>lookback</b> - go to log mode<br />
<b>windowerase</b> - remove text window<br />
<b>automode</b> - automatically advance text at each clickwait (delay time set by <b>automode_time</b>)<br />
<b>rmenu</b> - opens the right-click menu<br />
<br />
If you use <b>systemcall</b> in routines like <b>select</b>/<b>selgosub</b>, then you'll end up with something not very different from the title menu.<br />
(In that case, it would probably be better to temporarily toggle off right-click menu functionality through <b>rmode</b>.)<br />
<br />
Calling <b>systemcall rmenu</b> has the same effect as calling the right-click menu itself.<br />
You'd use this when you wanted right-click menu functionality during a button wait state. Once you exit this right-click menu, the interpreter continues its execution at the command after <b>systemcall</b>.<br />
(This can leave the screen and the interpreter stack in an inconsistent state, so be careful when using this command.)</description>
      <related cmd="rmenu" />
      <related cmd="automode" />
      <related cmd="automode_time" />
    </command>

    <command name="fileexist" type="E" category="additional">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>check whether or not a file exists</simple-desc>
      <format>
        <format-string desc="fileexist (num-var), (file-name)">fileexist %VAR,STR</format-string>
        <arg type="VAR">Result for file check (1: exists, 0: not found)</arg>
        <arg type="STR">Filename</arg>
      </format>
      <description>Assigns 1 to the given variable if the file exists, 0 if not. This will also check within NSA archives.</description>
      <related cmd="fileremove" />
    </command>

    <command name="fileremove" version="(undoc)" type="E" category="additional">
      <scr>N</scr>
      <simple-desc>delete a file</simple-desc>
      <format>
        <format-string desc="fileremove (file-name)">fileremove STR</format-string>
        <arg type="STR">Filename</arg>
      </format>
      <description>Deletes the given file.</description>
      <related cmd="fileexist" />
    </command>

    <command name="labelexist" version="(undoc)" type="E" category="additional">
      <scr ver="2.20">N</scr>
      <simple-desc>check whether or not a label exists</simple-desc>
      <format>
        <format-string desc="labelexist %(result-var), *(label)">labelexist %VAR,LABEL</format-string>
        <arg type="VAR">Result for label check (1: exists, 0: not found)</arg>
        <arg type="LABEL">Label to check for</arg>
      </format>
      <description>Assigns 1 to the given variable if the label exists, 0 if not.</description>
      <example>
        <comment>Checks if "*message" routine exists, and calls it if so.</comment>
        <code>labelexist %0,*message
if %0==1 gosub *message</code>
      </example>
      <related cmd="goto" />
      <related cmd="gosub" />
    </command>

    <command name="noloaderror" version="(undoc)" type="F" category="additional">
      <scr>N</scr>
      <simple-desc>don't generate an error when an image or sound can't be loaded</simple-desc>
      <format>
        <format-string>noloaderror</format-string>
      </format>
      <description>The program won't fail with an error if a sound or image load command, such as <b>ld</b> or <b>bgm</b>, fails to load a file.</description>
      <related cmd="bg" />
      <related cmd="ld" />
      <related cmd="bgm" />
    </command>

    <command name="minimizewindow" type="E" category="additional">
      <scr ver="2.00">N</scr><scr>E</scr>
      <simple-desc>minimize the game window</simple-desc>
      <format>
        <format-string>minimizewindow</format-string>
      </format>
      <description>Minimizes the game window.</description>
    </command>

    <command name="automode" type="F" category="specialmode">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>allow use of Auto Mode</simple-desc>
      <format>
        <format-string>automode</format-string>
      </format>
      <description>This is a command developed especially for the commercial software "Gin'iro". When you use this command, you can enter Auto Mode from the menu. It is similar in concept to the "skip to next choice" option, but displays characters much more slowly (with a delay defined by automode_time). This makes it almost like a mode in which the computer reads the text to you.<br />
<br />
You can adjust sound playback volume from the NScr menus while Auto Mode is progressing (MP3(BGM), voice(DWAVE 0), and SE(DWAVE 1+) are all active and adjustable).<br />
<br />
There are future plans to add more functionality to this command, and to make things conform to predefined syntaxes.</description>
    </command>

    <command name="automode_time" type="F" category="specialmode">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify delay time in Auto Mode when sounds aren't being played</simple-desc>
      <format>
        <format-string desc="automode_time (delay-time)">automode_time NUM</format-string>
        <arg type="NUM">Wait time during Auto Mode (msec)</arg>
      </format>
      <description>When in Auto Mode (as defined by mode_ext), and when text display is not instantaneous, this sets the delay at clickwaits in milliseconds.</description>
    </command>

    <command name="defvoicevol" type="F" category="specialmode">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set default volume for voices (dwave channel 0)</simple-desc>
      <format>
        <format-string desc="defvoicevol (default-vol)">defvoicevol NUM</format-string>
        <arg type="NUM">Default volume (0 - 100)</arg>
      </format>
      <description>Sets default volume for voices (DWAVE 0). Ranges from 0 to 100. Default value is 100.</description>
    </command>

    <command name="defsevol" type="F" category="specialmode">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set default volume for SFX</simple-desc>
      <format>
        <format-string desc="defsevol (default-vol)">defsevol NUM</format-string>
        <arg type="NUM">Default volume (0 - 100)</arg>
      </format>
      <description>Sets default volume for sound effects (DWAVE 1+). Ranges from 0 to 100. Is 100 by default.</description>
    </command>

    <command name="defmp3vol" type="F" category="specialmode">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set default volume for mp3 files (BGM channel)</simple-desc>
      <format>
        <format-string desc="defmp3vol (default-vol)">defmp3vol NUM</format-string>
        <arg type="NUM">Default volume (0 - 100)</arg>
      </format>
      <description>Sets the default volume for mp3s (BGM), from a range of 0-100. Is 100 by default.</description>
    </command>

    <command name="defbgmvol" type="F" category="specialmode">
      <scr ver="2.37">N</scr><scr>E</scr>
      <simple-desc>set default volume for BGM channel</simple-desc>
      <format>
        <format-string desc="defbgmvol (default-vol)">defbgmvol NUM</format-string>
        <arg type="NUM">Default volume (0 - 100)</arg>
      </format>
      <description>Sets the default volume for BGM, from a range of 0-100. Is 100 by default.</description>
    </command>

    <command name="mode_saya" type="F" category="specialmode">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>use special mode created for "Saya ~Labyrinth of Immorality~"</simple-desc>
      <format>
        <format-string>mode_saya</format-string>
      </format>
      <description>A command mode written especially for the doujin game, "Saya ~Labyrinth of Immorality~". Once you specify this command, you enter: the legendary Saya Mode!<br />
In Saya mode, when the text window disappears:<br />
<br />
<indent />* Sprites 0-9 also disappear, regardless of whether they're flagged to be visible or not.<br />
<indent />* Bars and numbers indicating status underneath the text window also disappear.<br />
<br />
You would use this, for instance, when you had a parameter status window that you wanted to hide when the text window disappeared.</description>
    </command>

    <command name="mode_ext" type="F" category="specialmode">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>allow use of Auto Mode created for "Gin'iro"</simple-desc>
      <format>
        <format-string>mode_ext</format-string>
      </format>
      <description>This is a command developed especially for the commercial software "Gin'iro". When you use this command, you can enter Auto Mode from the menu. It is similar in concept to the "skip to next choice" option, but displays characters much more slowly (with a delay defined by automode_time). This makes it almost like a mode in which the computer reads the text to you.<br />
<br />
You can adjust sound playback volume from the NScr menus while Auto Mode is progressing (MP3(BGM), voice(DWAVE 0), and SE(DWAVE 1+) are all active and adjustable).<br />
<br />
There are future plans to add more functionality to this command, and to make things conform to predefined syntaxes.</description>
    </command>

    <command name="mode800" type="F" category="specialmode">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set screen size to 800x600</simple-desc>
      <format>
        <format-string>;mode800</format-string>
      </format>
      <description>Enables 800x600 screen mode (yes, the ';' in the beginning is necessary!). This command must be the first line in the script - even above <b>*define</b>.</description>
      <notice>Even when this command is used, the text window is still sized as for 640x480. Therefore, you will need to adjust it with <b>setwindow</b>.</notice>
      <example>
        <comment>Sets the game screen size to 800x600.</comment>
        <code>;mode800
*define</code>
      </example>
      <related cmd="mode400" />
      <related cmd="mode320" />
      <related cmd="value" />
    </command>

    <command name="mode400" type="F" category="specialmode">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set screen size to 400x300</simple-desc>
      <format>
        <format-string>;mode400</format-string>
      </format>
      <description>Enables 400x300 screen mode. This command must be the first line in the script - even above <b>*define</b>.</description>
      <notice>Even when this command is used, the text window is still sized as for 640x480. Therefore, you will need to adjust it with <b>setwindow</b>.</notice>
      <example>
        <comment>Sets the game screen size to 400x300.</comment>
        <code>;mode400
*define</code>
      </example>
      <related cmd="mode800" />
      <related cmd="mode320" />
      <related cmd="value" />
    </command>

    <command name="mode320" type="F" category="specialmode">
      <scr ver="2.01">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set screen size to 320x240</simple-desc>
      <format>
        <format-string>;mode320</format-string>
      </format>
      <description>Enables 320x240 screen mode. This command must be the first line in the script - even above <b>*define</b>.</description>
      <notice>Even when this command is used, the text window is still sized as for 640x480. Therefore, you will need to adjust it with <b>setwindow</b>.</notice>
      <example>
        <comment>Sets the game screen size to 320x240.</comment>
        <code>;mode320
*define</code>
      </example>
      <related cmd="mode800" />
      <related cmd="mode400" />
      <related cmd="value" />
    </command>

    <command name="value" type="S" category="specialmode">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change the starting number for global variables</simple-desc>
      <format>
        <format-string desc=";value(global-start-num)">';value'NUM</format-string>
        <arg type="NUM">Global variable start boundary (0 - 4000)</arg>
      </format>
      <description>If a script file has ";value500" as the first line, then this will set the starting number for global variables to 500.<br />
To also change the window size mode, say to 800x600, use ";mode800,value500" as the first line of the script.</description>
      <notice>If you use ";mode640,value500" as the first line of a script, then since ";mode640" is not a valid directive, the "value" setting will also be ignored. (by BBS)</notice>
      <example>
        <comment>Sets the starting global variable number to 500.</comment>
        <code>;value500
*define</code>
      </example>
      <related cmd="mode800" />
      <related cmd="mode400" />
      <related cmd="mode320" />
    </command>

    <command name="gameid" type="F" category="specialmode">
      <scr>E</scr><scr>P</scr>
      <simple-desc>give a name to use for an ONScr game save folder</simple-desc>
      <format>
        <format-string desc=";gameid (game-id)">';gameid' STR</format-string>
        <arg type="STR">Name to use for the game save folder</arg>
      </format>
      <description>Sets a name to use for a (P)ONScripter game savedata folder, which is filed in AppData (or similar applicable directory for non-Windows operating systems).<br />
If a <b>gameid</b> is not specified, (P)Onscripter creates a savedata folder name from a hash of the game script.</description>
      <notice>Since a <b>;mode</b> directive must be in the first line of a script, a <b>;gameid</b> directive must be in the <b>second</b> line - no exceptions! (by Mion)</notice>
      <example type="O">
        <comment>Sets the game folder name to "ToHeart-Extra".</comment>
        <code>
;gameid ToHeart-Extra</code>
      </example>
    </command>

    <command name="soundpressplgin" type="F" category="plugin_archive">
      <scr>N</scr>
      <simple-desc>load compressed audio functionality via plugin/dll (can just use DirectSound instead)</simple-desc>
      <format>
        <format-string desc="soundpressplgin (sound-plugin-spec)">soundpressplgin STR</format-string>
        <arg type="STR">Plugin specification</arg>
      </format>
      <description>Using this, you can designate a dll file with which to decode other kinds of compressed sound files that are not mp3s. The character string format is "plugin-name|3-char-file-extension".</description>
      <example>
        <comment>This specifies using "nbzplgin.dll" to open *.nbz sound files.</comment>
        <code>soundpressplgin "nbzplgin.dll|nbz"</code>
      </example>
    </command>

    <command name="spi" type="F" category="plugin_archive">
      <scr>N</scr>
      <simple-desc>load compressed image functionality via plugin/dll</simple-desc>
      <format>
        <format-string desc="spi (image-plugin-spec)">spi STR</format-string>
        <arg type="STR">Plugin specification</arg>
      </format>
      <description>Allows for utilization of image compression plugin dll's - image filetypes that are not supported in standard NScripter. The character string format is "plugin-dll-name|file-extension".</description>
      <example>
        <comment>This specifies using "jpgplgin.dll" to open *.jpg files, and "iflf2.spi" to open *.lf2 files.</comment>
        <code>spi "jpgplgin.dll|jpg"
spi "iflf2.spi|lf2"</code>
      </example>
    </command>

    <command name="arc" type="F" category="plugin_archive">
      <scr>N</scr>
      <simple-desc>use specified archive</simple-desc>
      <format>
        <format-string desc="arc (archive-plugin-spec)">arc STR</format-string>
        <arg type="STR">Plugin specification</arg>
      </format>
      <description>Designate an archive decompression plugin.<br />
The character string's form is "archive-name|plugin-dll-name".<br />
Although this can dearchive sounds, music, and images, it will not run archived scripts.<br />
<br />
By combining this with registry read commands, you can do many things. For instance, as in the second example below, you could easily read the Windows registry, find out that the machine had "To Heart" installed, and designate the proper archive to decompress accordingly.</description>
      <example>
        <comment>This specifies using "scrunarc.dll" to open an "arc.sar" archive file.</comment>
        <code>arc "arc.sar|scrunarc.dll"</code>
      </example>
      <example>
        <comment>This specifies the archive file and plugin for "To Heart", using registry data.</comment>
        <code>getreg $0,"software\leaf\toheart","datadir"
add $0,"\lvns3dat.pak|axlfpak.spi"
arc $0</code>
      </example>
    </command>

    <command name="nsa" type="F" category="plugin_archive">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enable NSA archive access</simple-desc>
      <format>
        <format-string>nsa</format-string>
      </format>
      <description>Allows for NSA archive mode. In this mode, resources such as BMPs may be read from nsa*.arc, located in the same directory as the executable itself. The nsa*.arc files themselves are generated by nsaarc.exe, which can be found in the NScr SDK.<br />
<br />
Please note that you may consecutively name files as arc.nsa, arc1.nsa, arc2.nsa ... arc9.nsa, and for the purposes of the interpreter, they will all be considered as part of the same namespace - like one big archive. You may use this to quickly unpackage and repackage archives for testing.</description>
    </command>

    <command name="nsadir" type="F" category="plugin_archive">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate folder where NSA archives are located</simple-desc>
      <format>
        <format-string desc="nsadir (folder-name)">nsadir STR</format-string>
        <arg type="STR">Directory to be read for NSA archives</arg>
      </format>
      <description>Sets the folder search path for nsa archives. By default, this is the same directory where the executable resides.</description>
    </command>

    <command name="addnsadir" type="FE" category="plugin_archive">
      <scr ver="2.20">N</scr><scr>E</scr>
      <simple-desc>add a directory to check for NSA archives</simple-desc>
      <format>
        <format-string desc="addnsadir (folder-name)">addnsadir STR</format-string>
        <arg type="STR">Directory to check for NSA archives</arg>
      </format>
      <description>Adds a directory to check for NSA archives.</description>
      <related cmd="nsadir" />
    </command>

    <command name="exec_dll" type="FE" category="plugin_archive">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>call a DLL</simple-desc>
      <format>
        <format-string desc="exec_dll (DLL-file/param-str)">exec_dll STR</format-string>
        <arg type="STR">DLL filename followed by parameters</arg>
      </format>
      <description>Calls the given DLL with the specified parameters.</description>
      <notice>(P)ONScripter recognizes this command but does a value lookup in a text file called "dll.txt" using the DLL name and parameters, instead of calling an actual DLL; note that this is more a crutch than an implementation. (by Mion)</notice>
      <example>
        <comment>Calls "execdll.dll" with the parameter string "テストですよー。".</comment>
        <code>exec_dll "execdll.dll/テストですよー。"</code>
      </example>
    </command>

    <command name="getret" type="FE" category="plugin_archive">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve value returned from a DLL</simple-desc>
      <format>
        <format-string desc="getret (result-var)">getret %VAR|$VAR</format-string>
        <arg type="VAR">Variable to hold either a numeric or string value returned by a DLL</arg>
      </format>
      <description>Retrieves a value returned from a DLL call via <b>exec_dll</b>. Numeric and string values may be collected separately.<br />
This command may also be used to retrieve a value returned by <b>textfield</b> or a call to <b>layermessage</b>.</description>
      <related cmd="exec_dll" />
      <related cmd="textfield" />
      <related cmd="layermessage" />
    </command>

    <command name="setlayer" type="F" category="plugin_archive">
      <scr ver="2.03">N</scr><scr ver="20090411">E</scr>
      <simple-desc>create a layer</simple-desc>
      <format>
        <format-string desc="setlayer (layer-num), (update-interval), (DLL-file)">setlayer NUM,NUM,STR</format-string>
        <arg type="NUM">Layer number</arg>
        <arg type="NUM">Layer update interval (msec)</arg>
        <arg type="STR">DLL filename</arg>
      </format>
      <description>This registers a layer number for a particular plugin DLL.<br />
Messages may be sent to the plugin via <b>layermessage</b>.</description>
      <notice>At present, ONScripter-EN supports the following "plugin-based" layer effects (originally created by Takashi Toyama), via emulation: "hana.dll", "oldmovie.dll", and "snow.dll". (by Mion)</notice>
      <related cmd="layermessage" />
    </command>

    <command name="layermessage" type="E" category="plugin_archive">
      <scr ver="2.03">N</scr><scr ver="20090411">E</scr>
      <simple-desc>send a message to a layer</simple-desc>
      <format>
        <format-string desc="setlayer (layer-num), (message-str)">setlayer NUM,STR</format-string>
        <arg type="NUM">Layer number (defined using <b>setlayer</b>)</arg>
        <arg type="STR">Message to send to the layer</arg>
      </format>
      <description>An arbitrary character string is sent to the specified layer.<br />
This command can be useful for achieving various effects within a layer.<br />
To use this command, a layer plugin should export a function with this declaration:<br />
<indent />BOOL Message(char *message, int *returnint, char *returnstr);</description>
      <related cmd="setlayer" />
    </command>

    <command name="versionstr" type="F" category="information">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change the version information</simple-desc>
      <format>
        <format-string desc="versionstr (first-line), (second-line)">versionstr STR,STR</format-string>
        <arg type="STR">First line of version string</arg>
        <arg type="STR">Second line of version string</arg>
      </format>
      <description>Designates version strings to display in the "about" dialog. The first string is the first line, the second string is the second line.</description>
    </command>

    <command name="caption" type="FE" category="information">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change the game window title</simple-desc>
      <format>
        <format-string desc="caption (title-str)">caption STR</format-string>
        <arg type="STR">String to use for the window title</arg>
      </format>
      <description>Sets the window title.</description>
    </command>

    <command name="date" type="E" category="getinfo">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the current year, month and date</simple-desc>
      <format>
        <format-string desc="date (year-var), (month-var), (date-var)">date %VAR,%VAR,%VAR</format-string>
        <arg type="VAR">Numeric variable for the retrieved year</arg>
        <arg type="VAR">Numeric variable for the retrieved month</arg>
        <arg type="VAR">Numeric variable for the retrieved date</arg>
      </format>
      <description>Retrieves the current date, in numeric values.</description>
    </command>

    <command name="time" type="E" category="getinfo">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the current hour, minute and second</simple-desc>
      <format>
        <format-string desc="time (hour-var), (minute-var), (second-var)">time %VAR,%VAR,%VAR</format-string>
        <arg type="VAR">Numeric variable for the retrieved hour</arg>
        <arg type="VAR">Numeric variable for the retrieved minute</arg>
        <arg type="VAR">Numeric variable for the retrieved second</arg>
      </format>
      <description>Retrieves the current time.</description>
    </command>

    <command name="savetime" type="E" category="getinfo">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the date and time of the given savefile</simple-desc>
      <format>
        <format-string desc="savetime (save-num), (month-var), (date-var), (hour-var), (minute-var)">savetime NUM,%VAR,%VAR,%VAR,%VAR</format-string>
        <arg type="NUM">Savefile number</arg>
        <arg type="VAR">Numeric variable for the save month</arg>
        <arg type="VAR">Numeric variable for the save date</arg>
        <arg type="VAR">Numeric variable for the save hour</arg>
        <arg type="VAR">Numeric variable for the save minute</arg>
      </format>
      <description>Gets the month, day, hour of the day, and minutes of the hour in which a particular save was recorded.<br />
If the save file does not exist, then the %month parameter is set to 0.</description>
      <example>
        <comment>Retrieves the save time and date of savefile 3, or else explains that the savefile was not found.</comment>
        <code>savetime 3,%0,%1,%2,%3
if %0=0 goto *non
;save found
セーブ３番は%0月%1日%2時%3分@
end
*non
;save not found
セーブ３番は存在しない。@
end</code>
      </example>
    </command>

    <command name="getversion" type="E" category="getinfo">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the version number of the current NScripter build</simple-desc>
      <format>
        <format-string desc="getversion (num-var)">getversion %VAR</format-string>
        <arg type="VAR">Numeric variable for the current NScr version</arg>
      </format>
      <description>Gets the current version string, as a 3-digit number: for instance. version 1.90 would be returned as 190.</description>
    </command>

    <command name="getwindowsize" version="2.54" type="E" category="getinfo">
      <scr>N</scr>
      <simple-desc>get the area of the window client</simple-desc>
      <format>
        <format-string desc="getwindowsize (width-var), (height-var)">getwindowsize %VAR,%VAR</format-string>
        <arg type="VAR">Numeric variable for window width</arg>
        <arg type="VAR">Numeric variable for window height</arg>
      </format>
      <description>Retrieves the size of the program window (the drawing area, not including the menubar). By default, the return values are 640 and 480.</description>
      <example>
        <comment>Assign the screen window width to %0 and height to %1.</comment>
        <code>getwindowsize %0,%1</code>
      </example>
    </command>

    <command name="getreg" type="FE" category="getinfo">
      <scr>N</scr>
      <simple-desc>read from the registry</simple-desc>
      <format>
        <format-string desc="getreg (str-var), (key-str), (variable-str)">getreg $VAR,STR,STR</format-string>
        <arg type="VAR">String variable for the registry key/value result</arg>
        <arg type="STR">A registry key</arg>
        <arg type="STR">A registry variable</arg>
      </format>
      <description>Opens the Windows registry and queries for a variable.<br />
Will search only in HKEY_CURRENT_USER.</description>
      <example>
        <code>getreg $0,"software\leaf\toheart","datadir"</code>
      </example>
    </command>

    <command name="getini" type="FE" category="getinfo">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>read from an ini file</simple-desc>
      <format>
        <format-string desc="getini (str-var), (ini-file), (section-str), (key-str)">getini $VAR,STR,STR,STR</format-string>
        <arg type="VAR">String variable for the registry key/value result</arg>
        <arg type="STR">An INI filename</arg>
        <arg type="STR">INI section name</arg>
        <arg type="STR">INI key name</arg>
      </format>
      <description>Opens an ini file and reads a variable.</description>
    </command>

    <command name="readfile" version="2.40" type="FE" category="getinfo">
      <scr>N</scr>
      <simple-desc>read file contents into a string variable</simple-desc>
      <format>
        <format-string desc="readfile $(result-var), (filename)">readfile $VAR,STR</format-string>
        <arg type="VAR">String variable for the file read result</arg>
        <arg type="STR">A text filename</arg>
      </format>
      <description>Reads the contents of the given file into the given string variable.</description>
      <notice>Note that this also reads CRLF (\x0d\x0a) line endings; when writing multiple lines to a file that will be processed with <b>readfile</b>, these ending bytes must be skipped since relative operators cannot process CR or LF.<br />
Also, since calling <b>readfile</b> does not affect the file log, <b>fchk</b> cannot be used to determine if the file was read.</notice>
      <example>
        <comment>Reads the contents of "file.txt" into $0.</comment>
        <code>readfile $0,"file.txt"</code>
      </example>
      <related cmd="split" />
    </command>

    <command name="killmenu" type="F" category="windowmenu">
      <scr>N</scr>
      <simple-desc>erase a menubar item</simple-desc>
      <format>
        <format-string desc="killmenu (item-pos)">killmenu NUM</format-string>
        <arg type="NUM">Position of erased menu item</arg>
      </format>
      <description>This deletes menu items, counted from left to right.<br />
0 is the leftmost item number, with each item to the right incrementing in number.<br />
Once you have deleted a menu item, the numbers for all menu items after it shift down one, so please be careful.</description>
      <notice>For some reason, menu item "CD-DA" always starts with number 7.<br />
Similarly, menu items "Version Info" and "Exit" start as numbers 8 and 9, respectively.</notice>
    </command>

    <command name="resetmenu" version="1.98" type="F" category="windowmenu">
      <scr>N</scr>
      <simple-desc>clear menubar for definition of a custom menu</simple-desc>
      <format>
        <format-string>resetmenu</format-string>
      </format>
      <description>Declares creation of a custom menubar. Add menu items after this command using <b>insertmenu</b>.</description>
      <related cmd="killmenu" />
      <related cmd="insertmenu" />
      <related cmd="deletemenu" />
    </command>

    <command name="insertmenu" version="1.98" type="F" category="windowmenu">
      <scr>N</scr>
      <simple-desc>add a menubar menu option</simple-desc>
      <format>
        <format-string desc="insertmenu (str), (function-code)[, (level)]">insertmenu STR,NAME[,NUM]</format-string>
        <arg type="STR">Character string displayed for menu item</arg>
        <arg type="NAME">Menu function code</arg>
        <arg type="NUM">Submenu level (optional)</arg>
      </format>
      <description>Adds a menubar item. It always adds at the head position.</description>
      <example>
        <comment>Creates a full menu, arranged differently from the default.</comment>
        <code>insertmenu "終了",END
insertmenu "バージョン情報",VERSION
insertmenu "次の選択肢に進む",SKIP
insertmenu "オートモード",AUTO
insertmenu "環境設定",SUB
;SUB indicates the top of a submenu, which will contain following items of deeper level.
;This one contains everything that follows.
insertmenu "フォント",FONT,1
insertmenu "ウェーブ",SUB,1
insertmenu "ＯＮ",WAVEON,2
insertmenu "ＯＦＦ",WAVEOFF,2
insertmenu "ボリューム",DWAVEVOLUME,2
insertmenu "テキスト",SUB,1
insertmenu "遅い",TEXTSLOW,2
insertmenu "普通",TEXTMIDDLE,2
insertmenu "速い",TEXTFAST,2
insertmenu "画面",SUB,1
insertmenu "フルスクリーン",FULL,2
insertmenu "ウィンドウ",WINDOW,2
insertmenu "ＣＤ－ＤＡ",SUB,1
insertmenu "ＯＮ",CDON,2
insertmenu "ＯＦＦ",CDOFF,2
insertmenu "クリック設定",SUB,1
insertmenu "普通",CLICKDEF,2
insertmenu "ページごと",CLICKPAGE,2</code>
      </example>
      <related cmd="killmenu" />
      <related cmd="resetmenu" />
      <related cmd="deletemenu" />
    </command>

    <command name="deletemenu" version="2.03" type="F" category="windowmenu">
      <scr>N</scr>
      <simple-desc>remove the Windows menubar from NScripter</simple-desc>
      <format>
        <format-string>deletemenu</format-string>
      </format>
      <description>Completely removes the Windows menubar from NScripter.</description>
      <related cmd="killmenu" />
      <related cmd="resetmenu" />
      <related cmd="insertmenu" />
    </command>

    <command name="defaultspeed" type="F" category="windowmenu">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>designate text display speeds selectable via the menubar</simple-desc>
      <format>
        <format-string desc="defaultspeed (slow), (medium), (fast)">defaultspeed NUM,NUM,NUM</format-string>
        <arg type="NUM">Slow default text display speed</arg>
        <arg type="NUM">Medium default text display speed</arg>
        <arg type="NUM">Fast default text display speed</arg>
      </format>
      <description>Designate text speeds (character delays, in msec) to use when the interpreter encounters <b>textspeeddefault</b> or the special text command <b>!sd</b>.<br />
From left to right, the numbers correspond to 低速(Slow), 普通(Medium), and 高速(Fast) in the textspeed menu.</description>
      <notice>Although (P)ONScripter does not provide a menubar, you can select among the textspeeds using keystrokes: '1' for slow, '2' for medium, '3' for fast, and '0' to toggle between all three.</notice>
      <example>
        <comment>Sets the default text speeds as 50 for "Slow", 20 for "Medium", and 0 for "Fast".</comment>
        <code>defaultspeed 50,20,0</code>
      </example>
      <related cmd="!sd" />
      <related cmd="textspeeddefault" />
    </command>

    <command name="!sd" id="bang-sd" type="T" category="windowmenu">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>use a text display speed provided via <b>defaultspeed</b></simple-desc>
      <format>
        <format-string>!sd</format-string>
      </format>
      <description>Sets text display to the current default speed. You may set the three possible default speeds with the <b>defaultspeed</b> command.</description>
      <related cmd="defaultspeed" />
    </command>

    <command name="menu_full" type="E" category="windowmenu">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter fullscreen mode</simple-desc>
      <format>
        <format-string>menu_full</format-string>
      </format>
      <description>Enters fullscreen mode.</description>
      <related cmd="menu_window" />
      <related cmd="isfull" />
    </command>

    <command name="menu_window" type="E" category="windowmenu">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter windowed mode</simple-desc>
      <format>
        <format-string>menu_window</format-string>
      </format>
      <description>Enters windowed mode.</description>
      <related cmd="menu_full" />
      <related cmd="isfull" />
    </command>

    <command name="isfull" type="E" category="windowmenu">
      <scr ver="2.03">N</scr><scr>E</scr>
      <simple-desc>retrieve whether or not fullscreen mode is active</simple-desc>
      <format>
        <format-string desc="isfull %(result-var)">isfull %VAR</format-string>
        <arg type="VAR">Result numeric variable (0: windowed, 1: full-screen)</arg>
      </format>
      <description>Retrieves the current full-screen status (full or windowed).</description>
      <example>
        <comment>This checks whether the program is in fullscreen mode - if not, it enters fullscreen mode, otherwise it goes to windowed mode.</comment>
        <code>isfull %0
if %0==0 menu_full
notif %0==0 menu_window</code>
      </example>
      <related cmd="menu_full" />
      <related cmd="menu_window" />
    </command>

    <command name="menu_click_page" type="E" category="windowmenu">
      <scr>N</scr><scr>E</scr>
      <simple-desc>enter single-page text display mode</simple-desc>
      <format>
        <format-string>menu_click_page</format-string>
      </format>
      <description>Enters single-page text display mode, as provided via the 表示形式(Display Format) menubar item.</description>
      <notice>This and <b>menu_click_def</b> affect what *ONScripter provides as "page-at-once" mode, using 'o' keystroke toggle. (by Mion)</notice>
      <related cmd="menu_click_def" />
    </command>

    <command name="menu_click_def" type="E" category="windowmenu">
      <scr>N</scr><scr>E</scr>
      <simple-desc>enter default text display mode</simple-desc>
      <format>
        <format-string>menu_click_def</format-string>
      </format>
      <description>Enters default text display (not single-page) mode; see <b>menu_click_page</b>.</description>
      <related cmd="menu_click_page" />
    </command>

    <command name="menu_dwavvol" version="1.97" type="E" category="windowmenu">
      <scr>N</scr>
      <simple-desc>display the volume setting dialog window</simple-desc>
      <format>
        <format-string>menu_dwavvol</format-string>
      </format>
      <description>Displays the volume change dialog box.</description>
      <related cmd="mp3vol" />
      <related cmd="voicevol" />
      <related cmd="sevol" />
      <related cmd="bgmvol" />
    </command>

    <command name="menu_waveon" type="E" category="windowmenu">
      <scr ver="20091230">E</scr>
      <simple-desc>enable main volume</simple-desc>
      <format>
        <format-string>menu_waveon</format-string>
      </format>
      <description>Enables main volume (turning off volume mute, if set).</description>
      <related cmd="menu_waveoff" />
    </command>

    <command name="menu_waveoff" type="E" category="windowmenu">
      <scr ver="20091230">E</scr>
      <simple-desc>disable (mute) main volume</simple-desc>
      <format>
        <format-string>menu_waveoff</format-string>
      </format>
      <description>Disables (or mutes) main volume.</description>
      <related cmd="menu_waveon" />
    </command>

    <command name="*customsel" id="customsel-label" type="S" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>a label that interacts with the <b>csel</b> command</simple-desc>
      <format>
        <format-string>*customsel</format-string>
      </format>
      <description>Jumps to this label whenever a <b>csel</b> command is executed.<br />
Code for handling a custom select display follows this label.</description>
      <example>
        <comment>This defines handling routines for <b>csel</b>.</comment>
        <code>*customsel
skipoff
*csel_st
btndef clear
getcselnum %0
getcursorpos %1,%2
cselbtn 0,500,%1,%2
add %2,21
cselbtn 1,501,%1,%2
if %0>2 add %2,21:cselbtn 2,502,%1,%2
if %0>3 add %2,21:cselbtn 3,503,%1,%2
if %0>4 add %2,21:cselbtn 4,504,%1,%2

*csel_loop
selectbtnwait %0
if %0=-2 systemcall lookback:goto *csel_loop
if %0=-1 gosub *rclk:goto *csel_st
if %0&gt;=500 &amp; %0&lt;=504 saveon:sub %0,500:cselgoto %0
goto *csel_loop
</code>
      </example>
      <related cmd="csel" />
      <related cmd="cselbtn" />
      <related cmd="cselgoto" />
      <related cmd="getcselnum" />
      <related cmd="getcselstr" />
      <related cmd="selectbtnwait" />
    </command>

    <command name="csel" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>give choices to present via system customization</simple-desc>
      <format>
        <format-string desc="csel (choice-str), (label), [...]">csel STR,LABEL[,STR,LABEL[,...]]</format-string>
        <arg type="LABEL">Choice string to display</arg>
        <arg type="LABEL">Choice select destination</arg>
      </format>
      <description>Sets a selection of choices to display using system customization. <b>*customsel</b> is called to handle the customized display. This command uses the same syntax as <b>select</b>.</description>
      <example>
        <comment>Sets up a customized selection where "Choice１" goes to *s1, "Choice２" goes to *s2, and "Choice３" goes to *s3.</comment>
        <code>csel "Choice１",*s1,"Choice２",*s2,"Choice３",*s3</code>
      </example>
      <related cmd="*customsel" />
      <related cmd="cselbtn" />
      <related cmd="cselgoto" />
      <related cmd="getcselnum" />
      <related cmd="getcselstr" />
      <related cmd="selectbtnwait" />
    </command>

    <command name="cselbtn" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create custom buttons for choice text</simple-desc>
      <format>
        <format-string desc="cselbtn (choice-index), (button-num), (X-pos), (Y-pos)">cselbtn NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Choice index number (starting at 0)</arg>
        <arg type="LABEL">Top-left X-coordinate</arg>
        <arg type="LABEL">Top-left Y-coordinate</arg>
      </format>
      <description>Creates a button from the text of the given choice number - no need to specify the string or sprite number.</description>
      <notice>Giving coordinates that are not within the text window will cause an error. It is necessary to use <b>getcselstr</b> and a different button command to display the choice text outside the text window. (by senzogawa)</notice>
      <example>
        <comment>Displays the first choice string as button 500 at position (%1,%2).</comment>
        <code>cselbtn 0,500,%1,%2</code>
      </example>
      <related cmd="csel" />
      <related cmd="*customsel" />
      <related cmd="cselgoto" />
      <related cmd="getcselnum" />
      <related cmd="getcselstr" />
      <related cmd="selectbtnwait" />
    </command>

    <command name="cselgoto" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>jump to a label created by <b>csel</b></simple-desc>
      <format>
        <format-string desc="cselgoto (choice-index)">cselgoto NUM</format-string>
        <arg type="NUM">Choice index number (starting at 0)</arg>
      </format>
      <description>Jumps to the label of the given choice index set by <b>csel</b>.</description>
      <example>
        <comment>Jumps to the choice label indexed by the number in %0.</comment>
        <code>cselgoto %0</code>
      </example>
      <related cmd="csel" />
      <related cmd="*customsel" />
      <related cmd="cselbtn" />
      <related cmd="getcselnum" />
      <related cmd="getcselstr" />
      <related cmd="selectbtnwait" />
    </command>

    <command name="getcselnum" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the total number of <b>csel</b> choices</simple-desc>
      <format>
        <format-string desc="getcselnum (num-var)">getcselnum %VAR</format-string>
        <arg type="VAR">Numeric variable for total number of choices</arg>
      </format>
      <description>Retrieves the total number of <b>csel</b> choices.</description>
      <notice>If you retrieve value %n with this command, be sure not to give a value greater than %n-1 as the choice index for <b>cselbtn</b>. (by senzogawa)</notice>
      <example>
        <comment>Assigns the total number of <b>csel</b> choices to %0.</comment>
        <code>getcselnum %0</code>
      </example>
      <related cmd="csel" />
      <related cmd="*customsel" />
      <related cmd="getcselnum" />
      <related cmd="cselgoto" />
      <related cmd="getcselstr" />
      <related cmd="selectbtnwait" />
    </command>

    <command name="getcselstr" type="E" category="systemcustomize">
      <scr ver="2.34">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the character string of a <b>csel</b> choice</simple-desc>
      <format>
        <format-string desc="getcselstr $(result-var), (choice-index)">getcselstr $VAR,NUM</format-string>
        <arg type="VAR">String variable for choice</arg>
        <arg type="NUM">Index number of the desired choice string</arg>
      </format>
      <description>Acquires a character string given as a <b>csel</b> choice.</description>
      <example>
        <comment>Grabs the 0th (first) choice string provided by <b>csel</b> and assigns it to $0.</comment>
        <code>getcselstr $0,0</code>
      </example>
      <related cmd="csel" />
    </command>

    <command name="nextcsel" version="2.80" type="E" category="systemcustomize">
      <scr>N</scr>
      <simple-desc>returns whether or not the next command is <b>csel</b></simple-desc>
      <format>
        <format-string desc="getcselstr %(result-var)">nextcsel %VAR</format-string>
        <arg type="VAR">Numeric result variable (1: next cmd is <b>csel</b>, 0: not <b>csel</b></arg>
      </format>
      <description>Returns 1 if the next command is <b>csel</b>, 0 otherwise. This may be useful in displaying choices without erasing text.</description>
      <related cmd="csel" />
      <related cmd="*customsel" />
    </command>

    <command name="selectbtnwait" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter click wait state within a <b>*customsel</b></simple-desc>
      <format>
        <format-string desc="selectbtnwait (num-var)">selectbtnwait %VAR</format-string>
        <arg type="VAR">Numeric variable for button number</arg>
      </format>
      <description>Waits for a click during a <b>*customsel</b> routine.</description>
      <example>
        <comment>Waits for a click and assigns the clicked button number to %0.</comment>
        <code>selectbtnwait %0</code>
      </example>
      <related cmd="csel" />
      <related cmd="*customsel" />
      <related cmd="getcselnum" />
      <related cmd="cselgoto" />
      <related cmd="getcselnum" />
      <related cmd="getcselstr" />
    </command>

    <command name="textgosub" type="F" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>define a label for handling system customization during click wait states</simple-desc>
      <format>
        <format-string desc="textgosub (custom-wait-label)">textgosub LABEL</format-string>
        <arg type="LABEL">Label called at clickwaits</arg>
      </format>
      <description>Defines a label to jump to at click waits for system customization. The routine named by this label must handle all system menus, cursors, buttons, and user input during these wait states.</description>
      <example>
        <comment>Sets to jump to "*text_1b" at clickwaits.</comment>
        <code>textgosub *text_lb</code>
      </example>
      <related cmd="textbtnwait" />
      <related cmd="texec" />
      <related cmd="getcursorpos" />
    </command>

    <command name="textbtnwait" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter click wait state within a custom wait routine</simple-desc>
      <format>
        <format-string desc="textbtnwait (num-var)">textbtnwait %VAR</format-string>
        <arg type="VAR">Numeric variable for button number</arg>
      </format>
      <description>Waits for a click during a custom wait routine, as defined by <b>textgosub</b>.</description>
      <example>
        <comment>Waits for a click and assigns the clicked button number to %0.</comment>
        <code>textbtnwait %0</code>
      </example>
      <related cmd="textgosub" />
      <related cmd="texec" />
      <related cmd="getcursorpos" />
    </command>

    <command name="getskipoff" type="E" category="systemcustomize">
      <scr ver="2.49">N</scr><scr ver="20091230">E</scr>
      <simple-desc>retrieve skipoff keystrokes at <b>textbtnwait</b></simple-desc>
      <format>
        <format-string>getskipoff</format-string>
      </format>
      <description>Set this between <b>btndef</b> and <b>textbtnwait</b> to collect skipoff keystrokes during the wait.
<b>textbtnwait</b> will return -60 if skip mode off is requested, -61 if auto mode off.</description>
      <example>
        <comment>This will wait for user input and call *clearskipicon if skip mode off was requested.</comment>
        <code>btndef clear
getskipoff
textbtnwait %0
if %0=-60 gosub *clearskipicon</code>
      </example>
      <related cmd="btndef" />
      <related cmd="textbtnwait" />
    </command>

    <command name="getmouseover" type="E" category="systemcustomize">
      <scr ver="2.49">N</scr><scr ver="20091122">E</scr>
      <simple-desc>return on mouseover of buttons at a button wait</simple-desc>
      <format>
        <format-string>getmouseover</format-string>
        <format-string desc="getmouseover (min-button-num), (max-button-num)">getmouseover NUM,NUM</format-string>
        <arg type="NUM">Minimum button number to return mouseovers</arg>
        <arg type="NUM">Maximum button number to return mouseovers</arg>
      </format>
      <description>Set this between <b>btndef</b> and <b>btnwait</b> to collect button mouseovers during the wait.<br />
It will only exit the btnloop for mouseovers of buttons within the given range, returning the applicable button number.</description>
      <example>
        <comment>This will wait and return if any of buttons 0-9 are moused over.</comment>
        <code>btndef clear
getmouseover 0,9
btnwait %0</code>
      </example>
      <related cmd="btndef" />
      <related cmd="btnwait" />
    </command>

    <command name="checkkey" type="E" category="systemcustomize">
      <scr ver="2.92">N</scr><scr ver="20091230">E</scr>
      <simple-desc>check for a specified keypress</simple-desc>
      <format>
        <format-string desc="checkkey %(return-var), (key-type)">checkkey %VAR,STR</format-string>
        <arg type="VAR">Numeric variable (1: got specified keypress, 0: didn't)</arg>
        <arg type="STR">Key type</arg>
      </format>
      <description>Checks if there was a specified keypress at the last <b>btnwait</b> command, returning 1 if the desired key was pressed.<br />
Allowed key types are single half-width alphabet characters, digits, or spaces, or else one of the following macros:<br />
<indent />"SPACE" - Spacebar<br />
<indent />"RETURN" or "ENTER" - Enter key<br />
<indent />"CTRL" - any Ctrl key<br />
<indent />"UP"/"DOWN"/"LEFT"/"RIGHT" - Up/Down/Left/Right arrow key<br />
<indent />"F1" ... "F12" - the given Function key<br />
<indent />"PAGEUP"/"PAGEDOWN" - PageUp/PageDown key<br />
<indent />"SHIFT" - any Shift key</description>
      <example>
        <comment>Does a btnwait. %1 is set to 1 if the Spacebar was pressed, 0 otherwise; %2 is set to 1 if Enter key was pressed, 0 otherwise.</comment>
        <code>btnwait %0
checkkey %1," "
checkkey %2,"ENTER"</code>
      </example>
      <related cmd="btnwait" />
      <related cmd="selectbtnwait" />
      <related cmd="textbtnwait" />
      <related cmd="textgosub" />
    </command>

    <command name="texec" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>remove text for a page-wait condition</simple-desc>
      <format>
        <format-string>texec</format-string>
      </format>
      <description>Does text removal for a page-wait (within a <b>textgosub</b> routine). Also does line-feeds after regular clickwaits as applicable.</description>
      <related cmd="textgosub" />
      <related cmd="textbtnwait" />
      <related cmd="getcursorpos" />
    </command>

    <command name="texec2" version="2.82" type="E" category="systemcustomize">
      <scr>N</scr>
      <simple-desc>remove text for a page-wait condition (method 2)</simple-desc>
      <format>
        <format-string>texec2</format-string>
      </format>
      <description>Similar to <b>texec</b>, except that it does not remove text immediately - only once the following line is displayed.<br />
(This is used to prevent erasing text at choices.)</description>
      <notice>Available since 2008/08/10 release</notice>
      <related cmd="textgosub" />
      <related cmd="textbtnwait" />
      <related cmd="texec" />
      <related cmd="getcursorpos" />
    </command>

    <command name="getcursorpos" type="E" category="systemcustomize">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get current position of text cursor</simple-desc>
      <format>
        <format-string desc="getcursorpos (X-pos-var), (Y-pos-var)">getcursorpos %VAR,%VAR</format-string>
        <arg type="VAR">Variable for the text-window X-coordinate of the text cursor</arg>
        <arg type="VAR">Variable for the text-window Y-coordinate of the text cursor</arg>
      </format>
      <description>Retrieves the text-window position of the text cursor - where a character would next be displayed.</description>
      <example>
        <comment>Stores the text cursor position in (%0,%1).</comment>
        <code>getcursorpos %0,%1</code>
      </example>
      <related cmd="textgosub" />
      <related cmd="textbtnwait" />
      <related cmd="texec" />
    </command>

    <command name="getcursorpos2" version="2.92" type="E" category="systemcustomize">
      <scr ver="2.92">N</scr><scr ver="20100105">E</scr>
      <simple-desc>get top-left pixel coordinates of the last text character</simple-desc>
      <format>
        <format-string desc="getcursorpos2 (X-coord-var), (Y-coord-var)">getcursorpos2 %VAR,%VAR</format-string>
        <arg type="VAR">Variable for the top-left pixel X-coordinate of the text character</arg>
        <arg type="VAR">Variable for the top-left pixel Y-coordinate of the text character</arg>
      </format>
      <description>The same as <b>getcursorpos</b>, except that this command returns the pixel coordinates of the top-left of the last displayed text character.</description>
      <example>
        <comment>Stores the top-left pixel coordinates of the last text character in (%0,%1).</comment>
        <code>getcursorpos2 %0,%1</code>
      </example>
      <related cmd="getcursorpos" />
      <related cmd="textgosub" />
      <related cmd="textbtnwait" />
      <related cmd="texec" />
      <related cmd="texec2" />
    </command>

    <command name="isskip" type="E" category="systemcustomize">
      <scr ver="2.20">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get current progress mode</simple-desc>
      <format>
        <format-string desc="isskip %(return-var)">isskip %VAR</format-string>
        <arg type="VAR">Return numeric variable (0: no skip, 1: skip mode, 2: auto mode)</arg>
      </format>
      <description>Retrieves the current skip mode setting. Returns 0 if no skip, 1 if skip to next choice mode, and 2 if auto mode.</description>
      <notice>If currently in kidoku (skip to unread) mode, this will return 0 at unread sentences. (by senzogawa)</notice>
      <notice>ONScripter-EN will return 4 if page-at-once mode is set. (by Mion)</notice>
    </command>

    <command name="ispage" type="E" category="systemcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve whether or not in a new page clickwait</simple-desc>
      <format>
        <format-string desc="ispage %(return-var)">ispage %VAR</format-string>
        <arg type="VAR">Return numeric variable</arg>
      </format>
      <description>Within a <b>textgosub</b> routine, this will set the return variable to 1 if the current clickwait is for a new page, 0 if not.</description>
      <example>
        <comment>Retrieves the clickwait type and assigns it to %0.</comment>
        <code>ispage %0</code>
      </example>
      <related cmd="textgosub" />
    </command>

    <command name="defsub" type="F" category="systemcustomize">
      <scr ver="2.40">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a user-defined command name</simple-desc>
      <format>
        <format-string desc="defsub (label-name)">defsub NAME</format-string>
        <arg type="NAME">Subroutine label name</arg>
      </format>
      <description>This creates a user-defined command.<br />
It will be called as a subroutine (i.e. via <b>gosub</b>).
Even though this follows variable naming conventions, user-defined command names may not begin with "_".</description>
      <notice>It's possible to define a user command with the same name as a built-in command.<br />
When this is the case, please use <b>_name</b> instead of <b>name</b> to call the original command - see the second example.</notice>
      <example>
        <comment>Defines and calls the "subname" subroutine.</comment>
        <code>defsub subname
; stuff happens here
subname
; just returned from calling *subname
end
*subname
; got here via a gosub or call to user-def command
return</code>
      </example>
      <example>
        <comment>Defines and calls the "texton" subroutine while also using the "texton" command.</comment>
        <code>*define
defsub *texton
game

*start
texton ; does "gosub *texton"
_texton ; calls the original "texton" command</code>
      </example>
      <related cmd="getparam" />
    </command>

    <command name="getparam" type="FE" category="systemcustomize">
      <scr ver="2.40">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve the parameters given to a user-defined command</simple-desc>
      <format>
        <format-string desc="getparam (arg-var)[, ...]">getparam %VAR|$VAR|s%VAR|i%VAR[,...]</format-string>
        <arg type="VAR">Argument storage variable</arg>
      </format>
      <description>Takes the values provided as parameters to a user-defined command and assigns them, in order, to the given variables. For example, given the following subroutine call/getparam code:<br />
<indent /><b>defsub usercmd1</b><br />
<indent />. . .<br />
<indent /><b>usercmd1 %14,$15,2,"blat"</b><br />
<indent />. . .<br />
<indent /><b>*usercmd1</b><br />
<indent /><b>getparam %0,$0,%1,$1</b><br />
After the <b>getparam</b> command, %0 will contain the numeric value of %14, $0 the string value of $15, %1 the numeric value 2, and $1 the numeric value "blat".<br />
<br />
The <b>s%VAR</b> and <b>i%VAR</b> argument types allow for passing variables by reference - s%VAR for a string variable, i%VAR for a numeric variable.<br />
For example, in this code:<br />
<indent /><b>defsub usercmd2</b><br />
<indent />. . .<br />
<indent /><b>usercmd2 %14,$15</b><br />
<indent />; same result as <b>inc %14 : add $15,"/"</b><br />
<indent />. . .<br />
<indent /><b>*usercmd2</b><br />
<indent /><b>getparam i%0,s%1</b><br />
<indent /><b>inc %%0 : add $%1,"/" : return</b><br />
After the <b>getparam</b> command, %0 will contain the numeric value <b>14</b> and %1 the numeric value <b>15</b> - the reference numbers of the provided variables. The variables are then accessed or modified by referring to <b>%%0</b> and <b>$%1</b>.<br />
<br />
Finally, label names may be passed and accessed as string values, as follows:<br />
<indent /><b>defsub usergoto</b><br />
<indent />. . .<br />
<indent /><b>usergoto *alabel</b><br />
<indent />. . .<br />
<indent /><b>*usergoto</b><br />
<indent /><b>getparam $0</b><br />
<indent /><b>goto $0</b><br />
<indent />; <b>goto "*alabel"</b> same as <b>goto *alabel</b></description>
      <notice>Since NScripter treats all variables as global, it would be best to designate a set of variable numbers for subroutines only, and not use them within the main program, in order to keep "local" and "global" variables separate. For example, use %0-%49 as main program variables, and %50-%99 only within <b>defsub</b> routines.</notice>
      <related cmd="defsub" />
    </command>

    <command name="luacall" version="2.93" type="F" category="systemcustomize">
      <scr>N</scr>
      <simple-desc>replace default NScripter functionality with a Lua callback</simple-desc>
      <format>
        <format-string desc="luacall (sysfunc-name)">luacall NAME</format-string>
        <arg type="NAME">System function name (tag, text0, text, animation, close, end, savepoint, save, load)</arg>
      </format>
      <description>Many default NScripter system functions can now be replaced with Lua callbacks.<br />
A Lua function could be created to handle text display using sprites, for example, as well as other sorts of system customization.<br />
The specified character string need not be enclosed by double-quotes, and is case-insensitive.<br />
The applicable Lua-side function must be named NSCALL_(sysfunc-name) and use the defined function argument structure for that particular call.</description>
      <notice><b>luacall animation</b> callback stub added in (Japanese) onscripter 20090510-exp. (by Mion)</notice>
      <example>
        <comment>Specifies that Lua function NSCALL_text will be called for text display handling.</comment>
        <code>luacall text</code>
      </example>
      <related cmd="luasub" />
    </command>

    <command name="luasub" version="2.93" type="F" category="systemcustomize">
      <scr>N</scr>
      <simple-desc>create a user-defined instruction that calls a Lua function</simple-desc>
      <format>
        <format-string desc="luasub (cmd-name)">luasub NAME</format-string>
        <arg type="NAME">Instruction name</arg>
      </format>
      <description>Defines a new command with the given name and ties it to a Lua function NSCOM_(cmd-name).<br />
Any time the command is executed within the script, that Lua function will be called.<br />
A Lua function registered with <b>luasub</b> must be void - no arguments or return values.</description>
      <notice>Existing NScr commands may be replaced using <b>luasub!</b><br />
For example, <b>luasub bg</b> will cause Lua function NSCOM_bg() to be called instead of the standard <b>bg</b> command.<br />
As with <b>defsub</b>, you can use <b>_bg</b> to call the original <b>bg</b> instruction.</notice>
      <notice><b>luasub</b> stub added in (Japanese) onscripter 20090510-exp. (by Mion)</notice>
      <example>
        <comment>Specifies that Lua function NSCOM_func will be called when the "func" command is executed.</comment>
        <code>luasub func</code>
      </example>
      <related cmd="luacall" />
      <related cmd="defsub" />
    </command>

    <command name="getscreenshot" type="E" category="screenshot">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>grab a screenshot</simple-desc>
      <format>
        <format-string desc="getscreenshot (X-size), (Y-size)">getscreenshot NUM,NUM</format-string>
        <arg type="NUM">Screenshot image width</arg>
        <arg type="NUM">Screenshot image height</arg>
      </format>
      <description>Collects a screenshot.  This only stores the image in memory - you will need to call <b>savescreenshot</b> to save it to a file.</description>
      <example>
        <comment>Grabs a screenshot of size 160x120.</comment>
        <code>getscreenshot 160,120</code>
      </example>
      <related cmd="savescreenshot" />
      <related cmd="savescreenshot2" />
      <related cmd="deletescreenshot" />
    </command>

    <command name="savescreenshot" type="E" category="screenshot">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>save a screenshot image</simple-desc>
      <format>
        <format-string desc="savescreenshot (filename)">savescreenshot STR</format-string>
        <arg type="STR">Screenshot filename</arg>
      </format>
      <description>Saves a screenshot collected via <b>getscreenshot</b>.<br />
This also deletes the screenshot image from memory; use <b>savescreenshot2</b> instead if you need to reuse the screenshot image.</description>
      <example>
        <comment>Saves the last collected screenshot as "thumb01.bmp".</comment>
        <code>savescreenshot "thumb01.bmp"</code>
      </example>
      <related cmd="getscreenshot" />
      <related cmd="savescreenshot2" />
      <related cmd="deletescreenshot" />
    </command>

    <command name="savescreenshot2" type="E" category="screenshot">
      <scr ver="2.30">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>save a screenshot image</simple-desc>
      <format>
        <format-string desc="savescreenshot2 (filename)">savescreenshot2 STR</format-string>
        <arg type="STR">Screenshot filename</arg>
      </format>
      <description>Saves a screenshot collected via <b>getscreenshot</b> as the given filename.<br />
This does not delete the screenshot image from memory, so please use <b>deletescreenshot</b> to remove it from memory when finished.</description>
      <related cmd="getscreenshot" />
      <related cmd="savescreenshot" />
      <related cmd="deletescreenshot" />
    </command>

    <command name="deletescreenshot" type="E" category="screenshot">
      <scr ver="2.30">N</scr><scr>E</scr><scr>P</scr>
      <simple-desc>remove a screenshot image from memory</simple-desc>
      <format>
        <format-string>deletescreenshot</format-string>
      </format>
      <description>Removes a screenshot image from memory.<br />
This command is meant to be used with <b>savescreenshot2</b>.</description>
      <related cmd="getscreenshot" />
      <related cmd="savescreenshot" />
      <related cmd="savescreenshot2" />
    </command>

    <command name="btnarea" type="E" category="input">
      <scr ver="1.97">N</scr><scr ver="20091122">E</scr>
      <simple-desc>set an area for detecting mouse cursor entry</simple-desc>
      <format>
        <format-string desc="btnarea (area Y-axis)">btnarea NUM</format-string>
        <arg type="NUM">Y-coordinate setting for the area</arg>
      </format>
      <description>Use this after a call to <b>btndef</b>. It will set a region of the screen that, during a <b>btnwait</b>, will return -4 upon mouseover.<br />
If the given Y-value is positive, the mouseover area goes from top of screen to Y; if the Y-value is negative, the mouseover area goes from -Y to bottom of screen.</description>
      <notice>If there's more than one <b>btnarea</b> command, it seems that only the last one will work. (by senzogawa)</notice>
      <example>
        <comment>Sets from Y=400 to the bottom of the screen as a mouseover area for btnwait.</comment>
        <code>btndef clear
btnarea -400</code>
      </example>
      <related cmd="btndef" />
      <related cmd="btnwait2" />
    </command>

    <command name="btndown" type="E" category="input">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set to return from button command while mouse button is pressed</simple-desc>
      <format>
        <format-string desc="btndown (flag)">btndown NUM</format-string>
        <arg type="NUM">down-flag (1: return while mouse button pressed, 0: return after click &amp; release)</arg>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
If the given flag value for <b>btndown</b> is 1, then <b>btnwait</b> will return even while the mouse button is down (normally it only returns after the mouse button has been released after a click).</description>
      <example>
        <comment>Sets to return from btnwait while a mouse button is pressed.</comment>
        <code>btndown 1</code>
      </example>
      <related cmd="btndef" />
      <related cmd="btnwait" />
      <related cmd="isdown" />
    </command>

    <command name="isdown" type="E" category="input">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>return whether or not the mouse button is pressed</simple-desc>
      <format>
        <format-string desc="isdown %(result-var)">isdown %VAR</format-string>
        <arg type="VAR">result numeric variable (1: pressed, 0: not pressed)</arg>
      </format>
      <description>Sets the result variable based on whether the left mouse button is pressed down.<br />
It returns 1 if pressed, 0 if not pressed.</description>
      <example>
        <comment>This prints a line of "０"s while the left mouse button is pressed, moving to the next line when the button is released.  It exits on right-click.</comment>
        <code>*waitloop
btnwait %0
if %0=0 goto *onlclick
end
*onlclick
isdown %1
if %1=1 puttext "０/":goto *onlclick
puttext ""
goto *waitloop</code>
      </example>
      <related cmd="btndown" />
    </command>

    <command name="getmousepos" type="E" category="input">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>retrieve mouse cursor position</simple-desc>
      <format>
        <format-string desc="getmousepos %(X-pos), %(Y-pos)">getmousepos %VAR,%VAR</format-string>
        <arg type="VAR">result numeric variable for mouse cursor X-coordinate</arg>
        <arg type="VAR">result numeric variable for mouse cursor Y-coordinate</arg>
      </format>
      <description>Sets the given result variables to the current mouse cursor coordinates.<br />
Unlike <b>clickpos</b>, this command can collect cursor position without first waiting for a click.</description>
      <example>
        <comment>Assign the current mouse cursor coordinates to %0 and %1.</comment>
        <code>getmousepos %0,%1</code>
      </example>
      <related cmd="clickpos" />
    </command>

    <command name="spclclk" type="E" category="input">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set the Spacebar to work the same as a left-click</simple-desc>
      <format>
        <format-string>spclclk</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
This will cause a wait command to give the same return value on a pressed Spacebar as for a left-click in the same situation.</description>
      <related cmd="btndef" />
      <related cmd="btnwait" />
    </command>

    <command name="usewheel" type="F" category="input">
      <scr ver="1.97">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect mouse wheel movement</simple-desc>
      <format>
        <format-string>usewheel</format-string>
      </format>
      <description>Sets <b>btnwait</b> commands to detect mouse wheel movement.<br />
The wait command will return -2 on wheel up, -3 on wheel down.<br />
Please note that, when <b>usewheel</b> is in effect, a button wait timeout (set by <b>btntime</b>) will return -5 instead of the usual -2.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
    </command>

    <command name="useescspc" type="F" category="input">
      <scr ver="1.99">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Esc and Spacebar keypresses</simple-desc>
      <format>
        <format-string>useescspc</format-string>
      </format>
      <description>Sets <b>btnwait</b> commands to detect when the Esc key or Spacebar is pressed.<br />
The wait command will return -10 on Esc, -11 on Space.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
    </command>

    <command name="getcursor" type="E" category="input">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect left/right/up/down arrow keys</simple-desc>
      <format>
        <format-string>getcursor</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -40 on up-arrow keypress, -41 on right-arrow, -42 on down-arrow, and -43 on left-arrow.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="getenter" type="E" category="input">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Enter key</simple-desc>
      <format>
        <format-string>getenter</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -19 when the Enter key is pressed.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="gettab" type="E" category="input">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Tab key</simple-desc>
      <format>
        <format-string>gettab</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -20 when the Tab key is pressed.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="getfunction" type="E" category="input">
      <scr ver="2.00">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Function keys</simple-desc>
      <format>
        <format-string>getfunction</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -21 to -32 for presses of keys F1 to F12.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="getpage" type="E" category="input">
      <scr ver="2.20">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect PageUp/PageDown keys</simple-desc>
      <format>
        <format-string>getpage</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -12 on PageUp keypress and -13 on PageDown.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="getinsert" type="E" category="input">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Insert key</simple-desc>
      <format>
        <format-string>getinsert</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -50 when the Insert key is pressed.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getzxc" />
    </command>

    <command name="getzxc" type="E" category="input">
      <scr ver="2.25">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>have button commands detect Z/X/C keys</simple-desc>
      <format>
        <format-string>getzxc</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands.<br />
The wait command will return -51 on Z keypress, -52 on X, and -53 on C.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
    </command>

    <command name="getmclick" type="E" category="input">
      <scr ver="2.94">N</scr><scr ver="20091122">E</scr>
      <simple-desc>detect middle-button mouse clicks</simple-desc>
      <format>
        <format-string>getmclick</format-string>
      </format>
      <description>Use this between <b>btndef</b> and <b>btnwait</b> commands, like with <b>getfunction</b>.<br />
The wait command will return -70 if the middle mouse button is clicked.</description>
      <related cmd="btndef" />
      <related cmd="btntime" />
      <related cmd="btntime2" />
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="spclclk" />
      <related cmd="usewheel" />
      <related cmd="useescspc" />
      <related cmd="getcursor" />
      <related cmd="getenter" />
      <related cmd="gettab" />
      <related cmd="getfunction" />
      <related cmd="getpage" />
      <related cmd="getinsert" />
      <related cmd="getzxc" />
    </command>

    <command name="()" id="parens" type="T" category="ruby">
      <scr ver="2.03">N</scr><scr>O</scr><scr>E</scr>
      <simple-desc>produce ruby text</simple-desc>
      <format>
        <format-string desc="'(main-text/ruby-text)'">'('STR'/'STR')'</format-string>
        <arg type="STR">Main text to show ruby text above</arg>
        <arg type="STR">Ruby text (displayed smaller, spread above main text)</arg>
      </format>
      <description>This text command produces ruby text, often used for furigana (Japanese phonetic characters that show the pronunciation of a kanji phrase).</description>
      <example>
        <comment>Sample script using ruby text</comment>
        <code>*define
rubyon
game
*start
setwindow 10,10,20,20,24,24,0,12,0,1,1,#ffffff,0,0,639,479
ルビ機能の(暫定仕様/ざんていしよう)です。@
ｒｕｂｙｏｎ時、(文字/もじ)は(下詰/したづめ)で表示されます。@
(縦/たて)の(字間/じかん)を、ルビが入る分とって下さい。@
「(承/うけたまわ)」る、とか、「(論理的/ロジカル)」みたいに、文字幅をあわせようとする機能がついてます。
ルビは折り返し改行されませんのでご注意ください。\
end</code>
      </example>
      <example type="O">
        <comment>Ruby text example with ONScripter (note the '(', '/', and ')' must be outside single-byte mode).</comment>
        <code>*define
rubyon
game
*start
setwindow 10,10,20,20,24,24,0,12,0,1,1,#ffffff,0,0,639,479
`This is a script that displays ruby text.@
`You can use it with Japanese examples, `(文字/もじ)`, for example.@
br
`In ONScripter-EN you can even do things like `(文字/moji)` or `(`DREADFUL`/horrible)`, if not very well.@
`Be sure to use vertical spacing or insert a blank line above rubied text, so that the ruby doesn't overlap earlier lines.\
end</code>
      </example>
      <related cmd="rubyoff" />
      <related cmd="rubyon" />
    </command>

    <command name="rubyoff" type="FE" category="ruby">
      <scr ver="2.30">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>turn off ruby mode</simple-desc>
      <format>
        <format-string>rubyoff</format-string>
      </format>
      <description>Turns off ruby mode, thereby disallowing ruby text.</description>
      <related cmd="parens" />
      <related cmd="rubyon" />
    </command>

    <command name="rubyon" type="FE" category="ruby">
      <scr ver="2.30">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter ruby mode</simple-desc>
      <format>
        <format-string desc="rubyon [(ruby-size-X), (ruby-size-Y), (ruby-font)]">rubyon [NUM,NUM[,STR]]</format-string>
        <arg type="NUM">Ruby char width (default: half of main text width)</arg>
        <arg type="NUM">Ruby char height (default: half of main text height)</arg>
        <arg type="STR">Ruby text font name</arg>
      </format>
      <description>Turns on ruby mode.</description>
      <example>
        <comment>Enters ruby mode, using the set text font and half the set text sizes for displaying ruby text.</comment>
        <code>rubyon</code>
      </example>
      <example>
        <comment>Enters ruby mode, using the set text font, width 10, and height 8 for displaying ruby text.  (It is probably best not to use ruby text bigger than 13x13, for anti-aliasing purposes.)</comment>
        <code>rubyon 10,8</code>
      </example>
      <example>
        <comment>Enters ruby mode, using width 14, height 12, and Japanese font "MS Gothic" for displaying ruby text.</comment>
        <code>rubyon 14,12,"ＭＳ ゴシック"</code>
      </example>
      <related cmd="parens" />
      <related cmd="rubyoff" />
    </command>

    <command name="rubyon2" type="E" category="ruby">
      <scr ver="2.80">N</scr><scr ver="20100105">E</scr>
      <simple-desc>enter this ruby mode only when ruby text appears</simple-desc>
      <format>
        <format-string desc="rubyon2 (ruby-size-X), (ruby-size-Y)">rubyon2 NUM,NUM</format-string>
        <arg type="NUM">Ruby char width</arg>
        <arg type="NUM">Ruby char height</arg>
      </format>
      <description>This changes to ruby mode, but only when ruby appears in the current line. (Assumed to be used for quick-display modes; will also allow ruby text in <b>strsp</b> commands.)</description>
      <notice>Please note that text may be shifted to make room for ruby text.</notice>
      <notice>Still not clear to me what this command's documentation means; for now, ONScr-EN recognizes this command but does no special handling. (by Mion)</notice>
      <related cmd="rubyoff" />
      <related cmd="rubyon" />
      <related cmd="strsp" />
    </command>

    <command name="draw" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>send images created via demo draw commands to the screen</simple-desc>
      <format>
        <format-string>draw</format-string>
      </format>
      <description>Sends images created via demo draw commands (e.g. <b>drawbg</b>, <b>drawsp</b>) directly to the screen.<br />
Otherwise, the results of the draw commands will not be displayed.</description>
      <example>
        <comment>Displays "bg.bmp" while rotating it counter-clockwise.</comment>
        <code>*test
saveoff
;Demo image processing is faster with saveoff. Don't forget to reenable saveon when you're done!
mov %0,0
bg "bg.bmp",1
*lp
resettimer
drawclear
drawbg2 320,240,100,100,%0*2
draw
wait 5
;ウェイトを多少いれないと、メッセージ処理が遅れがちになります。
gettimer %1
if %1&gt;=50 add %0,%1/50
if %1&lt;50 waittimer 50:inc %0
;掛かった処理時間に比例して変数を変化させます。
goto *lp</code>
      </example>
    </command>

    <command name="drawclear" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>paint the screen black</simple-desc>
      <format>
        <format-string>drawclear</format-string>
      </format>
      <description>Paints over the entire screen with the color black.<br />
Must be followed by the <b>draw</b> command.</description>
      <related cmd="draw" />
    </command>

    <command name="drawfill" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>paint over the screen with a specific color</simple-desc>
      <format>
        <format-string desc="drawfill (red-level), (green-level), (blue-level)">drawfill NUM,NUM,NUM</format-string>
        <arg type="NUM">Red component of RGB color (0-255)</arg>
        <arg type="NUM">Green component of RGB color (0-255)</arg>
        <arg type="NUM">Blue component of RGB color (0-255)</arg>
      </format>
      <description>Paints over the entire screen with the given color, as provided with separate R,G,B levels.<br />
Must be followed by the <b>draw</b> command.</description>
      <example>
        <comment>Paints over the screen with color #FF0080.</comment>
        <code>drawfill 255,0,128</code>
      </example>
      <related cmd="draw" />
    </command>

    <command name="drawbg" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw the background to the screen</simple-desc>
      <format>
        <format-string>drawbg</format-string>
      </format>
      <description>Draws the background image to the screen.<br />
Must be followed by the <b>draw</b> command.</description>
      <notice>Note that neither the sprites, standing images, nor text window will be displayed.</notice>
      <related cmd="draw" />
    </command>

    <command name="drawbg2" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw the background to the screen in a special manner</simple-desc>
      <format>
        <format-string desc="drawbg2 (BG-center-X-pos), (BG-center-Y-pos), (X-scale), (Y-scale), (rotation)">drawbg2 NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Width scaling factor (%)</arg>
        <arg type="NUM">Height scaling factor (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counter-clockwise)</arg>
      </format>
      <description>Draws the background image to the screen, using the given center coordinates, scaling factors, and rotation.<br />
The previous image can still be seen in sections outside the rotated image rectangle; use <b>drawclear</b> beforehand if this is undesirable.<br />
This command must be followed by the <b>draw</b> command.</description>
      <notice>Note that neither the sprites, standing images, nor text window will be displayed.<br />
Also note that this command uses center coordinates, not top-left coordinates like most other commands.</notice>
      <example>
        <comment>Draw the background image centered at (320,240), scaled times 2 in width, times 3 in height, and rotated 15 degrees counter-clockwise.</comment>
        <code>drawbg2 320,240,200,300,15</code>
      </example>
      <related cmd="draw" />
      <related cmd="drawclear" />
    </command>

    <command name="drawtext" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw the text window</simple-desc>
      <format>
        <format-string>drawtext</format-string>
      </format>
      <description>Draws the text window.<br />
Sprites drawn earlier (e.g. with <b>drawsp</b>) will appear below the text, and sprites drawn after this command will appear above the text.<br />
This command must be followed by the <b>draw</b> command.</description>
      <related cmd="draw" />
      <related cmd="drawsp" />
    </command>

    <command name="drawsp" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw a sprite</simple-desc>
      <format>
        <format-string desc="drawsp (sprite-num), (cell-num), (opacity), (top-left-X-pos), (top-left-Y-pos)">drawsp NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Cell number (of sprite)</arg>
        <arg type="NUM">Opacity (0-255)</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
      </format>
      <description>Draws a sprite to the screen, using the given sprite number, cell number, opacity, and top-left coordinates.<br />
The position and show/hide status of the actual sprite are not used, just the image itself.<br />
The sprite will be drawn on top of previous drawn items, like from other <b>drawsp</b> or <b>drawtext</b>.<br />
This command must be followed by the <b>draw</b> command.</description>
      <example>
        <comment>Draw Sprite 2, Cell 1 with top-left at (20,40) and half-transparency (128).</comment>
        <code>drawsp 2,1,128,20,40</code>
      </example>
      <related cmd="draw" />
      <related cmd="drawtext" />
    </command>

    <command name="drawsp2" type="E" category="draw">
      <scr ver="2.31">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw a sprite (scaled and rotated)</simple-desc>
      <format>
        <format-string desc="drawsp2 (sprite-num), (cell-num), (opacity), (center-X-pos), (center-Y-pos), (X-scale), (Y-scale), (rotation)">drawsp2 NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Cell number (of sprite)</arg>
        <arg type="NUM">Opacity (0-255)</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Width scaling factor (%)</arg>
        <arg type="NUM">Height scaling factor (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counter-clockwise)</arg>
      </format>
      <description>Draws a sprite to the screen, using the given sprite number, cell number, opacity, center coordinates, scaling factors, and rotation.<br />
The position and show/hide status of the actual sprite are not used, just the image itself.<br />
The sprite will be drawn on top of previous drawn items, like from other <b>drawsp</b> or <b>drawtext</b>.<br />
This command must be followed by the <b>draw</b> command.</description>
      <notice>Note that this command uses center coordinates, not top-left coordinates like most other commands.<br />
In Nscr ver2.51 and earlier, this command had a bug when applying the opacity parameter to sprites with alpha values: 0 was treated as opaque, and 255 as transparent.<br />
When running a script created using an earlier NScr version, the third parameter of <b>drawsp2</b> must be corrected to work properly with NScr ver2.52 and above.</notice>
      <example>
        <comment>Draw Sprite 2, Cell 1 at half-transparency (128), centered at (20,40), with 150% width, 60% height, and rotated 10 degrees clockwise.</comment>
        <code>drawsp2 2,1,128,20,40,150,60,-10</code>
      </example>
      <related cmd="draw" />
      <related cmd="drawsp" />
    </command>

    <command name="drawsp3" type="E" category="draw">
      <scr ver="2.60">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>draw a sprite with linear transformation</simple-desc>
      <format>
        <format-string desc="drawsp3 (sprite-num), (cell-num), (opacity), (top-left-X-pos), (top-right-Y-pos), (matrix-c11), (matrix-c12), (matrix-c21), (matrix-c22)">drawsp3 NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM,NUM</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Cell number (of sprite)</arg>
        <arg type="NUM">Opacity (0-255)</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Matrix top-left coefficient</arg>
        <arg type="NUM">Matrix top-right coefficient</arg>
        <arg type="NUM">Matrix bottom-left coefficient</arg>
        <arg type="NUM">Matrix bottom-right coefficient</arg>
      </format>
      <description>Like <b>drawsp</b>, this command draws a sprite to the screen - but it first applies a linear transformation.<br />
It uses the given sprite number, cell number, opacity, and linear transformation matrix.<br />
The given matrix coefficients will be divided by 1000 before being applied, so that, for example, a parameter of 1600 yields a coefficient of 1.6.<br />
This command must be followed by the <b>draw</b> command.</description>
      <example>
        <comment>Draw Sprite 2, Cell 1 at half-transparency (128), with top-left at (20,40), after applying the linear transformation [ 1.5, 0.3; 0.8, 1.2 ].</comment>
        <code>drawsp3 2,1,128,20,40,1500,300,800,1200</code>
      </example>
      <related cmd="draw" />
      <related cmd="drawsp" />
    </command>

    <command name="checkpage" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>check whether a backlog page is available</simple-desc>
      <format>
        <format-string desc="checkpage %(result-var), (backlog-page-num)">checkpage %VAR,NUM</format-string>
        <arg type="VAR">Result numeric variable</arg>
        <arg type="NUM">Previous page (number of pages back; 0 = current page)</arg>
      </format>
      <description>Checks whether the log string of a backlog page is available (to <b>getlog</b>, for example).<br />
The second parameter tells the number of pages prior to the current one to check for.<br />
The first parameter will be set to 1 if the page is available, 0 if not.<br />
Please provide a value of 1 or more for the second parameter, noting that, since 0 is the current page, it would always be available.</description>
      <example>
        <comment>Set %5 based on whether or not the last page backlog is available.</comment>
        <code>checkpage %5,1</code>
      </example>
      <related cmd="getlog" />
    </command>

    <command name="getlog" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the character string for a backlog page</simple-desc>
      <format>
        <format-string desc="getlog $(result-var), (backlog-page-num)">getlog $VAR,NUM</format-string>
        <arg type="VAR">Result variable for backlog string</arg>
        <arg type="NUM">Number of pages back</arg>
      </format>
      <description>Retrieves the character string of the given backlog page, including newlines and ruby text data.<br />
The second parameter gives the backlog page number, the same as provided to <b>checkpage</b>.</description>
      <example>
        <comment>Sets $0 to the backlog string from %5 pages back</comment>
        <code>getlog $0,%5</code>
      </example>
      <related cmd="checkpage" />
      <related cmd="logsp" />
    </command>

    <command name="logsp" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a sprite from backlog text</simple-desc>
      <format>
        <format-string desc="logsp (sprite-num), (log-text), (top-left-X-pos), (top-left-Y-pos)[, (color)[,...]]">logsp NUM,STR,NUM,NUM[,COLOR[,COLOR[,...]]]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Text string (provided by <b>getlog</b>)</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="COLOR">Log Text color (default: #FFFFFF)</arg>
        <arg type="COLOR">Log Text sprite additional cell color (optional)</arg>
      </format>
      <description>Creates a sprite from backlog text retrieved via <b>getlog</b>, positioned at the given coordinates.<br />
If no color is specified, the sprite text will be white (#FFFFFF).  If only one color is specified, then the sprite will have just one cell - provide additional colors if you need more cells, like for use as a button.</description>
      <example>
        <comment>Creates Sprite 8 from backlog text in $0, displayed at (60,90)</comment>
        <code>logsp 8,$0,60,90</code>
      </example>
      <example>
        <comment>Creates Sprite 8 from backlog text in $0, displayed at (60,90), with color #FFFF88</comment>
        <code>logsp 8,$0,60,90,#FFFF88</code>
      </example>
      <example>
        <comment>Creates Sprite 8 from backlog text in $0, displayed at (60,90), with Cell 0 of color #888888 and Cell 1 of color #FFFF88</comment>
        <code>logsp 8,$0,60,90,#888888,#FFFF88</code>
      </example>
      <related cmd="getlog" />
      <related cmd="logsp2" />
    </command>

    <command name="logsp2" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>create a sprite from backlog text with custom text size</simple-desc>
      <format>
        <format-string desc="logsp2 (sprite-num), (log-text), (top-left-X-pos), (top-left-Y-pos), (char-width), (char-height), (spacing-X), (spacing-Y)[, (color)[,...]]">logsp2 NUM,STR,NUM,NUM,NUM,NUM,NUM,NUM[,COLOR[,COLOR[,...]]]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="NUM">Text string (provided by <b>getlog</b>)</arg>
        <arg type="NUM">Top-left X-coordinate</arg>
        <arg type="NUM">Top-left Y-coordinate</arg>
        <arg type="NUM">Text font width</arg>
        <arg type="NUM">Text font height</arg>
        <arg type="NUM">Text spacing X</arg>
        <arg type="NUM">Text spacing Y</arg>
        <arg type="COLOR">Log Text color (default: #FFFFFF)</arg>
        <arg type="COLOR">Log Text sprite additional cell color (optional)</arg>
      </format>
      <description>Same as <b>logsp</b>, but allows specifying the text character size.</description>
      <example>
        <comment>Creates Sprite 2 from backlog text in $0 with fullwidth char size 17x17, no horizontal spacing, and 1 pixel vertical spacing, displayed at (150,20)</comment>
        <code>logsp2 2,$0,150,20,17,17,0,1</code>
      </example>
      <related cmd="getlog" />
      <related cmd="logsp" />
    </command>

    <command name="getlogtext" version="2.70" type="E" category="logcustomize">
      <scr>N</scr>
      <simple-desc>get the character string for a backlog page (for use with <b>strsp</b>)</simple-desc>
      <format>
        <format-string desc="getlogtext (string-var), (backlog-page-num)">getlogtext $VAR,NUM</format-string>
        <arg type="VAR">Result variable for backlog string</arg>
        <arg type="NUM">Number of pages back</arg>
      </format>
      <description>Works the same as <b>getlog</b>, but intended to be used in combination with <b>strsp</b>.<br />
Later versions of NScr (and ONScripter) have a <b>strsp</b> command that can work with <b>getlog</b> text, so this command is basically unnecessary.</description>
      <related cmd="getlog" />
      <related cmd="strsp" />
    </command>

    <command name="gettaglog" type="E" category="logcustomize">
      <scr ver="2.72">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>get the last pretext tag of a backlog page</simple-desc>
      <format>
        <format-string desc="gettaglog (string-var), (backlog-page-num)">gettaglog $VAR,NUM</format-string>
        <arg type="VAR">Result variable for backlog string</arg>
        <arg type="NUM">Number of pages back</arg>
      </format>
      <description>Retrieves the last pretext tag of the given backlog page.<br />
This can be convenient for custom backlogs in scripts that provide character name and voice file via tags.<br />
<br />
Returns the empty string if no pretext tag was available.<br />
Note that this command does not split the tag and populate variables automatically, like <b>gettag</b> does; such functionality may be added later.</description>
      <related cmd="gettag" />
    </command>

    <command name="texthide" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>hide text while leaving the text window visible</simple-desc>
      <format>
        <format-string>texthide</format-string>
      </format>
      <description>Hides the textwindow text, while leaving the window itself in place.<br />
This is important for customized Log Mode display.</description>
      <related cmd="textshow" />
    </command>

    <command name="textshow" type="E" category="logcustomize">
      <scr ver="2.49">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>reshow text hidden with <b>texthide</b></simple-desc>
      <format>
        <format-string>textshow</format-string>
      </format>
      <description>Redisplays text that had been hidden with <b>texthide</b>.</description>
      <related cmd="texthide" />
    </command>

    <command name="pretextgosub" type="F" category="tag">
      <scr ver="2.46">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>set a routine to jump to just before text display</simple-desc>
      <format>
        <format-string desc="pretextgosub *(label)">pretextgosub LABEL</format-string>
        <arg type="LABEL">Label to jump to before a text command</arg>
      </format>
      <description>Sets a subroutine to jump to immediately before a display text command.<br />
If this command is used, a script can use a "tag", or data enclosed within square brackets <b>[]</b>, immediately before any line of text.<br />
For example, in the following code, the <b>[太郎/0001.wav]</b> is a tag:<br />
<indent /><b>[太郎/0001.wav]テスト用の文章です。</b></description>
      <example>
        <comment>Specifies that execution will jump to the *pretext_lb subroutine before each line of text</comment>
        <code>pretextgosub *pretext_lb</code>
      </example>
      <example>
        <comment>Example pretextgosub routine</comment>
        <code>pretextgosub *pretext_lb

*pretext_lb
dwavestop 0
gettag $0,$1
;assuming first item is person name, second is voice dialog file
if $0="" indent 0:goto *next_tag
mov $2,$0
add $2,"/"
puttext $2
;this displays "(Name)" right before the actual text
;the "/" is to keep puttext from adding a newline
indent 3
;indents text for character dialog
*next_tag
if $1="" return
dwave 0,$1
;play the voice file
return</code>
      </example>
      <related cmd="squarebrackets" />
      <related cmd="gettag" />
      <related cmd="indent" />
    </command>

    <command name="[]" id="squarebrackets" version="2.46" type="T" category="tag">
      <scr>N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>specify tag data available to a <b>pretextgosub</b> routine</simple-desc>
      <format>
        <format-string desc="[tag-data]">'['STR']'</format-string>
        <arg type="STR">Tag data elements, delimited by "/"</arg>
      </format>
      <description>Specifies tag data accessible to <b>gettag</b> within a <b>pretextgosub</b> routine, called immediately before the following text is displayed.</description>
      <example>
        <comment>This calls a pretextgosub routine before "「太郎の台詞」" is displayed, where <b>gettag</b> will extract "太郎" and "0001.wav".</comment>
        <code>[太郎/0001.wav]「太郎の台詞」</code>
      </example>
      <example type="O">
        <comment>This calls a pretextgosub routine before "Taro speaking." is displayed, where <b>gettag</b> will extract `Taro Mendo` and "0001.wav".</comment>
        <code>[`Taro Mendo`/0001.wav]`Taro speaking.`</code>
      </example>
      <related cmd="gettag" />
      <related cmd="pretextgosub" />
    </command>

    <command name="gettag" type="FE" category="tag">
      <scr ver="2.46">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>use within a <b>pretextgosub</b> routine to get tag data</simple-desc>
      <format>
        <format-string desc="gettag (var)[,...]">gettag $VAR|%VAR[,...]</format-string>
        <arg type="VAR">Numeric or string variable to receive a tag data element</arg>
      </format>
      <description>This command is called from within a <b>pretextgosub</b> routine in order to extract data from a pretext tag.<br />
It is not necessary to use <b>split</b> - the <b>gettag</b> command itself will do the job, delimiting on "/".<br />
If there is no tag data for a variable (no tag was provided, or there are more parameters to <b>gettag</b> than elements in the tag), then the variable in question is given a null value: "" for strings, 0 for numerics.<br />
<br />
If a tag <b>[太郎/0001.wav]</b> is processed via the command <b>gettag $0,$1</b>, then as a result $0 will be "太郎" and $1 will be "0001.wav".<br />
If <b>gettag $0,$1</b> is called but no tag was provided, then as a result both $0 and $1 will be "".<br />
<br />
Pretext tag processing is especially intended for handling names and voice files for dialog text.</description>
      <example>
        <comment>Processes a pretext tag, assigning the first two elements to $0 and $1.</comment>
        <code>gettag $0,$1</code>
      </example>
      <related cmd="squarebrackets" />
      <related cmd="pretextgosub" />
    </command>

    <command name="indent" type="E" category="tag">
      <scr ver="2.46">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>when linebreaking, indent the next line by the given amount</simple-desc>
      <format>
        <format-string desc="indent (num-indent-chars)">indent NUM</format-string>
        <arg type="NUM">The number of (fullwidth) characters to indent a continuing line</arg>
      </format>
      <description>When continuing a line after a line break, it will indent by the amount specified via this command.<br />
For example, a <b>pretextgosub</b> routine could use this command to add indenting for a line of dialog, but then set the indent level to 0 for regular text.</description>
      <example>
        <comment>Indent continuing lines by 2 (fullwidth) spaces</comment>
        <code>indent 2</code>
      </example>
      <related cmd="pretextgosub" />
    </command>

    <command name="pagetag" version="(undoc)" type="F" category="tag">
      <scr ver="2.82">N</scr><scr ver="20080121">O</scr><scr ver="20080310">E</scr>      <simple-desc>only process pretext tags at the start of a page</simple-desc>
      <format>
        <format-string>pagetag</format-string>
      </format>
      <description>A <b>pretextgosub</b>-enabled script will only check for <b>[]</b> pretext tags at the start of a page, not at the start of every line (or text command).</description>
      <related cmd="pretextgosub" />
      <related cmd="squarebrackets" />
    </command>

    <command name="zenkakko" version="(undoc)" type="F" category="tag">
      <scr ver="2.49">N</scr><scr ver="20050504">O</scr><scr>E</scr><scr>P</scr>
	  <simple-desc>allow use of 【】 as pretext tag brackets</simple-desc>
      <format>
        <format-string>zenkakko</format-string>
      </format>
      <description>Enables use of 【】 (fullwidth black lenticular brackets) for pretext tag specifications, in addition to the standard <b>[]</b> brackets.</description>
      <notice>This feature appears to be unsupported in the latest release (ver2.95), as NScr crashes when it reaches the 【】. Seems to work fine up through ver2.82. (by senzogawa)<br />
Note that, although the brackets may be fullwidth, tag elements are still separated by standard <b>/</b> slashes.</notice>
      <example>
        <comment>Uses fullwidth brackets for pretext tag specification.</comment>
        <code>*define
pretextgosub *pretextproc
zenkakko
game
*start
【名前/音声】「せりふ」
click
end

*pretextproc
gettag $0,$1
mesbox $0,$1 ; 題名が"音声"、本文が"名前"のダイアログを表示
return</code>
      </example>
      <related cmd="gettag" />
      <related cmd="pretextgosub" />
      <related cmd="squarebrackets" />
    </command>

    <command name="bmpcut" type="E" category="support">
      <scr>N</scr>
      <simple-desc>split a BMP file into multiple pieces while preserving the original</simple-desc>
      <format>
        <format-string desc="bmpcut (image-file), (num-horiz-pieces), (num-vert-pieces)">bmpcut STR,NUM,NUM</format-string>
        <arg type="STR">Image filename</arg>
        <arg type="NUM">Number of horizontal pieces (num. of horiz. cuts + 1)</arg>
        <arg type="NUM">Number of vertical pieces (num. of vert. cuts + 1)</arg>
      </format>
      <description>Splits a BMP image file into multiple pieces (new files) while preserving the original file.  The piece files are named accordingly based on the original filename and the piece position.</description>
      <example>
        <comment>Cuts "test.bmp" into three pieces horizontally and in half vertically.</comment>
        <code>bmpcut "test.bmp",3,2</code>
      </example>
    </command>

    <command name="bw2a" type="FE" category="support">
      <scr>N</scr>
      <simple-desc>generate an NScripter alpha image</simple-desc>
      <format>
        <format-string desc="bw2a (image-filename-without-ext)">bw2a STR</format-string>
        <arg type="STR">Resulting image filename (without .BMP extension)</arg>
      </format>
      <description>When given a string "(imagename)", this generates an NScripter-style alpha image from the two files "(imagename)_w.bmp" and "(imagename)_b.bmp".<br />
This produces the same output as the <b>bw2aconv.exe</b> program included with the NScr SDK.</description>
      <example>
        <comment>Generates an NScr-style alpha image from "test_w.bmp" and "test_b.bmp".</comment>
        <code>bw2a "test"</code>
      </example>
    </command>

    <command name="bw2a3" version="2.49" type="FE" category="support">
      <scr>N</scr>
      <simple-desc>generate an NScripter alpha image</simple-desc>
      <format>
        <format-string desc="bw2a3 (image-filename)">bw2a3 STR</format-string>
        <arg type="STR">Resulting image filename</arg>
      </format>
      <description>When given an image filename, this looks for image files by that name in folders "w" and "b", then generates an NScripter-style alpha image from them.<br />
This works much the same as <b>bw2a</b> otherwise.</description>
      <example>
        <comment>Generates an NScr-style alpha image from "w\test.bmp" and "b\test.bmp".</comment>
        <code>bw2a3 "test.bmp"</code>
      </example>
    </command>

    <command name="chainbmp" version="2.20" type="FE" category="support">
      <scr>N</scr>
      <simple-desc>glue image files together</simple-desc>
      <format>
        <format-string desc="chainbmp (image-file)">chainbmp STR</format-string>
        <arg type="STR">Image filename</arg>
      </format>
      <description>Attaches the given image onto the right-side edge of "out.bmp".<br />
This creates "out.bmp" from the image if it does not already exist.</description>
      <notice>The image should be the same height as "out.bmp".</notice>
    </command>

    <command name="createdummy" version="2.20" type="F" category="support">
      <scr>N</scr>
      <simple-desc>create a dummy image file</simple-desc>
      <format>
        <format-string desc="createdummy (dummy-file)">createdummy STR</format-string>
        <arg type="STR">Dummy image filename</arg>
      </format>
      <description>Creates a dummy 640x480 image file of the given name.<br />
The image will contain the file name in large black letters on a white background.</description>
      <notice>The image will be 640x480 even if the screen size was changed, like with <b>mode800</b>. (by senzogawa)</notice>
      <example>
        <comment>Creates a dummy image file called "test.bmp".</comment>
        <code>createdummy "test.bmp"</code>
      </example>
    </command>

    <command name="debuglog" version="2.61" type="FE" category="support">
      <scr>N</scr>
      <simple-desc>log debug messages</simple-desc>
      <format>
        <format-string desc="debuglog (log-use-flag)">debuglog NUM</format-string>
        <arg type="NUM">Debug logging flag (0: off, 1: on)</arg>
      </format>
      <description>If enabled, saves the message displayed in the debug window to "debuglog.txt".</description>
    </command>

    <command name="shell" type="E" category="execute">
      <scr>N</scr><scr ver="20080310">E</scr><scr ver="20100324">P</scr>
      <simple-desc>opens an external program, file, or URL via Explorer</simple-desc>
      <format>
        <format-string desc="shell (external-file/url)">shell STR</format-string>
        <arg type="STR">Name of external file (or URL)</arg>
      </format>
      <description>Executes the given file via Explorer, using the ShellExecute API.<br />
Note that shell execution is asynchronous with the game engine.<br />
<br />
ONScripter-EN supports the <b>shell</b> command in Windows builds, and has basic support in Mac and Linux for using it to open a URL in the default web browser.</description>
    </command>

    <command name="winexec" type="E" category="execute">
      <scr>N</scr>
      <simple-desc>execute an external program</simple-desc>
      <format>
        <format-string desc="winexec (executable-file), (sync-flag)">winexec STR,NUM</format-string>
        <arg type="STR">Execution file name</arg>
        <arg type="STR">Synchronization flag (0: asynchronous, !=0: synchronous)</arg>
      </format>
      <description>Executes the given external program using the WinExec API.<br />
If NScr is in full-screen mode, the call to WinExec will use display option SW_MAXIMIZE, while in windowed mode, it will use SW_SHOWNORMAL.<br />
For any sync-flag value other than 0, the external program will run synchronously with NScr.<br />
The executed program will send WM_USER+10 to the NScripter window if it restarted, and WM_USER+20 if the program ended.<br />
This command is used to launch a demo program in "Dolls Antique".</description>
    </command>

    <command name="csvopen" version="2.63" type="FE" category="csvfile">
      <scr>N</scr>
      <simple-desc>open a CSV file</simple-desc>
      <format>
        <format-string desc="csvopen (csv-file), (mode)">csvopen STR,STR</format-string>
        <arg type="STR">CSV file name</arg>
        <arg type="STR">file access mode</arg>
      </format>
      <description>Opens a given CSV file, using the given file access mode.<br />
The possible modes are:<br />
<indent /><b>"r"</b> - read mode; reads a standard CSV file<br />
<indent /><b>"rc"</b> - read encrypted mode; reads a CSV file written in "wc" mode<br />
<indent /><b>"w"</b> - write mode; write to a standard CSV file<br />
<indent /><b>"wc"</b> - write encrypted mode; writes an encrypted CSV file<br />
<br />
Note that it's possible to open a CSV file inside an NSA archive, but only for reading.</description>
      <notice>The CSV file will be closed automatically at a <b>reset</b> command. (by senzogawa)</notice>
      <example>
        <comment>Opens "test.csv" for reading.</comment>
        <code>csvopen "test.csv","r"</code>
      </example>
      <example>
        <comment>Opens "angou.csv" for encrypted writing.</comment>
        <code>csvopen "angou.csv","wc"</code>
      </example>
      <related cmd="csvread" />
      <related cmd="csvwrite" />
      <related cmd="csveof" />
      <related cmd="csvclose" />
    </command>

    <command name="csvread" version="2.63" type="FE" category="csvfile">
      <scr>N</scr>
      <simple-desc>read data from an open CSV file</simple-desc>
      <format>
        <format-string desc="csvread (data-var)[,...]">csvread %VAR|$VAR[,...]</format-string>
        <arg type="VAR">numeric or string variable for extracted CSV item</arg>
      </format>
      <description>(For use in read mode only)<br />
Reads data items from a CSV file, in the specified order.</description>
      <example>
        <comment>Reads 4 data items from a CSV file and assigns them to $0, $1, %0, and %2 (in that order).</comment>
        <code>csvread $0,$1,%0,%2</code>
      </example>
      <related cmd="csvopen" />
    </command>

    <command name="csvwrite" version="2.63" type="FE" category="csvfile">
      <scr>N</scr>
      <simple-desc>write data to an open CSV file</simple-desc>
      <format>
        <format-string desc="csvwrite (data-value)[,...]">csvwrite STR|NUM[,...]</format-string>
        <arg type="VAL">numeric or string value to write</arg>
      </format>
      <description>(For use in write mode only)<br />
Writes data items to a CSV file, in the specified order.</description>
      <example>
        <comment>Writes 4 data items to a CSV file: 12, "test", %1, and $2.</comment>
        <code>csvwrite 12,"test",%1,$2</code>
      </example>
      <related cmd="csvopen" />
    </command>

    <command name="csveof" version="2.63" type="FE" category="csvfile">
      <scr>N</scr>
      <simple-desc>detect whether or not at the end of an open CSV file</simple-desc>
      <format>
        <format-string desc="csveof %(result-var)">csveof %VAR</format-string>
        <arg type="VAR">numeric result variable (0: not at end of file, 1: at end of file)</arg>
      </format>
      <description>(For use in read mode only)<br />
Detects whether or not the end of a CSV file has been reached.<br />
Returns 1 if so, 0 if not.</description>
      <example>
        <comment>Sets the value of %1 depending on the end status of the CSV file.</comment>
        <code>csveof %1</code>
      </example>
      <related cmd="csvread" />
    </command>

    <command name="csvclose" version="2.63" type="FE" category="csvfile">
      <scr>N</scr>
      <simple-desc>close an open CSV file</simple-desc>
      <format>
        <format-string>csvclose</format-string>
      </format>
      <description>Closes an open CSV file.  Please use this command when finished with the file; otherwise it will remain open.</description>
      <related cmd="csvopen" />
    </command>

    <command name="&lt;&gt;" id="anglebrackets" type="T" category="textbutton">
      <scr>N</scr><scr>E</scr>
      <simple-desc>set a text button</simple-desc>
      <format>
        <format-string desc="&lt;[textbtn-num]btn-text&gt;">'&lt;'[NUM]STR'&gt;'</format-string>
        <arg type="NUM">Textbutton number, must be nonnegative (optional)</arg>
        <arg type="STR">Textbutton display text</arg>
      </format>
      <description>A character string enclosed by '&lt;' and '&gt;' is converted into a text button.</description>
      <example type="O">
        <comment>A textbutton numbered 3</comment>
        <code>`This is a `&lt;3`textbutton`&gt;`.@</code>
      </example>
      <related cmd="linkcolor" />
      <related cmd="textbtnstart" />
      <related cmd="gettextbtnstr" />
      <related cmd="erasetextbtn" />
      <related cmd="textexbtn" />
    </command>

    <command name="linkcolor" type="FE" category="textbutton">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>set textbutton colors</simple-desc>
      <format>
        <format-string desc="linkcolor #rrggbb,#rrggbb">linkcolor COLOR,COLOR</format-string>
        <arg type="COLOR">Textbutton standard color</arg>
        <arg type="COLOR">Textbutton mouseover color</arg>
      </format>
      <description>Sets the button colors for textbuttons.<br />
The default colors are yellow and cyan.</description>
      <example>
        <comment>Sets the standard textbutton color to #FFFF88 and the mouseover color to #88FF88.</comment>
        <code>linkcolor #FFFF88,#88FF88</code>
      </example>
      <related cmd="anglebrackets" />
    </command>

    <command name="textbtnstart" type="E" category="textbutton">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>specify starting number for unnumbered textbuttons</simple-desc>
      <format>
        <format-string desc="textbtnstart (start-num)">textbtnstart NUM</format-string>
        <arg type="NUM">Starting number for unnumbered textbuttons (default: 1)</arg>
      </format>
      <description>Specifies the starting number for unnumbered textbuttons; 1 is the default value.</description>
      <example>
        <comment>Sets the starting number for unnumbered textbuttons to 3.</comment>
        <code>textbtnstart 3</code>
      </example>
      <related cmd="anglebrackets" />
    </command>

    <command name="gettextbtnstr" type="E" category="textbutton">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>retrieve the text of a particular textbutton</simple-desc>
      <format>
        <format-string desc="gettextbtnstr (string-var), (textbtn-num)">gettextbtnstr $VAR,NUM</format-string>
        <arg type="VAR">Result string variable</arg>
        <arg type="NUM">Textbutton number</arg>
      </format>
      <description>Retrieves the text of the textbutton with the given number.<br />
Returns a value of "" if the textbutton doesn't exist.</description>
      <example>
        <comment>Gets the text of textbutton number 12 and assigns it to $0.</comment>
        <code>gettextbtnstr $0,12</code>
      </example>
      <related cmd="anglebrackets" />
    </command>

    <command name="erasetextbtn" type="E" category="textbutton">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>clear a pressed textbutton</simple-desc>
      <format>
        <format-string>erasetextbtn</format-string>
      </format>
      <description>After exiting a button wait, if a textbutton was pressed, then this command will set the textbutton back to its original color.</description>
      <related cmd="anglebrackets" />
    </command>

    <command name="textexbtn" type="E" category="textbutton">
      <scr ver="2.65">N</scr><scr>E</scr>
      <simple-desc>create a complex textbutton (similar to <b>exbtn</b>)</simple-desc>
      <format>
        <format-string desc="textexbtn (textbtn-num), (control-str)">textexbtn NUM,STR</format-string>
        <arg type="NUM">Textbutton number</arg>
        <arg type="STR">Sprite control string</arg>
      </format>
      <description>Adds complex behavior to a textbutton, in much the same manner as <b>exbtn</b>.</description>
      <related cmd="exbtn" />
    </command>

    <command name="textbtnoff" type="E" category="textbutton">
      <scr ver="2.74">N</scr><scr>E</scr>
      <simple-desc>inactivate textbuttons</simple-desc>
      <format>
        <format-string>textbtnoff</format-string>
      </format>
      <description>Textbuttons are usually active during a <b>btnwait</b>.<br />
Using <b>textbtnoff</b> between <b>btndef</b> and <b>btnwait</b> commands will turn off text buttons during the wait.<br />
This can be useful if, for example, textbuttons need to be off while other buttons are processed.</description>
      <example>
        <comment>Inactivates buttons and textbuttons before waiting for user input.</comment>
        <code>btndef clear
textbtnoff
textbtnwait %0</code>
      </example>
      <related cmd="btnwait" />
      <related cmd="btnwait2" />
      <related cmd="textbtnwait" />
    </command>

    <command name="lsp2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load an extended sprite into memory</simple-desc>
      <format>
        <format-string desc="lsp2 (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsp2 NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite.  Extended sprites add rotation about center and horizontal/vertical scaling to the existing sprite elements of position and opacity;  it's also possible to flip images with the use of negative scale factors.<br />
Like <b>lsp</b>, <b>lsp2</b> loads images using the set display transparency mode.<br />
The scaling factors are percentages; also note that providing a negative scaling factor will reverse the direction of the image.</description>
      <notice>The <b>lsp2</b> command does not correspond to current animation</notice>
      <example>
        <comment>Loads and displays the image "test.bmp" without transparency, centered at (320,240), expanded to 200% vertically, and rotated 36 degrees counterclockwise.</comment>
        <code>lsp2 0,":c;test.bmp",320,240,100,200,36</code>
      </example>
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="lsph2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>load an extended sprite into memory (hidden)</simple-desc>
      <format>
        <format-string desc="lsph2 (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsph2 NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite in a hidden state.<br />
The only difference between <b>lsp2</b> and <b>lsph2</b> is the beginning condition of the extended sprite - <b>lsp2</b> displays the sprite, while <b>lsph2</b> keeps the sprite hidden (which may later be displayed with <b>vsp2</b>).</description>
      <related cmd="lsp2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="lsp2add" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>E</scr>
      <simple-desc>load an extended sprite using additive composition</simple-desc>
      <format>
        <format-string desc="lsp2add (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsp2add NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite using additive composition.<br />
<b>lsp2add</b> uses additive blending for display, but otherwise it works the same as <b>lsp2</b>.</description>
      <example>
        <comment>Loads the image "test.bmp" and displays without transparency using additive blending, centered at (320,240), expanded to 200% vertically, and rotated 36 degrees counterclockwise.</comment>
        <code>lsp2add 0,":c;test.bmp",320,240,100,200,36</code>
      </example>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="lsph2add" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>E</scr>
      <simple-desc>load an extended sprite using additive composition (hidden)</simple-desc>
      <format>
        <format-string desc="lsph2add (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsph2add NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite using additive composition, in a hidden starting state.<br />
The only difference between <b>lsp2add</b> and <b>lsph2add</b> is the beginning condition of the extended sprite - <b>lsp2add</b> displays the sprite, while <b>lsph2add</b> keeps the sprite hidden (which may later be displayed with <b>vsp2</b>).</description>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="lsp2sub" type="E" category="sprite_ex">
      <scr ver="2.93">N</scr><scr>E</scr>
      <simple-desc>load an extended sprite using subtractive composition</simple-desc>
      <format>
        <format-string desc="lsp2sub (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsp2add NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite using subtractive composition.<br />
<b>lsp2sub</b> uses subtractive blending for display, but otherwise it works the same as <b>lsp2</b>.</description>
      <example>
        <comment>Loads the image "test.bmp" and displays without transparency using subtractive blending, centered at (320,240), expanded to 200% vertically, and rotated 36 degrees counterclockwise.</comment>
        <code>lsp2sub 0,":c;test.bmp",320,240,100,200,36</code>
      </example>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="lsph2sub" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="lsph2sub" version="(undoc)" type="E" category="sprite_ex">
      <scr ver="2.93">N</scr><scr>E</scr>
      <simple-desc>load an extended sprite using subtractive composition (hidden)</simple-desc>
      <format>
        <format-string desc="lsph2sub (ex_sprite-num), (image-str), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">lsph2add NUM,STR,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="STR">Image filename or sprite processing string</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Loads an extended sprite using subtractive composition, in a hidden starting state.<br />
The only difference between <b>lsp2sub</b> and <b>lsph2sub</b> is the beginning condition of the extended sprite - <b>lsp2sub</b> displays the sprite, while <b>lsph2sub</b> keeps the sprite hidden (which may later be displayed with <b>vsp2</b>).</description>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="lsp2sub" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="csp2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>delete extended sprite from memory</simple-desc>
      <format>
        <format-string desc="csp2 (ex_sprite-num)">csp2 NUM</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255), or -1 for all</arg>
      </format>
      <description>Erases the given extended sprite.<br />
If the given value is -1, it erases all extended sprites.</description>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="vsp2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>toggle display of a loaded extended sprite</simple-desc>
      <format>
        <format-string desc="vsp2 (ex_sprite-num), (visible:0=no/1=yes)">vsp2 NUM,NUM</format-string>
        <arg type="NUM">Extended-sprite number</arg>
        <arg type="NUM">visibility flag (0: not visible, 1: visible)</arg>
      </format>
      <description>Toggles display of specified extended sprite. 0 is off, 1 is on.</description>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="msp2" />
      <related cmd="amsp2" />
    </command>

    <command name="msp2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change extended sprite position (relative)</simple-desc>
      <format>
        <format-string desc="msp2 (ex_sprite-num), (X-offset), (Y-offset), (X-scale-offset), (Y-scale-offset), (rotation-offset)[, (opacity-offset)]">msp2 NUM,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number</arg>
        <arg type="NUM">X-coordinate offset</arg>
        <arg type="NUM">Y-coordinate offset</arg>
        <arg type="NUM">X scaling factor offset</arg>
        <arg type="NUM">Y scaling factor offset</arg>
        <arg type="NUM">Rotation angle offset</arg>
        <arg type="NUM">Opacity offset</arg>
      </format>
      <description>Moves the extended sprite of the designated number, adjusting its position, scale, rotation and opacity relative to their current values.</description>
      <example>
        <comment>Takes Extended-Sprite 0 and moves it 10 pixels right and 20 pixels down, while decreasing its X-scale factor by 10, increasing its Y-scale factor by 10, and adding 5 degrees to its rotation.</comment>
        <code>msp2 0,10,20,-10,10,5</code>
      </example>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="amsp2" />
    </command>

    <command name="amsp2" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>change extended sprite position (absolute)</simple-desc>
      <format>
        <format-string desc="amsp2 (ex_sprite-num), (center X-pos), (center Y-pos), (X-scale), (Y-scale), (rotation)[, (opacity)]">amsp2 NUM,NUM,NUM,NUM,NUM,NUM[,NUM]</format-string>
        <arg type="NUM">Extended-sprite number (0 - 255)</arg>
        <arg type="NUM">Center X-coordinate</arg>
        <arg type="NUM">Center Y-coordinate</arg>
        <arg type="NUM">Scaling factor X (%)</arg>
        <arg type="NUM">Scaling factor Y (%)</arg>
        <arg type="NUM">Rotation angle (degrees, counterclockwise)</arg>
        <arg type="NUM">Opacity value (optional, default 255)</arg>
      </format>
      <description>Similar to <b>msp2</b>, but this command changes the given extended sprite's position, scale, rotation, and opacity to absolute values instead of relatively.</description>
      <example>
        <comment>Takes Extended-Sprite 0 and moves its center to (10,20) while setting its scale factors to 10% and its rotation to 5 degrees.</comment>
        <code>amsp2 0,10,20,10,10,5</code>
      </example>
      <related cmd="lsp2" />
      <related cmd="lsph2" />
      <related cmd="lsp2add" />
      <related cmd="lsph2add" />
      <related cmd="csp2" />
      <related cmd="vsp2" />
      <related cmd="msp2" />
    </command>

    <command name="allsp2hide" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>hide all extended sprites at the same time</simple-desc>
      <format>
        <format-string>allsp2hide</format-string>
      </format>
      <description>Hides all extended sprites at the same time.  (Works essentially the same as <b>allsphide</b>.)</description>
      <related cmd="allsp2resume" />
      <related cmd="allsphide" />
      <related cmd="allspresume" />
    </command>

    <command name="allsp2resume" type="E" category="sprite_ex">
      <scr ver="2.80">N</scr><scr>O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>redisplay extended sprites hidden with <b>allsp2hide</b></simple-desc>
      <format>
        <format-string>allsp2resume</format-string>
      </format>
      <description>Redisplays the extended sprites that were hidden by <b>allsp2hide</b>.  (Works essentially the same as <b>allspresume</b>.)</description>
      <related cmd="allsp2hide" />
      <related cmd="allsphide" />
      <related cmd="allspresume" />
    </command>

    <command name="bclear" version="2.93" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>clear button definitions</simple-desc>
      <format>
        <format-string>bclear</format-string>
      </format>
      <description>Clears defined buttons.</description>
      <notice>The same as <b>btndef clear</b>? (by Mion)</notice>
      <related cmd="btndef" />
    </command>

    <command name="bsp" version="2.93" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>create a button from a sprite</simple-desc>
      <format>
        <format-string desc="bsp (sprite-num)[, (mouseoff-control-str), (mouseover-control-str), (mousepress-control-str)]">bsp NUM[,STR,STR,STR]</format-string>
        <arg type="NUM">Sprite number</arg>
        <arg type="STR">Sprite control string for mouseoff</arg>
        <arg type="STR">Sprite control string for mouseover</arg>
        <arg type="STR">Sprite control string for mousepress</arg>
      </format>
      <description>Creates a button from the given sprite.<br />
If the optional parameters are omitted, the sprite displays like so: Cell 0 on mouseoff, Cell 1 on mouseover, and (if the sprite contains at least 3 cells) Cell 2 on mousepress.<br />
The three optional parameters are sprite control strings, with the same format used for <b>exbtn</b> and <b>spstr</b>. The first string executes when the mouse is not over the button (mouseoff), the second on mouseover of the button, and the third on mousepress of the button.<br />
Since a control string "" does nothing, use empty control strings when you don't want one of the three mouse button events to change the display.</description>
      <notice>This command had a bug when handling control strings, but was fixed in the 20090417 release.</notice>
      <example>
        <comment>Creates a button from Sprite 1.</comment>
        <code>bsp 1</code>
      </example>
      <example>
        <comment>Creates a button from Sprite 2, setting sprite control strings for mouseoff, mouseover, and mousepress.</comment>
        <code>bsp 2,"P3,0","P3,1","P4,1"</code>
      </example>
      <related cmd="spbtn" />
      <related cmd="exbtn" />
    </command>

    <command name="bdef" version="2.93" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>specify behavior for when no sprite button is moused over</simple-desc>
      <format>
        <format-string desc="bdef (default-control-str)">bdef STR</format-string>
        <arg type="STR">Default sprite control string</arg>
      </format>
      <description>Specifies behavior for when no sprite buttons are being moused over. Uses the same control string format as <b>exbtn</b> and <b>spstr</b>.</description>
      <example>
        <comment>Sets to hide Sprite 0 whenever none of the sprite buttons are moused over.</comment>
        <code>bdef "C0"</code>
      </example>
      <related cmd="exbtn_d" />
    </command>

    <command name="btime" version="2.93" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>specify button processing timeout duration</simple-desc>
      <format>
        <format-string desc="btime (time-limit)[, (voice-wait-flag)]">btime NUM[,NUM]</format-string>
        <arg type="NUM">Timeout duration (ms)</arg>
        <arg type="NUM">Voice-wait flag (1: wait for voice)</arg>
      </format>
      <description>Specifies timeout duration for button processing.<br />
If an optional parameter 1 is given after the timeout value, button processing will allow the voice channel (dwave 0) to finish playing before counting down the timeout; this is used for auto mode, etc.</description>
      <example>
        <comment>Sets button timeout to 2 seconds.</comment>
        <code>btime 2000</code>
      </example>
      <example>
        <comment>Sets button timeout to 1 second for after voices have finished.</comment>
        <code>btime 1000,1</code>
      </example>
      <related cmd="btntime" />
    </command>

    <command name="bexec" version="2.93" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>execute button processing</simple-desc>
      <format>
        <format-string desc="bexec $(input-result)[, %(num-input-result)]">bexec $VAR[,%VAR]</format-string>
        <arg type="VAR">Input result var</arg>
        <arg type="VAR">Numeric result var (0 or more: button sprite number, -1: anything else)</arg>
      </format>
      <description>Executes button processing. Both a string variable and a numeric variable may be provided as arguments.<br />
Button processing settings remain until <b>bclear</b> is executed.<br />
Both the timeout setting and elapsed button processing time remain until <b>btime</b> is executed.<br />
<br />
<b>Possible string variable return values:</b><br />
<indent /><b>"LCLICK"</b> - on mouse left-click anywhere but a sprite button<br />
<indent /><b>"S</b>(sprite-num)<b>"</b> - on mouse left-click within a sprite button, e.g. clicking Sprite 12 returns "S12"<br />
<indent /><b>"TIMEOUT"</b> - on button processing timeout<br />
<indent /><b>"RCLICK"</b> - on mouse right-click<br />
<indent /><b>"MCLICK"</b> - on mouse middle-click<br />
Letter/digit/symbol keypresses return the pressed key character (e.g. "1", "W"); note that alphabet letters will be uppercase.<br />
Other keypress return values:<br />
<indent /><b>"SPACE"</b> - Spacebar<br />
<indent /><b>"RETURN"</b> - Return or Enter key<br />
<indent /><b>"CTRL"</b> - any Ctrl key<br />
<indent /><b>"SHIFT"</b> - any Shift key<br />
<indent /><b>"UP"</b>, <b>"DOWN"</b>, <b>"LEFT"</b>, <b>"RIGHT"</b> - Up, Down, Left, or Right arrow keys<br />
<indent /><b>"F1"</b> to <b>"F12"</b> - Function keys<br />
<indent /><b>"PAGEUP"</b>, <b>"PAGEDOWN"</b> - PageUp or PageDown keys<br />
<br />
The numeric variable (if provided) will contain the sprite number of the button that was left-clicked, if applicable; if button processing ends without a sprite button being pressed, the numeric variable will have a return value of -1.<br />
<br />
Since <b>bexec</b> will finish on any kind of click or keypress, be sure to put this command within a loop if you need to check for a desired return condition.</description>
      <notice>The 20090422 release added support for middle-button clicks.<br />
Note that ver.2.93 returns CCLICK instead of MCLICK from ver2.94 forward.<br />
Also, ver.2.94 changed the default behavior for <b>bexec</b> so that it won't return on arrow key or Spacebar/Enter keypresses. This allows using arrow keys to move between buttons and the Spacebar/Enter key to "click" the current button.</notice>
      <example>
        <comment>Executes button processing, storing input results in $0 and %0.</comment>
        <code>bexec $0,%0</code>
      </example>
      <related cmd="btnwait" />
    </command>

    <command name="bcursor" version="2.94" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>return cursor key input during button processing</simple-desc>
      <format>
        <format-string>bcursor</format-string>
      </format>
      <description>By default (since ver.2.94), <b>bexec</b> won't return on arrow key or Spacebar/Enter keypresses.<br />
To force returning those keypresses as well, execute <b>bcursor</b> after <b>bclear</b> and before <b>bexec</b>.</description>
      <related cmd="getcursor" />
    </command>

    <command name="bdown" version="2.94" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>return from button processing while button is pressed</simple-desc>
      <format>
        <format-string>bdown</format-string>
      </format>
      <description>If <b>bdown</b> is executed after <b>bclear</b> and before <b>bexec</b>, <b>bexec</b> will return on a left-click even before the mouse button press is released.</description>
      <related cmd="btndown" />
    </command>

    <command name="btrans" version="2.94" type="E" category="button_ex">
      <scr>N</scr>
      <simple-desc>ignore transparent areas during button processing</simple-desc>
      <format>
        <format-string>btrans</format-string>
      </format>
      <description>Executing <b>btrans</b> after <b>bclear</b> and before <b>bexec</b>will cause button processing to treat transparent areas of sprite buttons as outside the respective buttons.</description>
      <related cmd="transbtn" />
    </command>

    <command name="`" id="backquote" type="T" category="format">
      <scr ver="20040909">O</scr><scr>E</scr><scr>P</scr>
      <simple-desc>enter single-byte text mode</simple-desc>
      <format>
        <format-string>`</format-string>
      </format>
      <description>Use this character to enter single-byte text mode.<br />
Japanese ONScripter must be compiled with ENABLE_1BYTE_CHAR defined to use this mode; ONScripter-EN has it available by default.<br />
<br />
The following text commands work within single-byte mode:<br />
<indent /><b>@ / \ !w !s !d !sd $VAR #rrggbb</b><br />
<br />
You may use '$$' to produce the character '$'. Other text commands must be outside single-byte mode to work - the backquote can work as a toggle in these cases:<br />
<indent /><b>`I have ` %0 ` apples.@</b><br />
<br />
Also note that backquotes can be used in place of double-quotes for string arguments to commands, to have the strings be used in single-byte mode (e.g. puttext `Hello there`; otherwise, backquotes may be used within strings to toggle single-byte mode (e.g. ":s;#FF0000`Red text sprite")</description>
      <notice>When <b>textgosub</b> is defined, the clickwait <b>@</b> should be toggled out of single-byte mode (e.g. <b>`Hello.`@` This is text`@</b>), otherwise single-byte text after the clickwait won't display correctly. (by Mion)</notice>
      <notice>In ponscripter, this use of <b>`</b> is only available in onscripter compatibility mode (i.e. when run on SJIS scripts). (by Mion)</notice>
      <example type="O">
        <comment>Example ONScripter script with commands that use single-byte mode.</comment>
        <code>*define
numalias name,0
clickstr `.?"`,2
savename `Save the scene`, `Load the scene`, "Memory "
rmenu `Save to file`,save,`Load from file`,load
game

*start
`Hi, this is a test.
`#FF0000This is another test.#FFFFFF
`_"He said so."
`_"She said so."
`Does it work??
mov $name,`Mion Sonozaki`
`Hello there $name.@ How are you?@
br
selgosub `Say "Turn to the right."`, *right, `Say "Turn to the left."`, *left, "`Do nothing.", *nothing
end 

*right
`You turned to the right.\
return

*left
`You turned to the left.\
return

*nothing
`You didn't do anything.\
return</code>
      </example>
    </command>

    <command name="language" type="FE" category="drawtext">
      <scr ver="20080823">E</scr>
      <simple-desc>set preferred text language</simple-desc>
      <format>
        <format-string desc="language {english/japanese}">language {english/japanese}</format-string>
        <arg type="NAME">english: prefer English, japanese: prefer Japanese</arg>
      </format>
      <description>This sets the preferred text display language in ONScripter-EN, more-or-less replacing the FORCE_1BYTE_CHAR compilation option.<br />
The right-click menu will use the preferred language for display messages, and text display will take preferred language, kinsoku settings, and whether a chunk of text contains single-byte and/or double-byte characters into account when performing linebreaks.<br />
This command can be used within either the define or program block, and may be set by default from the command line or depending on the executable filename (i.e. "onscripter-en.exe" is assumed to prefer English).<br />
<br />
Note that ENABLE_1BYTE_CHAR must be set at ONScripter compile time to be able to use <b>language english</b>.</description>
      <example type="O">
        <comment>Sets preferred language to Japanese.</comment>
        <code>language japanese</code>
      </example>
    </command>

    <command name="0x" id="hexliteral" type="S" category="format">
      <scr>P</scr>
      <simple-desc>provide a numeric literal in hexadecimal format</simple-desc>
      <format>
        <format-string desc="0x(hexnum)">'0x'HNUM</format-string>
        <arg type="HNUM">Hexidecimal number (any combination of digits 0-9, a-f, A-F)</arg>
      </format>
      <description>This syntax allows providing a numeric literal value in hexidecimal instead of regular decimal, which can be more convenient in some cases.<br />
PONScripter allows this format almost everywhere regular numeric literals are allowed, with the exception of ! and ~ text directives and tags.</description>
      <example type="P">
        <comment>Defines a numeric alias using hexadecimal.</comment>
        <code>numalias ascii_slash,0x2F</code>
      </example>
    </command>

    <command name="^" id="caret" type="T" category="format">
      <scr>P</scr>
      <simple-desc>enter ponscripter text mode</simple-desc>
      <format>
        <format-string>^</format-string>
      </format>
      <description>Use this character to enter ponscripter text mode.<br />
<br />
The following text commands work within ponscripter text mode:<br />
<indent /><b>@ / \ !w !s !d !sd $VAR %VAR #rrggbb</b><br />
<br />
You may use '#' before any of the characters @, /, \, $, %, !, #, and _ to display the literal character, thereby preventing it from parsing as a text command.<br />
<br />
PONScripter text mode supports <b>~</b>-marked formatting tags; a literal ~ can be displayed with '~~'.<br />
<br />
Also note that carets can be used in place of double-quotes for string arguments to commands (e.g. puttext ^Hello there^). Strings delimited in this manner are parsed like regular double-quoted strings, but with additional parsing for <b>~</b> formatting tags (e.g. ^~b~Hello~b~ there^ displays as "<b>Hello</b> there").</description>
      <related cmd="tildetag" />
    </command>

    <command name="~" id="tildetag" type="T" category="ponscr">
      <scr>P</scr>
      <simple-desc>set a ponscripter formatting tag region</simple-desc>
      <format>
        <format-string desc="~(tag)[...]~">'~'FTAG[...]'~'</format-string>
        <arg type="FTAG">A ponscripter formatting tag value</arg>
      </format>
      <description>Sets a PONScripter formatting tag region, which can contain one or more of the following formatting tag values (possibly delimited by spaces):<br />
<br />
<b>Font Style:</b><br />
(Note that most of the tags in this section assume a font slot layout as described in the <b>pmapfont</b> command definition.)<br />
<indent /><b>c</b>NUM<indent />select the font in slot NUM (0-7)<br />
<indent /><b>d</b><indent /><indent />select the default font style (same as <b>c0</b>)<br />
<indent /><b>r</b><indent /><indent />disable italics (default)<br />
<indent /><b>i</b><indent /><indent />toggle italics<br />
<indent /><b>t</b><indent /><indent />disable bold (default)<br />
<indent /><b>b</b><indent /><indent />toggle bold<br />
<indent /><b>f</b><indent /><indent />select the 'text' face (default)<br />
<indent /><b>s</b><indent /><indent />select the 'display' face<br />
<br />
<b>Text Size:</b><br />
(In this section, 'base size' refers to the font size for the active window, while 'current size' refers to the current font size as specified using prior text size formatting tags.)<br />
<indent /><b>=</b>NUM<indent />set the current size to exactly NUM pixels (0 will reset to the base size)<br />
<indent /><b>%</b>NUM<indent />set the current size to NUM-percent of the base size<br />
<indent /><b>+</b>NUM<indent />increase the current size by NUM pixels<br />
<indent /><b>-</b>NUM<indent />decrease the current size by NUM pixels<br />
<br />
<b>Text Position:</b><br />
<indent /><b>x</b>NUM<indent />set the horizontal text position to NUM pixels right of the active window's left margin<br />
<indent /><b>y</b>NUM<indent />set the vertical text position to NUM pixels below the active window's top margin<br />
<indent /><b>x+</b>NUM<indent />adjust the current horizontal text position NUM pixels to the right<br />
<indent /><b>y+</b>NUM<indent />adjust the current vertical text position NUM pixels down<br />
<indent /><b>x-</b>NUM<indent />adjust the current horizontal text position NUM pixels to the left<br />
<indent /><b>y-</b>NUM<indent />adjust the current vertical text position NUM pixels up<br />
<br />
<b>Indentation:</b><br />
<indent /><b>n</b><indent /><indent />set the indent to the current horizontal position; new text lines will start from this offset until the end of the current page<br />
<indent /><b>u</b><indent /><indent />reset the indent to the left margin; note that this will only apply to later text lines, so use it at the end of the last line of an indented section<br />
The indent is also set automatically when the first character of a page is an indenting character, as set using <b>pindentstr</b>.<br />
<br />
</description>
      <example type="P">
        <comment>Displays the text "Hello there" using font style 1.</comment>
        <code>puttext ^~c1~Hello there^</code>
      </example>
      <example type="P">
        <comment>Produces a section of indented text followed by unindented text.</comment>
        <code>^Bruce: ~n~What's that you say?@
^You don't understand indenting?~u~@
br
^Rick shuffled his feet.\</code>
      </example>
      <example type="P">
        <comment>Displays the text "Heading" in italics, 120% of the base font size, 20 pixels left and 40 pixels up from the current position. The italics and font size are reset afterwards.</comment>
        <code>^~i %120 x-20 y-40~Heading~i =0~</code>
      </example>
      <related cmd="pmapfont" />
      <related cmd="pindentstr" />
    </command>

    <command name="pmapfont" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>map a font file to a ponscripter font slot</simple-desc>
      <format>
        <format-string desc="pmapfont (slot-num),(font-file)[, (metrics-file)]">pmapfont NUM,STR[,STR]</format-string>
        <arg type="NUM">Font slot (0-7)</arg>
        <arg type="STR">Font filename</arg>
        <arg type="STR">Font metrics file (Type 1 fonts only)</arg>
      </format>
      <description>Maps a font file to the given font slot.<br />
For TrueType and OpenType fonts, the font file should be of type ".ttf" or ".otf"; for Type 1 fonts, the font file should be of type ".pfa" or ".pfb", with the metrics option providing the corresponding ".afm" file.<br />
<br />
Filenames are relative to the game's data path. If a file is not found there, it is then sought within a "fonts" subdirectory of the data path, then in the game's archive, and then in the game binary itself (in case the font has been embedded).<br/>
As a last resort, and for compatibility, Ponscripter checks for a file named "default.ttf" in the game's data path.<br/>
<br/>
The eight font slots are intended to represent two typefaces (a text face and a display face), each with regular, italic, bold, and bold-italic styles, as follows:<br/>
<indent />slot <b>0</b> - text face, regular font<br/>
<indent />slot <b>1</b> - text face, italics font<br/>
<indent />slot <b>2</b> - text face, bold font<br/>
<indent />slot <b>3</b> - text face, bold-italic font<br/>
<indent />slot <b>4</b> - display face, regular font<br/>
<indent />slot <b>5</b> - display face, italics font<br/>
<indent />slot <b>6</b> - display face, bold font<br/>
<indent />slot <b>7</b> - display face, bold-italic font<br/>
You can, of course, assign fonts however you like, but following this convention permits straightforward use of mnemonic formatting tags.<br />
<br />
Note that mapping fonts in this way is optional - a slot that has not had a font assigned to it via <b>pmapfont</b> will use the default filename "face<b>N</b>.ttf", where <b>N</b> is the slot number.</description>
      <example type="P">
        <comment>Maps font slot 0 to "myprettyfont.ttf".</comment>
        <code>pmapfont 0,"myprettyfont.ttf"</code>
      </example>
    </command>

    <command name="prendering" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>configure ponscripter text rendering</simple-desc>
      <format>
        <format-string desc="prendering (hinting), (positioning)[, (rendermode)]">prendering {none|full|light},{integer|float}[,{light|normal}]</format-string>
        <arg type="ENUM">Hinting (either none, full, or light)</arg>
        <arg type="ENUM">Positioning (either integer or float)</arg>
        <arg type="ENUM">Optional Freetype rendering mode (light or normal)</arg>
      </format>
      <description>Configures the Freetype text rendering mode.<br/>
<br/>
Hinting can be one of the following:<br/>
<indent/><b>none</b> - no hinting (default)<br/>
<indent/><b>full</b> - Freetype hinting<br/>
<indent/><b>light</b> - Light hinting<br/>
The optimum settings depend on the fonts in use.  In general, Freetype hinting makes TrueType fonts look hideous, but it does sometimes help with Type 1 fonts.<br/>
<br/>
Use the bareword <b>integer</b> for positioning - although <b>float</b> is available and uses subpixel positioning, which would in theory give better spacing, it has never worked properly and tends to look awful.<br/>
<br/>
The optional parameter can be used to override the Freetype rendering mode.  It should be one of the barewords <b>light</b> or <b>normal</b>.  By default, light rendering is used with light hinting, and normal rendering otherwise.</description>
    </command>

    <command name="pfontstyle" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>set the default font style</simple-desc>
      <format>
        <format-string desc="pfontstyle (font-style)">pfontstyle STR</format-string>
        <arg type="STR">Font style tag</arg>
      </format>
      <description>Sets the default text styling.  This command is equivalent to inserting a <b>~d</b> STR<b>~</b><br/> formatting tag at the start of every subsequent text command (though it has no effect on sprites).<br/>
<br/>
Only font style tags are may be used; size and position tags are not supported.</description>
      <example type="P">
        <comment>Displays text in italic display font (slot 5).</comment>
        <code>pfontstyle "si"
^Here is a page of italic text.\
^And it's still italic!\
pfontstyle ^d^ ;back to regular style</code>
      </example>
      <related cmd="tildetag" />
      <related cmd="pmapfont" />
    </command>

    <command name="pligate" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>add or remove a ligature or shortcut sequence</simple-desc>
      <format>
        <format-string desc="pligate (input),(unicode)">pligate STR,NUM|STR</format-string>
        <arg type="STR">Shortcut matching text</arg>
        <arg type="NUM">Unicode codepoint for shortcut result (if numeric)</arg>
        <arg type="STR">(Unicode) char for shortcut result (if string)</arg>
      </format>
      <format>
        <format-string desc="pligate (input),remove">pligate STR,remove</format-string>
        <arg type="STR">Shortcut matching text</arg>
        <arg type="ENUM">Keyword to remove the defined matching shortcut</arg>
      </format>
      <format>
        <format-string desc="pligate (preset)">pligate {none|default|basic|punctuation|f_ligatures|specials|all}</format-string>
        <arg type="ENUM">Keyword for a preset shortcut set</arg>
      </format>
      <description>Adds or removes shortcut sequences. This commands lets you define a sequence of ASCII (or Unicode) characters to be replaced with a single Unicode character within text, for use as shortcuts or mappings to ligatures.<br/>
<br/>
The Unicode result for a particular shortcut may be given either as the numeric value of a Unicode codepoint, or as a string whose first (Unicode) character will be used as the result. Use the bareword <b>remove</b> to remove the shortcut with the defined sequence.<br/>
<br/>
In its single-argument form, this command enables the specified preset shortcuts. Valid arguments are:<br/>
<br/>
<indent/><b>none</b> - will <b>remove all</b> defined shortcuts, even defaults<br/>
<indent/><b>all</b> - adds all of the following preset shortcuts<br/>
<indent/><b>default</b> - enables <b>basic</b> and <b>specials</b> presets (default)<br/>
<indent/><b>f_ligatures</b> - adds ligatures for "ff", "fi", "fl", "ffi", and "ffl"<br/>
<indent/><b>specials</b> - adds the hash escape sequences for the special characters <b>@</b>, <b>/</b>, <b>\</b>, <b>_</b>, <b>^</b>, <b>`</b>, <b>!</b>, <b>#</b><br/>
<indent/><b>basic</b> - adds the following sequences for quotes:<br/>
<indent/><indent/>"`"<indent/> <b>‘</b> (left single quotation mark)<br/>
<indent/><indent/>"``"<indent/> <b>“</b> (left double quotation mark)<br/>
<indent/><indent/>"'"<indent/> <b>’</b> (right single quotation mark)<br/>
<indent/><indent/>"''"<indent/> <b>”</b> (right double quotation mark)<br/>
<indent/><b>punctuation</b> - adds shortcuts for these punctuation symbols:<br/>
<indent/><indent/>"%-"<indent/> <b>‑</b> (non-breaking hyphen)<br/>
<indent/><indent/>"%_"<indent/> U+00A0 (non-breaking space)<br/>
<indent/><indent/>"%."<indent/> U+2009 (thin space)<br/>
<indent/><indent/>"..."<indent/> <b>…</b> (horizontal ellipsis)<br/>
<indent/><indent/>"--"<indent/> <b>–</b> (en dash)<br/>
<indent/><indent/>"---"<indent/> <b>—</b> (em dash)<br/>
<indent/><indent/>"(c)"<indent/> <b>©</b> (copyright sign)<br/>
<indent/><indent/>"(r)"<indent/> <b>®</b> (registered sign)<br/>
<indent/><indent/>"(tm)"<indent/> <b>™</b> (trademark sign)<br/>
<indent/><indent/>"++"<indent/> <b>†</b> (dagger)<br/>
<indent/><indent/>"+++"<indent/> <b>‡</b> (double dagger)<br/>
<indent/><indent/>"**"<indent/> <b>•</b> (bullet)<br/>
<br/>
To display a shortcut sequence as-is within text, insert a Unicode zero-width non-joiner (ZWNJ) or its builtin shortcut <b>|</b> within the sequence to prevent it from matching the shortcut. (The ZWNJ will not be displayed).<br/>
If the Unicode character for a shortcut/ligature is not present in the current font, that shortcut sequence will not be replaced in text.<br/>
<br/>
Please note that this command, and ligature/shortcut processing in general, are not available in onscripter compatibility mode.</description>
      <example type="P">
        <comment>Defines shortcuts and displays text using them.</comment>
        <code>pligate basic ;presets for curly quotes
pligate "-->",0x2192 ;rightwards arrow
pligate "'",remove ;don't replace single apostrophe with curly quote

^``Check it out --> it's my funky-cool shortcut example.''\
;assuming a font that contains all those glyphs, the previous text should display as:
;“Check it out → it's my funky-cool shortcut example.”</code>
      </example>
    </command>

    <command name="pindentstr" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>specify characters that cause indents</simple-desc>
      <format>
        <format-string desc="pindentstr (indent-chars)">pindentstr STR</format-string>
        <arg type="STR">Indent characters</arg>
      </format>
      <format>
        <format-string desc="pindentstr basic">pindentstr basic</format-string>
        <arg type="ENUM">Keyword for the standard indenting characters</arg>
      </format>
      <description>Specifies a set of characters where, if one appears as the first character of a page, it will set an indent; this is equivalent to following the character with a <b>~n~</b> formatting tag.<br/>
Giving an empty string will clear all indent characters.<br/>
<br/>
Using the <b>basic</b> keyword will cause indenting on the following characters:<br/>
<indent/><b>(</b> U+0028 (left paren)<br/>
<indent/><b>-</b> U+2014 (em dash)<br/>
<indent/><b>‘</b> U+2018 (left single curly quote)<br/>
<indent/><b>“</b> U+201c (left double curly quote)<br/>
<indent/><b>「</b> U+300c (left corner bracket)<br/>
<indent/><b>『</b> U+300e (left white corner bracket)<br/>
<indent/><b>（</b> U+ff08 (fullwidth left paren)<br/>
<indent/><b>～</b> U+ff5e (fullwidth tilde)<br/>
<indent/><b>｢</b> U+ff62 (halfwidth left corner bracket)</description>
      <notice>Since ponscripter-20091015, scripts start out with <b>no</b>defined indent characters, so please use this command if you want indenting characters.<br/>
<b>pindentstr basic</b>will restore the default indent characters from earlier ponscripter versions. (by Mion)</notice>
      <example type="P">
        <comment>Sets quote marks (undirected and left) as indenting characters.</comment>
        <code>pindentstr ^"'‘“^</code>
      </example>
      <related cmd="tildetag" />
    </command>

    <command name="pbreakstr" type="FE" category="ponscr">
      <scr ver="20090926">P</scr>
      <simple-desc>specify characters that allow linebreaks</simple-desc>
      <format>
        <format-string desc="pbreakstr (break-chars)">pbreakstr STR</format-string>
        <arg type="STR">Break characters</arg>
      </format>
      <format>
        <format-string desc="pbreakstr basic">pbreakstr basic</format-string>
        <arg type="ENUM">Keyword for the standard linebreaking characters</arg>
      </format>
      <description>Specifies a set of characters that allow linebreaks; if necessary for word-wrapping, ponscripter will make a new line right after one of these characters.<br/>
Giving an empty string will clear all linebreak characters (including space!)<br/>
<br/>
Using the <b>basic</b> keyword will set the following characters as breaking:<br/>
<indent/><b>' '</b> U+0020 (space - default)<br/>
<indent/><b>-</b> U+202d (hyphen-minus)<br/>
<indent/><b>–</b> U+2013 (en dash)<br/>
<indent/><b>-</b> U+2014 (em dash)<br/></description>
      <notice>Since ponscripter-20091015, scripts start out with only the space character defined for linebreaking, so please use this command if you want other break characters. <b>pbreakstr basic</b>will restore the default break characters from earlier ponscripter versions. (by Mion)</notice>
      <example type="P">
        <comment>Sets space, comma and hyphen as break characters.</comment>
        <code>pbreakstr ^ ,-^</code>
      </example>
      <related cmd="tildetag" />
    </command>

    <command name="localestring" type="FE" category="ponscr">
      <scr ver="20091013">P</scr>
      <simple-desc>localize a right-click menu message string</simple-desc>
      <format>
        <format-string desc="localestring (locale-item-id) (item-string)">localestring {message_reset_confirm|message_end_confirm|message_yes|message_no|message_empty|message_space} STR</format-string>
        <arg type="ENUM">Locale string identifier</arg>
        <arg type="STR">Locale string</arg>
      </format>
      <format>
        <format-string desc="localestring (locale-list-id) (list-of-strings)">localestring {days|months|am_pm|digits} STR,...</format-string>
        <arg type="ENUM">Locale string list identifier</arg>
        <arg type="STR">Locale string list item(s)</arg>
      </format>
      <format>
        <format-string desc="localestring (locale-save-item-id) (save-item-string)">localestring {message_save_label|message_save_exist|message_save_confirm|message_load_confirm} STR</format-string>
        <arg type="ENUM">Save/load related locale string identifier</arg>
        <arg type="STR">Save/load related locale string</arg>
      </format>
      <description>Changes a string or set of strings related to the default right-click menu.<br/>
There are three separate types of localestring commands: standard dialog items, localization lists, and processed dialog items.<br/>
<br/>
<b>1) Standard dialog items</b> - localestrings meant to be displayed exactly as provided, except for parsing any <b>~</b> formatting tags.<br/>
<indent/><b>message_reset_confirm</b> (default: <b>"Return to Title Menu?"</b>)<br/>
<indent/><indent/>- confirmation message after requesting a game reset<br/>
<indent/><b>message_end_confirm</b> (default: <b>"Quit?"</b>)<br/>
<indent/><indent/>- confirmation message after requesting to exit the game<br/>
<indent/><b>message_yes</b> (default: <b>"Yes"</b>)<br/>
<indent/><indent/>- affirmative response to confirmation message<br/>
<indent/><b>message_no</b> (default: <b>"No"</b>)<br/>
<indent/><indent/>- negative response to confirmation message<br/>
<indent/><b>message_space</b> (default: <b>" "</b>)<br/>
<indent/><indent/>- used for displaying spaces in processed items<br/>
<indent/><b>message_empty</b> (default: <b>"-"</b>)<br/>
<indent/><indent/>- used for filling in unused slots in the Save/Load menu<br/>
<br/>
<b>2) Localization lists</b> - sequences of localestrings related to date, time, and numbers, that are used when filling in processed dialog items. Items of a sequence are <b>not</b> required to be the same length.<br/>
<indent/><b>days</b> (default: <b>"Sun","Mon","Tue","Wed","Thu","Fri","Sat"</b>)<br/>
<indent/><indent/>- days of the week, starting with Sunday; must be exactly 7 comma-separated strings<br/>
<indent/><b>months</b> (default: <b>"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"</b>)<br/>
<indent/><indent/>- months of the calendar year, starting with January; must be exactly 12 comma-separated strings<br/>
<indent/><b>am_pm</b> (default: <b>"AM","PM"</b>)<br/>
<indent/><indent/>- distinguish between before-noon and after-noon times in 12-hour time systems; must be exactly 2 comma-separated strings<br/>
<indent/><b>digits</b> (default: <b>"0","1","2","3","4","5","6","7","8","9"</b>)<br/>
<indent/><indent/>- decimal digits starting with 0; must be exactly 10 comma-separated strings<br/>
<br/>
<b>3) Processed dialog items</b> - localestrings parsed for special character sequences related to saved games and the Save/Load menu save slots.<br/>
<indent/><b>message_save_label</b> (default: <b>"%s%n"</b>)<br/>
<indent/><indent/>- used to display the label and number of a slot in the Save/Load menu<br/>
<indent/><b>message_save_exist</b> (default: <b>"%b %d%i %-H:%i%M"</b>)<br/>
<indent/><indent/>- used to display the date and time information of a saved game<br/>
<indent/><b>message_save_confirm</b> (default: <b>"Save in %s%n?"</b>)<br/>
<indent/><indent/>- confirmation message for saving the current game in a particular slot of the Save/Load menu<br/>
<indent/><b>message_load_confirm</b> (default: <b>"Load from %s%n?"</b>)<br/>
<indent/><indent/>- confirmation message for loading a game from a particular slot of the Save/Load menu<br/>
<br/>
<b>Processed dialog character sequences</b><br/>
The syntax of character sequences parsed within save/load related items comes largely from the UNIX <b>date</b> format syntax.<br/>
<indent/><b>%%</b> - a literal '%'<br/>
<indent/><b>%s</b> - Save/Load menu savefile slot heading (set via <b>savename</b>)<br/>
<indent/><b>%n</b> - Savefile number<br/>
<indent/><b>%a</b> - day of the week, retrieved from <b>days</b> localization list<br/>
<indent/><b>%b</b> - month of the year, retrieved from <b>months</b> localization list<br/>
<indent/><b>%d</b> - date of the month ('01'-'31')<br/>
<indent/><b>%H</b> - hour, 24-hour system ('00'-'23')<br/>
<indent/><b>%I</b> - hour, 12-hour system ('01'-'12')<br/>
<indent/><b>%M</b> - minute ('00'-'59')<br/>
<indent/><b>%p</b> - AM/PM time indicator, retrieved from <b>am_pm</b> localization list<br/>
<indent/><b>%S</b> - second ('00'-'59')<br/>
<indent/><b>%Y</b> - year (full)<br/>
<indent/><b>%y</b> - year (last 2 digits)<br/>
<br/>
The following optional flags may follow the <b>%</b> in the previous code sequences:<br/>
<indent/><b>-</b> (hyphen) - do not pad<br/>
<indent/><b>_</b> (underscore) - pad with spaces<br/>
<indent/><b>0</b> (zero) - pad with zeroes<br/>
After the flag, if any, may come a decimal number specifying field width, and then an optional <b>O</b> to indicate that the locale's digits should be used. For example, <b>"%_4OH:%M"</b> will display the hour with field width 4, padded with spaces, and using locale digits: <b>"   8:45"</b>.<br/>
<br/>
There are also two sequences used specifically within <b>message_save_exist</b> for formatting Save/Load menu slots:<br/>
<indent/><b>%i</b> - Indent point<br/>
<indent/><b>%t</b> - Tab area<br/>
<br/>
An indent point is a location within the slot text where all non-empty slots <b>must</b> line up with each other. For example, with the slot text <b>"%H:%i%M"</b>, the colons in the 'hour:minute' time will line up across the entire list of slots.<br/>
<br/>
In order to make the indent points line up, whitespace is added to the beginning of the string (or just after the last indent point in the string). If one of those points shouldn't have whitespace, the whitespace tab area can be specified with <b>%t</b>. For example, in the text <b>"%H:%i%M %t(%a)%i"</b> ('hour:minute (weekday)'), setting the tab just before the '(weekday)' prevents whitespace after the colon in the ':minute' part.<br/>
<br/>
Try the following examples of localestring settings.</description>
      <example type="P">
        <comment>Use French abbreviated months and days of the week.</comment>
        <code>localestring months "janv.","févr.","mars","avr.","mai","juin","juill.","août","sept.","oct.","nov.","déc."
localestring days "Dim","Lun","Mar","Mer","Jeu","Ven","Sam"</code>
      </example>
      <example type="P">
        <comment>Use fullwidth Japanese digits and space.</comment>
        <code>localestring digits "０","１","２","３","４","５","６","７","８","９"
localestring message_space "　"
</code>
      </example>
      <example type="P">
        <comment>Use Russian confirmation messages and responses.</comment>
        <code>localestring message_save_confirm "Сохранить %s%n?"
localestring message_load_confirm "Загрузить %s%n?"
localestring message_reset_confirm "Выйти в главное меню?"
localestring message_yes "Да"
localestring message_no "Нет"</code>
      </example>
      <example type="P">
        <comment>Display savefile slot with the default format.</comment>
        <code>localestring message_save_exist "%b %d%i %_H:%i%M"
;e.g. "Feb 06  0:45"</code>
      </example>
      <example type="P">
        <comment>Other savefile slot formats.</comment>
        <code>localestring message_save_exist "%Y/%m/%d  %H:%M"
;e.g. "2008/02/06  00:45"
localestring message_save_exist "%m/%d/%Y %i%I:%M %i%p"
;e.g. "02/06/2008   12:45  AM"
localestring message_save_exist "%a, %b %d, %I:%M %p"
;e.g. "Wed, Feb 6, 12:45 AM"</code>
      </example>
      <related cmd="savename" />
    </command>

    <command name="h_mapfont" type="FE" category="ponscr">
      <scr ver="20061124">P</scr>
      <simple-desc>map a font file to a ponscripter font slot</simple-desc>
      <format>
        <format-string desc="h_mapfont (slot-num),(font-file)[, (metrics-file)]">h_mapfont NUM,STR[,STR]</format-string>
        <arg type="NUM">Font slot (0-7)</arg>
        <arg type="STR">Font filename</arg>
        <arg type="STR">Font metrics file (Type 1 fonts only)</arg>
      </format>
      <description>Maps a font file to the given font slot. Equivalent to the command <b>pmapfont</b>.</description>
      <example type="P">
        <comment>Maps font slot 0 to "myprettyfont.ttf".</comment>
        <code>h_mapfont 0,"myprettyfont.ttf"</code>
      </example>
      <related cmd="pmapfont" />
    </command>

    <command name="h_rendering" type="FE" category="ponscr">
      <scr ver="20061124">P</scr>
      <simple-desc>configure ponscripter text rendering</simple-desc>
      <format>
        <format-string desc="h_rendering (hinting), (positioning)[, (rendermode)]">h_rendering {none|full|light},{integer|float}[,{light|normal}]</format-string>
        <arg type="ENUM">Hinting (either none, full, or light)</arg>
        <arg type="ENUM">Positioning (either integer or float)</arg>
        <arg type="ENUM">Optional Freetype rendering mode (light or normal)</arg>
      </format>
      <description>Configures the Freetype text rendering mode. Equivalent to the command <b>prendering</b>.</description>
      <related cmd="prendering" />
    </command>

    <command name="h_fontstyle" type="FE" category="ponscr">
      <scr>P</scr>
      <simple-desc>set the default font style</simple-desc>
      <format>
        <format-string desc="h_fontstyle (font-style)">h_fontstyle STR</format-string>
        <arg type="STR">font style tag</arg>
      </format>
      <description>Sets the default text styling. Equivalent to the command <b>pfontstyle</b>.</description>
      <example type="P">
        <comment>Displays text in italic display font (slot 5).</comment>
        <code>h_fontstyle ^si^
^Here is a page of italic text.\
^And it's still italic!\
h_fontstyle ^d^ ;back to regular style</code>
      </example>
      <related cmd="pfontstyle" />
    </command>

    <command name="h_ligate" type="FE" category="ponscr">
      <scr>P</scr>
      <simple-desc>add or remove a ligature or shortcut sequence</simple-desc>
      <format>
        <format-string desc="h_ligate (input),(unicode)">h_ligate STR,NUM|STR</format-string>
        <arg type="STR">Shortcut matching text</arg>
        <arg type="NUM">Unicode codepoint for shortcut result (if numeric)</arg>
        <arg type="STR">(Unicode) char for shortcut result (if string)</arg>
      </format>
      <format>
        <format-string desc="h_ligate (input),remove">h_ligate STR,remove</format-string>
        <arg type="STR">Shortcut matching text</arg>
        <arg type="ENUM">Keyword to remove the defined matching shortcut</arg>
      </format>
      <format>
        <format-string desc="h_ligate (preset)">h_ligate {none|default|basic|punctuation|f_ligatures|specials|all}</format-string>
        <arg type="ENUM">Keyword for a preset shortcut set</arg>
      </format>
      <description>Adds or removes shortcut sequences. Equivalent to the command <b>pligate</b>.</description>
      <related cmd="pligate" />
    </command>

    <command name="h_indentstr" type="FE" category="ponscr">
      <scr>P</scr>
      <simple-desc>specify characters that cause indents</simple-desc>
      <format>
        <format-string desc="h_indentstr (indent-chars)">h_indentstr STR</format-string>
        <arg type="STR">Indent characters</arg>
      </format>
      <format>
        <format-string desc="h_indentstr basic">h_indentstr basic</format-string>
        <arg type="ENUM">Keyword for the standard indenting characters</arg>
      </format>
      <description>Specifies characters that will set an indent. Equivalent to the <b>pindentstr</b> command.</description>
      <example type="P">
        <comment>Sets quote marks (undirected and left) as indenting characters.</comment>
        <code>h_indentstr ^"'‘“^</code>
      </example>
      <related cmd="pindentstr" />
    </command>

    <command name="h_breakstr" type="FE" category="ponscr">
      <scr>P</scr>
      <simple-desc>specify characters that allow linebreaks</simple-desc>
      <format>
        <format-string desc="h_breakstr (break-chars)">h_breakstr STR</format-string>
        <arg type="STR">Break characters</arg>
      </format>
      <format>
        <format-string desc="pbreakstr basic">h_breakstr basic</format-string>
        <arg type="ENUM">Keyword for the standard linebreaking characters</arg>
      </format>
      <description>Specifies characters that allow linebreaks. Equivalent to the <b>pbreakstr</b> command.</description>
      <example type="P">
        <comment>Sets space, comma and hyphen as break characters.</comment>
        <code>h_breakstr ^ ,-^</code>
      </example>
      <related cmd="pbreakstr" />
    </command>

  </functions>
</api>

