[Solved] Question syntax XML-script concerning loc class

Moderators: dadolphs, Moderators

[Solved] Question syntax XML-script concerning loc class

Postby agre30 » 15.09.2017, 16:23

I'm look for the right syntax for:
If the class of the loc in block Hlx-01Up = Gdn then...

I tried this:
<if class="lc bkid Hlx-01Up=Gdn">
<then>

but the outcome is always true.
I searched the wiki and some examples but cannot find the right syntax

thanks in advance,

Albert.
Last edited by agre30 on 17.09.2017, 08:35, edited 1 time in total.
Albert,
Märklin 3-rail
Lubuntu 16.04 (server and client) / TamsMC - Booster B-2 / HSI88 / S88N
Stoom / steam / dampf / diesel / E-loc
agre30
 

Re: Question about syntax XML-script concerning loc class

Postby cds » 15.09.2017, 16:51

Hello Albert!

Try this:
Code: Select all
<if class="bk4711 = AB">
Beste Grüße/Kind regards
Claus

M* H0 M
HW: TAMS MC, B-2 & B-4, WD-34, VIESSMANN 5211(1), LITTFINSKY & TAMS S88-3
Decoder: Mä & TAMS (MM2)
SW: Win7 64, RR 64, andRoc
cds
 

Re: Question about syntax XML-script concerning loc class

Postby agre30 » 15.09.2017, 18:15

Hi Claus,
Thanks.
I created this code:
Code: Select all
  <if class="bk Hlx-01Up = Gdn">
    <then>


but the outcome is always false no mather which loco is in the block. I'm sure the class of the loco is Gdn.
I attached the xml-script.

Just found out why it doesn't work. Your script tests the class of the block under permissions, not the class of the loco in the block.

Albert.
You do not have the required permissions to view the files attached to this post.
Albert,
Märklin 3-rail
Lubuntu 16.04 (server and client) / TamsMC - Booster B-2 / HSI88 / S88N
Stoom / steam / dampf / diesel / E-loc
agre30
 

Re: Question about syntax XML-script concerning loc class

Postby agre30 » 17.09.2017, 08:12

I solved the problem myself with another approach.

The action is triggered when the block Hlx01-Up is occupied. So I first tried this:
Code: Select all
  <if class="lc %lcid% = Gdn">
    <then>


But that doesn't work when the name of the loc has blanks in it like: Arriva Spurt
And that's written in the wiki: Here :oops:
So I filled the ShortID of the loc with the loc adress, while there is no variable that contains the loc adress like %lcadress% (would be usefull)
And I came up with this solution:

Code: Select all
  <if class="lc %lcshortid% = Gdn">
    <then>


And that works.

Albert.
Albert,
Märklin 3-rail
Lubuntu 16.04 (server and client) / TamsMC - Booster B-2 / HSI88 / S88N
Stoom / steam / dampf / diesel / E-loc
agre30
 


Return to Basic topics