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 revisionPrevious revision
Next revision
Previous revision
xmlscripting-en [2023/02/23 17:04] – [Commands] rjversluisxmlscripting-en [2024/02/15 10:43] (current) – [Commands] rjversluis
Line 8: Line 8:
       * [[:xmlscripting:xmldb-en|General]] | [[:userpages:micha68:virtualfbscript-en|Virtual Sensors]] | [[:userpages:micha68:extkeyboardscript-en|External keyboard]]  | [[:userpages:micha68:ampelscript-de|Traffic light (DE)]] | [[:userpages:nice2have:shuntingexample-de|Shunting (DE)]]       * [[:xmlscripting:xmldb-en|General]] | [[:userpages:micha68:virtualfbscript-en|Virtual Sensors]] | [[:userpages:micha68:extkeyboardscript-en|External keyboard]]  | [[:userpages:micha68:ampelscript-de|Traffic light (DE)]] | [[:userpages:nice2have:shuntingexample-de|Shunting (DE)]]
  
- \\ + 
-^  NOT FOR NOVICE USERS !!!  ^ +| [[:supportkey-en|{{:icons:key.png}}]] //XMLScript can only be used if a valid __**[[:supportkey-en|Support Key]]**__ is provided.// | 
- \\+
 {{:xmlscripting.png}}\\ {{:xmlscripting.png}}\\
- \\+ NOT FOR NOVICE USERS !!!  ^ 
 =====Warning===== =====Warning=====
   - Do not replace standard Rocrail functions with XMLScript.   - Do not replace standard Rocrail functions with XMLScript.
Line 323: Line 323:
  \\  \\
 ====break==== ====break====
-Ends a foreach loop with or without condition. The cmt="reason" can be used for tracing.\\+Ends a foreach and while loop with or without condition. The cmt="reason" can be used for tracing.\\
 This statement has no effect if its not within a foreach loop.\\ This statement has no effect if its not within a foreach loop.\\
 <code xml> <code xml>
Line 525: Line 525:
 ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^ ^ Object Name ^ Object type ^ Commands ^States ^ Remark ^ Example ^
 | 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. | | 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, 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" |+| 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.| %%<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 534: Line 534:
 | Sensor | fb | All, on, off, flip | | | Sensor | fb | All, on, off, flip | |
 | Route | st | go, lock, free, classset, classadd, classdel | open, closed | The lock and free command needs the extra attribute **locid**="myLoco" | %%<st id="x" state="closed"/>%% | | Route | st | go, lock, free, classset, classadd, classdel | open, closed | The lock and free command needs the extra attribute **locid**="myLoco" | %%<st id="x" state="closed"/>%% |
-| Text | tx | showon, showoff | | Update event by format attribute. \\ The optional **bkid** and **lcid** may be used in the command also. | %%<tx id="tx1" format="the loco id is %lcid%"/>%% | +| Text | tx | showon, showoff, blink, on, off, click | | Update event by format attribute. \\ The optional **bkid** and **lcid** may be used in the command also. | %%<tx id="tx1" format="the loco id is %lcid%"/>%% \\ <text id="xyz" cmd="blink" blink="true"/> 
-| Variable | vr | random, start, stop \\ start, length (for substring) | | Set by attribute: %%value="0" text="zero"%% \\ To make it temporary set %%generated="true"%%| %%<vr id="var1" text="Rocrail"/>%% \\ %%<vr id="var2" text="@var1-XML-Scripting." tokeniser="-"/>%% \\ %%<vr id="var2" text="@var1" start="1" length="3"/>%% |+| Variable | vr | random, start, stop \\ start, length (for substring) | | Set by attribute: %%value="0" text="zero"%% \\ To make it temporary set %%generated="true"%% \\ **Update:** with 2.1.3268+ this is the default value \\ To make it static set %%generated="false"%%| %%<vr id="var1" text="Rocrail"/>%% \\ %%<vr id="var2" text="@var1-XML-Scripting." tokeniser="-"/>%% \\ %%<vr id="var2" text="@var1" start="1" length="3"/>%% |
 | Action control | actionctrl |  | | The id in the actionctrl is a reference to an existing action. Condition child nodes may be added. | | Action control | actionctrl |  | | The id in the actionctrl is a reference to an existing action. Condition child nodes may be added. |
 | Operator | operator | emptycar, loadcar, addcar, leavecar | | In the carids attribute a list of cars must be specified. | | Operator | operator | emptycar, loadcar, addcar, leavecar | | In the carids attribute a list of cars must be specified. |
 | System | sys | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sys | | | System | sys | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sys | |
 | Automat | auto | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#auto | | | Automat | auto | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#auto | |
-| Car | car | empty, loaded, maintenance, assignwaybill, resetwaybill, loco & function | empty, loaded, maintenance, cartype, location | %%<car id="test" cmd="assignwaybill" waybill="testbill"/>%% |+| Car | car | empty, loaded, maintenance, assignwaybill, resetwaybill, loco & function | empty, loaded, maintenance, cartype, location | %%<car id="test" cmd="assignwaybill" waybill="testbill"/>%% |
 | Staging block | sb | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sb | | | Staging block | sb | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#sb | |
 | Fiddle Yard | seltab | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#seltab | | | Fiddle Yard | seltab | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#seltab | |
 | Location | location | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#location | | | %%<location id="Blaak" cmd="info" svalue="tx1"/>%% | | Location | location | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#location | | | %%<location id="Blaak" cmd="info" svalue="tx1"/>%% |
-| Clock | clock | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#clock | |   // Set clock on System time: // \\  %%<clock divider="1" hour="%syshour%" minute="%sysmin%"/>%%  |+| Clock | clock | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#clock | | //Set clock on System time:// \\  %%<clock divider="1" hour="%syshour%" minute="%sysmin%"/>%%  |
 | Turntable | tt | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#tt | | | Turntable | tt | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#tt | |
 | External | ext | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#ext | | | External | ext | All https://rocrail.net/software/rocrail-snapshot/rocrail/wrapper-en.html#ext | |
-| Weather | weather | setweather, weathertheme | | +| Weather | weather | setweather, weathertheme, go, stop | | 
-| 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"/>%% |+| 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 | | The modify is not supported, use change instead. | %%<model cmd="change">%% \\ %%<tx id="x" backred="255" backgreen="0" backblue="0"/>%% \\ %%</model>%% |  
 +| MVTrack | mv | reset, sets1, sets2, setdistance, setdistanceR | | | <mv cmd="sets2" s2="fb4712"/> |
  
 ====Attribute values==== ====Attribute values====
Line 612: Line 614:
  
 =====Variables defined as "Generated"===== =====Variables defined as "Generated"=====
-As long as a variable does not need to store any values from runtime to runtime of Rocrail those variables can be defined as "generated": \\+In order to store a variable from runtime to runtime in Rocrail, these variables must be defined as "generated" "false": \\
 ====Example==== ====Example====
 <code xml> <code xml>
 <xmlscript> <xmlscript>
-  <vr id="vr_MSN3_lastUsedLocomotive" value="0" text="br89"/> +  <vr id="vr_MSN3_lastUsedLocomotive" value="0" text="br89" generated="false"/> 
-  <vr id="vr_MSN3_tmp" value="0" text="" generated="true"/>+  <vr id="vr_MSN3_tmp" value="0" text=""/>
 </xmlscript> </xmlscript>
 </code> </code>
xmlscripting-en.1677168264.txt.gz · Last modified: 2023/02/23 17:04 by rjversluis