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/08/26 08:56] rjversluisxmlscripting-en [2024/02/15 10:43] (current) – [Commands] rjversluis
Line 9: Line 9:
  
  
-| [[:donate-en|{{:icons:key.png}}]] //XMLScript can only be used if a valid __**[[:donate-en|Support Key]]**__ is provided.// |+| [[: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 533: 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"%% \\ **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"/>%% | | 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. |
Line 546: Line 547:
 | 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>%% |  | 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.1693032994.txt.gz · Last modified: 2023/08/26 08:56 by rjversluis