User Tools

Site Tools


xmlscripting-en

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xmlscripting-en [2021/03/19 09:51]
rjversluis
xmlscripting-en [2021/07/24 23:31] (current)
smitt48 [Commands]
Line 20: 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 25: 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 252: 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 487: 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 492: 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 507: 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 513: 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"/>​%% ​\\ F1-F4 group="​1"​ \\ F5-F8 group="​2"​ \\ ... \\ F25-F28 group="​7"​ | |
 | Switch | sw | All | | | Switch | sw | All | |
 | Signal | sg | All | | | Signal | sg | All | |
Line 538: 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.1616143882.txt.gz · Last modified: 2021/03/19 09:51 by rjversluis