User Tools

Site Tools


xmlscripting-en

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
xmlscripting-en [2020/10/03 15:02] – [Condition format] borisxmlscripting-en [2021/07/24 22:24] – [Commands] boris
Line 8: Line 8:
       * [[:xmlscripting:xmldb-en|General]] | [[:micha68:virtualfbscript-en|Virtual Sensors]] | [[:micha68:extkeyboardscript-en|External keyboard]]  | [[:micha68:ampelscript-de|Traffic light (DE)]] | [[:users:nice2have:shuntingexample-de|Shunting (DE)]]       * [[:xmlscripting:xmldb-en|General]] | [[:micha68:virtualfbscript-en|Virtual Sensors]] | [[:micha68:extkeyboardscript-en|External keyboard]]  | [[:micha68:ampelscript-de|Traffic light (DE)]] | [[:users:nice2have:shuntingexample-de|Shunting (DE)]]
  
 + \\
 +^  NOT FOR NOVICE USERS !!!  ^
  \\  \\
 {{:xmlscripting.png}}\\ {{:xmlscripting.png}}\\
Line 18: Line 20:
   - If uncertain: Do not use XMLScript, or ask for help in the __**[[https://forum.rocrail.net/viewforum.php?f=112|Forum]]**__.   - If uncertain: Do not use XMLScript, or ask for help in the __**[[https://forum.rocrail.net/viewforum.php?f=112|Forum]]**__.
   - Do not use the same variables in multiple XMLScripts, which will be set to new values, to avoid unexpected results including Server crashes.   - Do not use the same variables in multiple XMLScripts, which will be set to new values, to avoid unexpected results including Server crashes.
 +
 +
 __**[[start#rocrail_-_disclaimer|D I S C L A I M E R]]**__\\ __**[[start#rocrail_-_disclaimer|D I S C L A I M E R]]**__\\
  
Line 23: Line 27:
  \\  \\
 =====Introduction===== =====Introduction=====
 +:!: Check basic Rocrail functionality before inventing the wheel again with XMLScript.\\
 +
 XMLScript can be used in combination with __**[[:actions-en#types_commands_parameters|run ext. program]]**__ action.\\ XMLScript can be used in combination with __**[[:actions-en#types_commands_parameters|run ext. program]]**__ action.\\
 Its primary goal is to simplify and to reduce the number of actions and conditions.\\ Its primary goal is to simplify and to reduce the number of actions and conditions.\\
Line 250: Line 256:
 </code> </code>
  
 +// Multiple case values are deprecated, and are strongly discourage to use.//\\
 A case may have multiple integer values in the following format:\\ A case may have multiple integer values in the following format:\\
 <code xml> <code xml>
Line 446: Line 453:
 | ! | not equal number | | ! | not equal number |
 | # | equal text | | # | equal text |
-| ~ | contains text (@var_1 ~ @var_2 is true, when text of var_1 contains complete text of var_2) | 
 | - | not equal text | | - | not equal text |
 | > | greater than number | | > | greater than number |
 | < | smaller than number | | < | smaller than number |
 +| ~ | contains text (@var_1 ~ @var_2 is true, when text of var_1 contains complete text of var_2) - since version 2.1.1010|
  
 ====alltrue==== ====alltrue====
Line 485: Line 492:
 | Sensor | fb | true, false, on, off | true = on, false = off | | Sensor | fb | true, false, on, off | true = on, false = off |
 | Output | co | on, off, active | | | Output | co | on, off, active | |
 +| Location | location | free | The 'free' state will check if the loco is allowed and if a location block is free. |
 | Block | bk | free, occupied, closed, open, reserved | | | Block | bk | free, occupied, closed, open, reserved | |
 | Turntable | tt | free, occupied, closed, open, reserved, #, pending | The # represents the current bridge position. \\ If state pending is true the bridge is moving. | | Turntable | tt | free, occupied, closed, open, reserved, #, pending | The # represents the current bridge position. \\ If state pending is true the bridge is moving. |
Line 490: Line 498:
 | System | sys | go, stop | | | System | sys | go, stop | |
 | Automode | auto | on, off | | | Automode | auto | on, off | |
-| Locomotive | lc | fwd, rev, +, -, min, mid, cruise, max, block, "//blockID//", steam, diesel, electric, automobile, idle, wait, automatic, shunting, f0...f28, home, shunting | **block** is true if the loco is in a block \\ "**//blockID//**" is true if the loco is in a block with this "//blockID//" |+| Locomotive | lc | fwd, rev, +, -, min, mid, cruise, max, block, "//blockID//", steam, diesel, electric, automobile, idle, wait, automatic, shunting, f0...f28, home, shunting, train, !train | **block** is true if the loco is in a block \\ "**//blockID//**" is true if the loco is in a block with this "//blockID//" \\ **train** is true if a train is assigned to the loco \\ **!train** is true if no train is assigned to the loco|
 | Car | car | empty, loaded, maintenance, cartype, waybill, "//blockID//" | See locomotive | | Car | car | empty, loaded, maintenance, cartype, waybill, "//blockID//" | See locomotive |
 | Waybill | waybill | waiting, shipping, delivered, "//destinationID//", "//originID//" |  | | Waybill | waybill | waiting, shipping, delivered, "//destinationID//", "//originID//" |  |
Line 505: Line 513:
 =====Commands===== =====Commands=====
 Note: \\ Note: \\
-  * With "**Commands All**" all the object commands specified in the  __**[[https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__ are supported.+  * With "**Commands All**" all the object commands specified in the  __**[[https://wiki.rocrail.net/rocrail-snapshot/rocrail/wrapper-en-index.html|Rocrail plan.xml]]**__ are supported.
   * The special implemented action commands are listed separately.   * The special implemented action commands are listed separately.
  
Line 511: Line 519:
  \\  \\
 ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^ ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^
-| Loco | lc | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#lc | | The bkid attribute can be used to get a loco ID from a block. \\ Command %%"regularreset"%% is the same as %%"softreset"%% but removes the assigned schedule too. | +| Loco | lc | All https://wiki.rocrail.net/rocrail-snapshot/rocrail/wrapper-en.html#lc | | The bkid attribute can be used to get a loco ID from a block. \\ Command %%"regularreset"%% is the same as %%"softreset"%% but removes the assigned schedule too. | 
-| Function | fn | All and fndesc, fncmd | | The fnchanged or the fndesc, function description, attribute  signals which function has been changed: f0...f28 (true/false). \\ The fncmd can be used for on/off/flip. | %%<fn id="loco1" fndesc="Horn" fncmd="flip"/>%% |+| Function | fn | All and fndesc, fncmd, group 1..7 | | The fnchanged or the fndesc, function description, attribute  signals which function has been changed: f0...f28 (true/false). \\ The fncmd can be used for on/off/flip. \\ Group is required with Loconet| %%<fn id="loco1" fndesc="Horn" fncmd="flip" group="2"/>%% |
 | Switch | sw | All | | | Switch | sw | All | |
 | Signal | sg | All | | | Signal | sg | All | |
Line 536: Line 544:
 | Weather | weather | setweather, weathertheme | | | Weather | weather | setweather, weathertheme | |
 | Light | light | flip, enable, disable | Enable a light from LightControl. | | Light | light | flip, enable, disable | Enable a light from LightControl. |
 +| LightControl | lightctrl | go, stop | Enable / disable LightControl. | %%<lightctrl cmd="go"/>%% \\ %%<lightctrl cmd="stop"/>%% |
 | Model | model | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#model | With modify the sub nodes will be replaced with the new ones. Als sub nodes will be deleted if no new ones are available. -> Use change instead. | %%<model cmd="change">%% \\ %%<tx id="x" backred="255" backgreen="0" backblue="0"/>%% \\ %%</model>%% |  | Model | model | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#model | With modify the sub nodes will be replaced with the new ones. Als sub nodes will be deleted if no new ones are available. -> Use change instead. | %%<model cmd="change">%% \\ %%<tx id="x" backred="255" backgreen="0" backblue="0"/>%% \\ %%</model>%% | 
  
xmlscripting-en.txt · Last modified: 2024/02/15 10:43 by rjversluis