Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    16
    1
    252

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    4.6k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.3k

[Vorlage] Blockly - Beliebiges Zeichen im Text tauschen

Scheduled Pinned Locked Moved Blockly
blocklytemplate
70 Posts 13 Posters 15.7k Views 22 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dslraserD dslraser

    @padrino
    probiere mal bitte bei Dir. Ich habe was getauscht, so geht es bei mir auch

    <xml xmlns="https://developers.google.com/blockly/xml">
     <variables>
       <variable id="0aB0N-YiCJhh/N;jnuzG">neuerText</variable>
       <variable id="UU7uV-BrPR`oZ7}SlnaF">MeinText</variable>
       <variable id="i@/uXUvk|?_E05h[9^`8">Stelle</variable>
       <variable id="hUL|?bA1I{i4@V3nwNHT">Treffer</variable>
       <variable type="interval" id="Intervall">Intervall</variable>
     </variables>
     <block type="variables_set" id="A}IB(5!H]c);o:_[8}{D" x="-355" y="-709">
       <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
       <value name="VALUE">
         <block type="text" id="W=vI:4}6b=eBQfwA/@_z">
           <field name="TEXT"></field>
         </block>
       </value>
       <next>
         <block type="variables_set" id="MbkDBQQbA9yFBy?SrK?2">
           <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
           <value name="VALUE">
             <block type="text" id="CGj/cx]L]d=#ly74!m/+">
               <field name="TEXT">Badezimmer Fenster rechts geöffnet, Gästezimmer Fenster links geöffnet, Küche Fenster rechts geöffnet, Schlafzimmer Fenster links geöffnet, Wohnzimmer Fenster rechts geöffnet, Keller Heizung Fenster gekippt, Keller Sauna Fenster links gekippt, Keller Werkstatt Fenster gekippt, Badezimmer Fenster links geschlossen, Gästezimmer Fenster rechts geschlossen, Keller Sauna Fenster rechts geschlossen, Keller Vorrat Fenster geschlossen, Keller W-Baum Fenster geschlossen, Keller Wohnzimmer Fenster links geschlossen, Keller Wohnzimmer Fenster mitte geschlossen, Keller Wohnzimmer Fenster rechts geschlossen, Küche Fenster links geschlossen, Küche Fenster mitte geschlossen, Schlafzimmer Fenster rechts geschlossen, Wohnzimmer Fenster links geschlossen</field>
             </block>
           </value>
           <next>
             <block type="variables_set" id="|^%lFij%g-HsiWYoi,38">
               <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
               <value name="VALUE">
                 <block type="math_number" id="8Q(k}l{R[81cy/xUw}Y#">
                   <field name="NUM">0</field>
                 </block>
               </value>
               <next>
                 <block type="variables_set" id="mSx.J=PUI:;n}gW,zfKU">
                   <field name="VAR" id="hUL|?bA1I{i4@V3nwNHT">Treffer</field>
                   <value name="VALUE">
                     <block type="math_number" id="je$mCO9cc]!y8Ej*AdV*">
                       <field name="NUM">0</field>
                     </block>
                   </value>
                   <next>
                     <block type="debug" id="-pdULl)vQKNG+kuM)DQ[">
                       <field name="Severity">log</field>
                       <value name="TEXT">
                         <shadow type="text" id="5F`#PSN7z+,__lWvA/|K">
                           <field name="TEXT">test</field>
                         </shadow>
                         <block type="text_length" id="_lQ,XT[#QL4Jv+F|=En2">
                           <value name="VALUE">
                             <shadow type="text" id="7_;tZkLSh9rEo$lj2Z3A">
                               <field name="TEXT">abc</field>
                             </shadow>
                             <block type="text" id="vW)8/qt7dy)~G4PC:!Nc">
                               <field name="TEXT">Badezimmer Fenster rechts geöffnet, Gästezimmer Fenster links geöffnet, Küche Fenster rechts geöffnet, Schlafzimmer Fenster links geöffnet, Wohnzimmer Fenster rechts geöffnet, Keller Heizung Fenster gekippt, Keller Sauna Fenster links gekippt, Keller Werkstatt Fenster gekippt, Badezimmer Fenster links geschlossen, Gästezimmer Fenster rechts geschlossen, Keller Sauna Fenster rechts geschlossen, Keller Vorrat Fenster geschlossen, Keller W-Baum Fenster geschlossen, Keller Wohnzimmer Fenster links geschlossen, Keller Wohnzimmer Fenster mitte geschlossen, Keller Wohnzimmer Fenster rechts geschlossen, Küche Fenster links geschlossen, Küche Fenster mitte geschlossen, Schlafzimmer Fenster rechts geschlossen, Wohnzimmer Fenster links geschlossen</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <next>
                         <block type="timeouts_setinterval" id="p|:UwLu0aN3,Vq+v/r0w">
                           <field name="NAME">Intervall</field>
                           <field name="INTERVAL">10</field>
                           <field name="UNIT">ms</field>
                           <statement name="STATEMENT">
                             <block type="variables_set" id="M_nRuQ#s_dE4X+{v|`Ar">
                               <field name="VAR" id="hUL|?bA1I{i4@V3nwNHT">Treffer</field>
                               <value name="VALUE">
                                 <block type="text_indexOf" id="}+VbP)$cJ:3HoM7,z$Zf">
                                   <field name="END">LAST</field>
                                   <value name="VALUE">
                                     <block type="text_getSubstring" id="!]cu%34qzw*BS?~Qq,N-">
                                       <mutation at1="true" at2="true"></mutation>
                                       <field name="WHERE1">FROM_START</field>
                                       <field name="WHERE2">FROM_START</field>
                                       <value name="STRING">
                                         <block type="variables_get" id="BUXJnl*~RNxhU*dS?9*M">
                                           <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                         </block>
                                       </value>
                                       <value name="AT1">
                                         <block type="math_arithmetic" id="J*Ob#$Ltx=:!Ze:(z5(X">
                                           <field name="OP">ADD</field>
                                           <value name="A">
                                             <shadow type="math_number" id="DP0(0;+YwJ0B5caR$SeM">
                                               <field name="NUM">1</field>
                                             </shadow>
                                           </value>
                                           <value name="B">
                                             <shadow type="math_number">
                                               <field name="NUM">1</field>
                                             </shadow>
                                             <block type="variables_get" id="q#maZcBr!lS}2$ujR@l,">
                                               <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <value name="AT2">
                                         <block type="math_arithmetic" id="WQ(EsIr2)CAuO#C2LiS`">
                                           <field name="OP">ADD</field>
                                           <value name="A">
                                             <shadow type="math_number" id="VF4LnQBm@aWz_^Fh$LbV">
                                               <field name="NUM">250</field>
                                             </shadow>
                                           </value>
                                           <value name="B">
                                             <shadow type="math_number">
                                               <field name="NUM">1</field>
                                             </shadow>
                                             <block type="variables_get" id="Gjrn-B(j#?9S~Rr-WJ)/">
                                               <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <value name="FIND">
                                     <shadow type="text" id="#zE%xxMg5Dg%,,?:$8;3">
                                       <field name="TEXT">,</field>
                                     </shadow>
                                   </value>
                                 </block>
                               </value>
                               <next>
                                 <block type="controls_if" id="iz2cbp}3|o!SUoZ/!pjM">
                                   <mutation else="1"></mutation>
                                   <value name="IF0">
                                     <block type="logic_compare" id="6[G]z-e$zjn[B}HXUsF]">
                                       <field name="OP">GT</field>
                                       <value name="A">
                                         <block type="variables_get" id="~{{GcTOlHw#tcO)+H*jo">
                                           <field name="VAR" id="hUL|?bA1I{i4@V3nwNHT">Treffer</field>
                                         </block>
                                       </value>
                                       <value name="B">
                                         <block type="math_number" id="TK0s2kD+5S%r_b#/T..w">
                                           <field name="NUM">0</field>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <statement name="DO0">
                                     <block type="text_append" id="drt$J,iEw0K`=KM8o)pc">
                                       <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
                                       <value name="TEXT">
                                         <shadow type="text" id="m{q0{etBOSUQ3oT#}3$_">
                                           <field name="TEXT"></field>
                                         </shadow>
                                         <block type="text_join" id="NdkdLfnK,ey{oozn`Hfz">
                                           <mutation items="2"></mutation>
                                           <value name="ADD0">
                                             <block type="text_getSubstring" id="ud|.@+[qT;6)g`F~=*ac">
                                               <mutation at1="true" at2="true"></mutation>
                                               <field name="WHERE1">FROM_START</field>
                                               <field name="WHERE2">FROM_START</field>
                                               <value name="STRING">
                                                 <block type="variables_get" id="_*b!8+?NkwFw~rEeG2~j">
                                                   <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                                 </block>
                                               </value>
                                               <value name="AT1">
                                                 <block type="math_arithmetic" id="T%T,3nHOw5rX2=A9re(N">
                                                   <field name="OP">ADD</field>
                                                   <value name="A">
                                                     <shadow type="math_number" id="u?WyLxm[mCk1,1Pn+I=S">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                   </value>
                                                   <value name="B">
                                                     <shadow type="math_number">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                     <block type="variables_get" id="8#HYtKH[#ML#@+DeiX_$">
                                                       <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <value name="AT2">
                                                 <block type="math_arithmetic" id="HeyTvYlYz#Ijj)`^r~k]">
                                                   <field name="OP">MINUS</field>
                                                   <value name="A">
                                                     <shadow type="math_number" id="EPG_A_}kYR+Kaarl).[-">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                     <block type="math_arithmetic" id="#5bEumJ$aGUS`{)@Yhyw">
                                                       <field name="OP">ADD</field>
                                                       <value name="A">
                                                         <shadow type="math_number" id="QFqg*r(P1NwZ42lV_t]f">
                                                           <field name="NUM">250</field>
                                                         </shadow>
                                                         <block type="variables_get" id="!4Nxi1|oo|hCq`#nMnt`">
                                                           <field name="VAR" id="hUL|?bA1I{i4@V3nwNHT">Treffer</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="variables_get" id="4XJtbReoN1S)I4sotNi/">
                                                           <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <value name="B">
                                                     <shadow type="math_number" id="MXmb%`eG`8zmC3cxyiiO">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                   </value>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <value name="ADD1">
                                             <block type="text" id="!=W06cT5nW_z9!JBBy@M">
                                               <field name="TEXT">;weitere Fenster werden angesagt;</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="variables_set" id="IFo^LCFQK:ZCR2]K_cvY">
                                           <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                           <value name="VALUE">
                                             <block type="math_arithmetic" id=",noF8?wsT`j-95GsHuF2">
                                               <field name="OP">ADD</field>
                                               <value name="A">
                                                 <shadow type="math_number" id="#bVGhuZF*_KY):,?wu.t">
                                                   <field name="NUM">1</field>
                                                 </shadow>
                                                 <block type="variables_get" id="FQriZ20Bm8U7:L+Y8UAr">
                                                   <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <shadow type="math_number" id="maaCrMxX9|T8!BW3FD.!">
                                                   <field name="NUM">1</field>
                                                 </shadow>
                                                 <block type="variables_get" id="WIVe`%NClTJ%W[88v_{S">
                                                   <field name="VAR" id="hUL|?bA1I{i4@V3nwNHT">Treffer</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <next>
                                             <block type="debug" id="*uGryt3]`qC[Si=).T5n">
                                               <field name="Severity">log</field>
                                               <value name="TEXT">
                                                 <shadow type="text" id="Fn8+/8;Gs0z^1[z?I.[,">
                                                   <field name="TEXT">mache</field>
                                                 </shadow>
                                               </value>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </statement>
                                   <statement name="ELSE">
                                     <block type="text_append" id="~DL(Win$vh^aKZAs]x:H">
                                       <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
                                       <value name="TEXT">
                                         <shadow type="text">
                                           <field name="TEXT"></field>
                                         </shadow>
                                         <block type="text_join" id="ZC`UCpyT#-,$+=fq@_Kx">
                                           <mutation items="2"></mutation>
                                           <value name="ADD0">
                                             <block type="text_getSubstring" id="MiP9kLJmb5@5Q5U/QX%C">
                                               <mutation at1="true" at2="false"></mutation>
                                               <field name="WHERE1">FROM_START</field>
                                               <field name="WHERE2">LAST</field>
                                               <value name="STRING">
                                                 <block type="variables_get" id="BhUVeh~(VxBI5+UHIO#R">
                                                   <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                                 </block>
                                               </value>
                                               <value name="AT1">
                                                 <block type="math_arithmetic" id="L0tPp4hp3zPJB,5T,%Ry">
                                                   <field name="OP">ADD</field>
                                                   <value name="A">
                                                     <shadow type="math_number" id="5NxH;j::zbQK{,=t$O-R">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                   </value>
                                                   <value name="B">
                                                     <shadow type="math_number">
                                                       <field name="NUM">1</field>
                                                     </shadow>
                                                     <block type="variables_get" id="Bx2z]e*!4yX4vvTF3YrK">
                                                       <field name="VAR" id="i@/uXUvk|?_E05h[9^`8">Stelle</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <value name="ADD1">
                                             <block type="text" id="_0/=tMBBJ=/K`5d:!Mij">
                                               <field name="TEXT">;das wäre dann alles</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="debug" id="jtof%#Gn#d~kePlHNVeC">
                                           <field name="Severity">log</field>
                                           <value name="TEXT">
                                             <shadow type="text" id="M/uLTFqE7IF;}YLuevxq">
                                               <field name="TEXT">sonst</field>
                                             </shadow>
                                           </value>
                                           <next>
                                             <block type="debug" id="`IW[2AiW.(tCoVL+L9j}">
                                               <field name="Severity">log</field>
                                               <value name="TEXT">
                                                 <shadow type="text" id="o$uy-p{nsGmvDRC;(Irt">
                                                   <field name="TEXT">test</field>
                                                 </shadow>
                                                 <block type="variables_get" id="wkL(GgHeX!+CL*klN).x">
                                                   <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="timeouts_clearinterval" id="8P464pV8RpEe9M?jr$-3">
                                                   <field name="NAME">Intervall</field>
                                                   <next>
                                                     <block type="control" id="W+-R7Y*n89`Ku]Flwa6D">
                                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                       <field name="OID">alexa2.0.Echo-Devices.xxx.Commands.speak</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="variables_get" id="O!w!_n4?ND3v%Okm!hb,">
                                                           <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="debug" id=")G^!X7E*5g{%Bx2t[:)-">
                                                           <field name="Severity">log</field>
                                                           <value name="TEXT">
                                                             <shadow type="text">
                                                               <field name="TEXT">test</field>
                                                             </shadow>
                                                             <block type="text_length" id="(OXXB=LlbQ~SNX(h_Jk!">
                                                               <value name="VALUE">
                                                                 <shadow type="text" id="qM{P84CIa(jl|}VCH)CZ">
                                                                   <field name="TEXT">abc</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="BY1u^GYU(a%lw4zroJOe">
                                                                   <field name="VAR" id="0aB0N-YiCJhh/N;jnuzG">neuerText</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </statement>
                                 </block>
                               </next>
                             </block>
                           </statement>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </next>
             </block>
           </next>
         </block>
       </next>
     </block>
    </xml>
    

    padrinoP Offline
    padrinoP Offline
    padrino
    Most Active
    wrote on last edited by padrino
    #40

    @dslraser
    Jo, scheint noch zu tun. ;)
    Brauch es selbst ja (noch? :thinking_face:) nicht. =)

    Übrigens, Treffer am Anfang auf 0 setzen kann man sich sparen, da es ja direkt mit einem Wert beschrieben wird. :)

    1 Reply Last reply
    0
    • rantanplanR Offline
      rantanplanR Offline
      rantanplan
      wrote on last edited by rantanplan
      #41

      Hallo

      Probiert es doch mal so.
      Da ich kein ALEXA habe, kann ich nicht überprüfen welche Variante bessere Ergebnisse liefert.
      ALEXA.png

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="UU7uV-BrPR`oZ7}SlnaF">MeinText</variable>
          <variable id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</variable>
          <variable id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</variable>
          <variable id="Jj`q+?wfujVA5m,ym8fZ">Stelle</variable>
          <variable id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</variable>
          <variable id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</variable>
          <variable id="m6sx_t9-csQoDVP3jNN7">Teil_1</variable>
          <variable id="e#{w_y/*kb@=|-sF^8kS">Teil_2</variable>
        </variables>
        <block type="comment" id="n/JM2z]iZB^`!ciz.KW1" x="38" y="138">
          <field name="COMMENT">Sonderfall ALEXA</field>
          <next>
            <block type="variables_set" id="Q.ABhh@87P]0qq3k53y;">
              <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
              <value name="VALUE">
                <block type="text" id=":{y_9l{#7,#rl!5i6:|q">
                  <field name="TEXT">Als es die ersten Hügel des Kursivgebirges erklommen hatte, warf es einen letzten Blick zurück auf die Skyline seiner Heimatstadt Buchstabhausen, die Headline von Alphabetdorf und die Subline seiner eigenen Straße, der Zeilengasse. Wehmütig lief ihm eine rethorische Frage über die Wange, dann setzte es seinen Weg fort. Unterwegs traf es eine Copy. Die Copy warnte das Blindtextchen, da, wo sie herkäme wäre sie zigmal umgeschrieben worden und alles, was von ihrem Ursprung noch übrig wäre, sei das Wort „und“ und das Blindtextchen solle umkehren und wieder in sein eigenes, sicheres Land zurückkehren. Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten.</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id=".T:/-#~SQ/Kl*I=8?[(c">
                  <field name="VAR" id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</field>
                  <value name="VALUE">
                    <block type="text_length" id="J06Xu#g[}sq]93@GaB#R">
                      <value name="VALUE">
                        <shadow type="text" id="mvu6,IQ(C$51Ei(jbBDM">
                          <field name="TEXT">abc</field>
                        </shadow>
                        <block type="variables_get" id="wj]d?_Jkvs4,U-ebzs%N">
                          <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="controls_if" id="!!w|M.0*brbepyM6|WBz">
                      <value name="IF0">
                        <block type="logic_compare" id="[+|~Q$R4?80A|B1@f`MD">
                          <field name="OP">GT</field>
                          <value name="A">
                            <block type="text_length" id="WRTP,=Z94mexuepUOK/w">
                              <value name="VALUE">
                                <shadow type="text">
                                  <field name="TEXT">abc</field>
                                </shadow>
                                <block type="variables_get" id="Au+5aDg/rLd-M`CIXVD4">
                                  <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="O~ExGK.m90w2y:pR=LG4">
                              <field name="NUM">250</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="variables_set" id="ky/?p.#T/yiR6JB!H]|*">
                          <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                          <value name="VALUE">
                            <block type="math_round" id=")H2AO*YlTK^|Xhwc4i@.">
                              <field name="OP">ROUNDUP</field>
                              <value name="NUM">
                                <shadow type="math_number">
                                  <field name="NUM">3.1</field>
                                </shadow>
                                <block type="math_arithmetic" id="pX():_csupdVq!nYy6C.">
                                  <field name="OP">DIVIDE</field>
                                  <value name="A">
                                    <shadow type="math_number">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="text_length" id="lgecF7`Ry_j88^3#l.n,">
                                      <value name="VALUE">
                                        <shadow type="text">
                                          <field name="TEXT">abc</field>
                                        </shadow>
                                        <block type="variables_get" id="{QR`#Nx7ylWYqUIFpE,8">
                                          <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="wWYFy/j@xxIs/Z_t{ria">
                                      <field name="NUM">250</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="HN620Ed|Q7FV=tm]mTz]">
                              <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                              <value name="VALUE">
                                <block type="math_number" id="al7=x,IaIa?:8WY5bD=l">
                                  <field name="NUM">1</field>
                                </block>
                              </value>
                              <next>
                                <block type="controls_repeat_ext" id="X=7XyhCU$r{@Kfw/W$;%">
                                  <value name="TIMES">
                                    <shadow type="math_number" id="%I6B0iInDn7HVGbY;{,E">
                                      <field name="NUM">10</field>
                                    </shadow>
                                    <block type="variables_get" id="mZ6Kg{z72L@+Acq{q-*G">
                                      <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                                    </block>
                                  </value>
                                  <statement name="DO">
                                    <block type="procedures_callnoreturn" id="v;i,wop(~j~%zeE-9;%:">
                                      <mutation name="etwas tun"></mutation>
                                      <next>
                                        <block type="math_change" id="=+ra}WqVS22)PW]-4to7">
                                          <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                                          <value name="DELTA">
                                            <shadow type="math_number" id="eUnZO!jEgG/v9H;ZFxyq">
                                              <field name="NUM">1</field>
                                            </shadow>
                                          </value>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <next>
                        <block type="debug" id="CS0OvId}+[u0`$|l?^K=">
                          <field name="Severity">log</field>
                          <value name="TEXT">
                            <shadow type="text" id="hT]V6h@V$Vbp0)y=|[X+">
                              <field name="TEXT">test</field>
                            </shadow>
                            <block type="variables_get" id="VQvaW=TM^-~_rq,=;D0+">
                              <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                            </block>
                          </value>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defnoreturn" id="vJB4(k|`W5|mU%Gr8}GK" x="38" y="538">
          <field name="NAME">etwas tun</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="variables_set" id="T^03@FO*[if3TkA^eV80">
              <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
              <value name="VALUE">
                <block type="text_getSubstring" id="QRYT;Md=|?icSYh$CyY*">
                  <mutation at1="true" at2="true"></mutation>
                  <field name="WHERE1">FROM_START</field>
                  <field name="WHERE2">FROM_START</field>
                  <value name="STRING">
                    <block type="variables_get" id="r$U0(iA_SQ;[dJ$ghTk{">
                      <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                    </block>
                  </value>
                  <value name="AT1">
                    <block type="math_number" id="$YFF%6Y+HcbOynqZH{ZB">
                      <field name="NUM">1</field>
                    </block>
                  </value>
                  <value name="AT2">
                    <block type="math_arithmetic" id="+R*6|LFDO4u#!^v+2Q{H">
                      <field name="OP">MULTIPLY</field>
                      <value name="A">
                        <shadow type="math_number" id="!VRlkc-Q8%d!nRtn%J}.">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="variables_get" id="u-!Sf66I63t]x=z+9p+=">
                          <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id="/_X[Lr$e#gJ`FAG::jg_">
                          <field name="NUM">250</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <next>
                <block type="variables_set" id="Oa09_q#iu{rX^x~rsg`B">
                  <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                  <value name="VALUE">
                    <block type="text_indexOf" id="3+MPtMHhTAe;#NJnV-4A">
                      <field name="END">LAST</field>
                      <value name="VALUE">
                        <block type="variables_get" id="5Z/zuT8}+g()Uh*,X)@r">
                          <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                        </block>
                      </value>
                      <value name="FIND">
                        <shadow type="text" id="|;5Zlyr.902bUtFdA9p,">
                          <field name="TEXT">,</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="controls_if" id="19EmJGA`l+u{y,F+q33-">
                      <value name="IF0">
                        <block type="logic_compare" id="uT+*1w@e5OxTF$UGZ[wT">
                          <field name="OP">GT</field>
                          <value name="A">
                            <block type="variables_get" id="Pelhp;C]yYmEGftw{XC.">
                              <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="J_d~,9#l:|F!pB%XGyt|">
                              <field name="NUM">0</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="variables_set" id="z0hH8zn%SX|PtC^A`dBy">
                          <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                          <value name="VALUE">
                            <block type="text_getSubstring" id="(1K~4B/;hRq4LcEEjx:A">
                              <mutation at1="false" at2="true"></mutation>
                              <field name="WHERE1">FIRST</field>
                              <field name="WHERE2">FROM_START</field>
                              <value name="STRING">
                                <block type="variables_get" id="eon-{j~:rQ~a]n=WVtO%">
                                  <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                                </block>
                              </value>
                              <value name="AT2">
                                <block type="math_arithmetic" id="/J~-dDEP{q1Q9w1~0,^T">
                                  <field name="OP">MINUS</field>
                                  <value name="A">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="variables_get" id="Q?IP)z%/F{7@|~$]:0eL">
                                      <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="@^CPOeP.};O[d,Es#iCn">
                                      <field name="NUM">1</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="mDPw_Z}^BO;TmCFVhdv^">
                              <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                              <value name="VALUE">
                                <block type="text_getSubstring" id="#i]iQl!,bcV+av,GFYz=">
                                  <mutation at1="true" at2="false"></mutation>
                                  <field name="WHERE1">FROM_START</field>
                                  <field name="WHERE2">LAST</field>
                                  <value name="STRING">
                                    <block type="variables_get" id="AI.jRvx_TV:8FD|Yg}We">
                                      <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                    </block>
                                  </value>
                                  <value name="AT1">
                                    <block type="math_arithmetic" id=":w06g;GzB!/,,4{6[NL{">
                                      <field name="OP">ADD</field>
                                      <value name="A">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="variables_get" id="JQ;*V2L%IywMQ`0P0IWb">
                                          <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="4F=H0Ua8RW*a-k%w70^c">
                                          <field name="NUM">1</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="Q55pFK%/0G[HKAFoCuK/">
                                  <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                  <value name="VALUE">
                                    <block type="text_join" id=";uh{bOFEE#++qrTxNe,L">
                                      <mutation items="3"></mutation>
                                      <value name="ADD0">
                                        <block type="variables_get" id="!aKN=tk^`zVbU8wSv~xP">
                                          <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                                        </block>
                                      </value>
                                      <value name="ADD1">
                                        <block type="text" id="|7|8^T2617I6biR=zw;q">
                                          <field name="TEXT">;</field>
                                        </block>
                                      </value>
                                      <value name="ADD2">
                                        <block type="variables_get" id="=|Vlq[7uU5lDaO3_eM7M">
                                          <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Rantanplan

      CCU3 / MS Server 2019(VM) / Scripten mit Blockly

      dslraserD padrinoP 2 Replies Last reply
      1
      • rantanplanR rantanplan

        Hallo

        Probiert es doch mal so.
        Da ich kein ALEXA habe, kann ich nicht überprüfen welche Variante bessere Ergebnisse liefert.
        ALEXA.png

        <xml xmlns="https://developers.google.com/blockly/xml">
          <variables>
            <variable id="UU7uV-BrPR`oZ7}SlnaF">MeinText</variable>
            <variable id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</variable>
            <variable id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</variable>
            <variable id="Jj`q+?wfujVA5m,ym8fZ">Stelle</variable>
            <variable id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</variable>
            <variable id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</variable>
            <variable id="m6sx_t9-csQoDVP3jNN7">Teil_1</variable>
            <variable id="e#{w_y/*kb@=|-sF^8kS">Teil_2</variable>
          </variables>
          <block type="comment" id="n/JM2z]iZB^`!ciz.KW1" x="38" y="138">
            <field name="COMMENT">Sonderfall ALEXA</field>
            <next>
              <block type="variables_set" id="Q.ABhh@87P]0qq3k53y;">
                <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                <value name="VALUE">
                  <block type="text" id=":{y_9l{#7,#rl!5i6:|q">
                    <field name="TEXT">Als es die ersten Hügel des Kursivgebirges erklommen hatte, warf es einen letzten Blick zurück auf die Skyline seiner Heimatstadt Buchstabhausen, die Headline von Alphabetdorf und die Subline seiner eigenen Straße, der Zeilengasse. Wehmütig lief ihm eine rethorische Frage über die Wange, dann setzte es seinen Weg fort. Unterwegs traf es eine Copy. Die Copy warnte das Blindtextchen, da, wo sie herkäme wäre sie zigmal umgeschrieben worden und alles, was von ihrem Ursprung noch übrig wäre, sei das Wort „und“ und das Blindtextchen solle umkehren und wieder in sein eigenes, sicheres Land zurückkehren. Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten.</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id=".T:/-#~SQ/Kl*I=8?[(c">
                    <field name="VAR" id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</field>
                    <value name="VALUE">
                      <block type="text_length" id="J06Xu#g[}sq]93@GaB#R">
                        <value name="VALUE">
                          <shadow type="text" id="mvu6,IQ(C$51Ei(jbBDM">
                            <field name="TEXT">abc</field>
                          </shadow>
                          <block type="variables_get" id="wj]d?_Jkvs4,U-ebzs%N">
                            <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id="!!w|M.0*brbepyM6|WBz">
                        <value name="IF0">
                          <block type="logic_compare" id="[+|~Q$R4?80A|B1@f`MD">
                            <field name="OP">GT</field>
                            <value name="A">
                              <block type="text_length" id="WRTP,=Z94mexuepUOK/w">
                                <value name="VALUE">
                                  <shadow type="text">
                                    <field name="TEXT">abc</field>
                                  </shadow>
                                  <block type="variables_get" id="Au+5aDg/rLd-M`CIXVD4">
                                    <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="O~ExGK.m90w2y:pR=LG4">
                                <field name="NUM">250</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="ky/?p.#T/yiR6JB!H]|*">
                            <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                            <value name="VALUE">
                              <block type="math_round" id=")H2AO*YlTK^|Xhwc4i@.">
                                <field name="OP">ROUNDUP</field>
                                <value name="NUM">
                                  <shadow type="math_number">
                                    <field name="NUM">3.1</field>
                                  </shadow>
                                  <block type="math_arithmetic" id="pX():_csupdVq!nYy6C.">
                                    <field name="OP">DIVIDE</field>
                                    <value name="A">
                                      <shadow type="math_number">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="text_length" id="lgecF7`Ry_j88^3#l.n,">
                                        <value name="VALUE">
                                          <shadow type="text">
                                            <field name="TEXT">abc</field>
                                          </shadow>
                                          <block type="variables_get" id="{QR`#Nx7ylWYqUIFpE,8">
                                            <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="wWYFy/j@xxIs/Z_t{ria">
                                        <field name="NUM">250</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="HN620Ed|Q7FV=tm]mTz]">
                                <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                                <value name="VALUE">
                                  <block type="math_number" id="al7=x,IaIa?:8WY5bD=l">
                                    <field name="NUM">1</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="controls_repeat_ext" id="X=7XyhCU$r{@Kfw/W$;%">
                                    <value name="TIMES">
                                      <shadow type="math_number" id="%I6B0iInDn7HVGbY;{,E">
                                        <field name="NUM">10</field>
                                      </shadow>
                                      <block type="variables_get" id="mZ6Kg{z72L@+Acq{q-*G">
                                        <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                                      </block>
                                    </value>
                                    <statement name="DO">
                                      <block type="procedures_callnoreturn" id="v;i,wop(~j~%zeE-9;%:">
                                        <mutation name="etwas tun"></mutation>
                                        <next>
                                          <block type="math_change" id="=+ra}WqVS22)PW]-4to7">
                                            <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                                            <value name="DELTA">
                                              <shadow type="math_number" id="eUnZO!jEgG/v9H;ZFxyq">
                                                <field name="NUM">1</field>
                                              </shadow>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="debug" id="CS0OvId}+[u0`$|l?^K=">
                            <field name="Severity">log</field>
                            <value name="TEXT">
                              <shadow type="text" id="hT]V6h@V$Vbp0)y=|[X+">
                                <field name="TEXT">test</field>
                              </shadow>
                              <block type="variables_get" id="VQvaW=TM^-~_rq,=;D0+">
                                <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
          <block type="procedures_defnoreturn" id="vJB4(k|`W5|mU%Gr8}GK" x="38" y="538">
            <field name="NAME">etwas tun</field>
            <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
            <statement name="STACK">
              <block type="variables_set" id="T^03@FO*[if3TkA^eV80">
                <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                <value name="VALUE">
                  <block type="text_getSubstring" id="QRYT;Md=|?icSYh$CyY*">
                    <mutation at1="true" at2="true"></mutation>
                    <field name="WHERE1">FROM_START</field>
                    <field name="WHERE2">FROM_START</field>
                    <value name="STRING">
                      <block type="variables_get" id="r$U0(iA_SQ;[dJ$ghTk{">
                        <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                      </block>
                    </value>
                    <value name="AT1">
                      <block type="math_number" id="$YFF%6Y+HcbOynqZH{ZB">
                        <field name="NUM">1</field>
                      </block>
                    </value>
                    <value name="AT2">
                      <block type="math_arithmetic" id="+R*6|LFDO4u#!^v+2Q{H">
                        <field name="OP">MULTIPLY</field>
                        <value name="A">
                          <shadow type="math_number" id="!VRlkc-Q8%d!nRtn%J}.">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="variables_get" id="u-!Sf66I63t]x=z+9p+=">
                            <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="/_X[Lr$e#gJ`FAG::jg_">
                            <field name="NUM">250</field>
                          </shadow>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="Oa09_q#iu{rX^x~rsg`B">
                    <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                    <value name="VALUE">
                      <block type="text_indexOf" id="3+MPtMHhTAe;#NJnV-4A">
                        <field name="END">LAST</field>
                        <value name="VALUE">
                          <block type="variables_get" id="5Z/zuT8}+g()Uh*,X)@r">
                            <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                          </block>
                        </value>
                        <value name="FIND">
                          <shadow type="text" id="|;5Zlyr.902bUtFdA9p,">
                            <field name="TEXT">,</field>
                          </shadow>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id="19EmJGA`l+u{y,F+q33-">
                        <value name="IF0">
                          <block type="logic_compare" id="uT+*1w@e5OxTF$UGZ[wT">
                            <field name="OP">GT</field>
                            <value name="A">
                              <block type="variables_get" id="Pelhp;C]yYmEGftw{XC.">
                                <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="J_d~,9#l:|F!pB%XGyt|">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="z0hH8zn%SX|PtC^A`dBy">
                            <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                            <value name="VALUE">
                              <block type="text_getSubstring" id="(1K~4B/;hRq4LcEEjx:A">
                                <mutation at1="false" at2="true"></mutation>
                                <field name="WHERE1">FIRST</field>
                                <field name="WHERE2">FROM_START</field>
                                <value name="STRING">
                                  <block type="variables_get" id="eon-{j~:rQ~a]n=WVtO%">
                                    <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                                  </block>
                                </value>
                                <value name="AT2">
                                  <block type="math_arithmetic" id="/J~-dDEP{q1Q9w1~0,^T">
                                    <field name="OP">MINUS</field>
                                    <value name="A">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="variables_get" id="Q?IP)z%/F{7@|~$]:0eL">
                                        <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="@^CPOeP.};O[d,Es#iCn">
                                        <field name="NUM">1</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="mDPw_Z}^BO;TmCFVhdv^">
                                <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                                <value name="VALUE">
                                  <block type="text_getSubstring" id="#i]iQl!,bcV+av,GFYz=">
                                    <mutation at1="true" at2="false"></mutation>
                                    <field name="WHERE1">FROM_START</field>
                                    <field name="WHERE2">LAST</field>
                                    <value name="STRING">
                                      <block type="variables_get" id="AI.jRvx_TV:8FD|Yg}We">
                                        <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                      </block>
                                    </value>
                                    <value name="AT1">
                                      <block type="math_arithmetic" id=":w06g;GzB!/,,4{6[NL{">
                                        <field name="OP">ADD</field>
                                        <value name="A">
                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="variables_get" id="JQ;*V2L%IywMQ`0P0IWb">
                                            <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="4F=H0Ua8RW*a-k%w70^c">
                                            <field name="NUM">1</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="Q55pFK%/0G[HKAFoCuK/">
                                    <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                    <value name="VALUE">
                                      <block type="text_join" id=";uh{bOFEE#++qrTxNe,L">
                                        <mutation items="3"></mutation>
                                        <value name="ADD0">
                                          <block type="variables_get" id="!aKN=tk^`zVbU8wSv~xP">
                                            <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                                          </block>
                                        </value>
                                        <value name="ADD1">
                                          <block type="text" id="|7|8^T2617I6biR=zw;q">
                                            <field name="TEXT">;</field>
                                          </block>
                                        </value>
                                        <value name="ADD2">
                                          <block type="variables_get" id="=|Vlq[7uU5lDaO3_eM7M">
                                            <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </xml>
        

        dslraserD Offline
        dslraserD Offline
        dslraser
        Forum Testing Most Active
        wrote on last edited by
        #42

        @rantanplan
        Danke Dir, schaue ich mir auch gerne an.

        1 Reply Last reply
        0
        • rantanplanR rantanplan

          Hallo

          Probiert es doch mal so.
          Da ich kein ALEXA habe, kann ich nicht überprüfen welche Variante bessere Ergebnisse liefert.
          ALEXA.png

          <xml xmlns="https://developers.google.com/blockly/xml">
            <variables>
              <variable id="UU7uV-BrPR`oZ7}SlnaF">MeinText</variable>
              <variable id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</variable>
              <variable id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</variable>
              <variable id="Jj`q+?wfujVA5m,ym8fZ">Stelle</variable>
              <variable id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</variable>
              <variable id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</variable>
              <variable id="m6sx_t9-csQoDVP3jNN7">Teil_1</variable>
              <variable id="e#{w_y/*kb@=|-sF^8kS">Teil_2</variable>
            </variables>
            <block type="comment" id="n/JM2z]iZB^`!ciz.KW1" x="38" y="138">
              <field name="COMMENT">Sonderfall ALEXA</field>
              <next>
                <block type="variables_set" id="Q.ABhh@87P]0qq3k53y;">
                  <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                  <value name="VALUE">
                    <block type="text" id=":{y_9l{#7,#rl!5i6:|q">
                      <field name="TEXT">Als es die ersten Hügel des Kursivgebirges erklommen hatte, warf es einen letzten Blick zurück auf die Skyline seiner Heimatstadt Buchstabhausen, die Headline von Alphabetdorf und die Subline seiner eigenen Straße, der Zeilengasse. Wehmütig lief ihm eine rethorische Frage über die Wange, dann setzte es seinen Weg fort. Unterwegs traf es eine Copy. Die Copy warnte das Blindtextchen, da, wo sie herkäme wäre sie zigmal umgeschrieben worden und alles, was von ihrem Ursprung noch übrig wäre, sei das Wort „und“ und das Blindtextchen solle umkehren und wieder in sein eigenes, sicheres Land zurückkehren. Doch alles Gutzureden konnte es nicht überzeugen und so dauerte es nicht lange, bis ihm ein paar heimtückische Werbetexter auflauerten, es mit Longe und Parole betrunken machten und es dann in ihre Agentur schleppten, wo sie es für ihre Projekte wieder und wieder mißbrauchten.</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id=".T:/-#~SQ/Kl*I=8?[(c">
                      <field name="VAR" id="S}?/~CK]]EQz#|akZ`SN">MeinTextLaenge</field>
                      <value name="VALUE">
                        <block type="text_length" id="J06Xu#g[}sq]93@GaB#R">
                          <value name="VALUE">
                            <shadow type="text" id="mvu6,IQ(C$51Ei(jbBDM">
                              <field name="TEXT">abc</field>
                            </shadow>
                            <block type="variables_get" id="wj]d?_Jkvs4,U-ebzs%N">
                              <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="controls_if" id="!!w|M.0*brbepyM6|WBz">
                          <value name="IF0">
                            <block type="logic_compare" id="[+|~Q$R4?80A|B1@f`MD">
                              <field name="OP">GT</field>
                              <value name="A">
                                <block type="text_length" id="WRTP,=Z94mexuepUOK/w">
                                  <value name="VALUE">
                                    <shadow type="text">
                                      <field name="TEXT">abc</field>
                                    </shadow>
                                    <block type="variables_get" id="Au+5aDg/rLd-M`CIXVD4">
                                      <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <value name="B">
                                <block type="math_number" id="O~ExGK.m90w2y:pR=LG4">
                                  <field name="NUM">250</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="variables_set" id="ky/?p.#T/yiR6JB!H]|*">
                              <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                              <value name="VALUE">
                                <block type="math_round" id=")H2AO*YlTK^|Xhwc4i@.">
                                  <field name="OP">ROUNDUP</field>
                                  <value name="NUM">
                                    <shadow type="math_number">
                                      <field name="NUM">3.1</field>
                                    </shadow>
                                    <block type="math_arithmetic" id="pX():_csupdVq!nYy6C.">
                                      <field name="OP">DIVIDE</field>
                                      <value name="A">
                                        <shadow type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="text_length" id="lgecF7`Ry_j88^3#l.n,">
                                          <value name="VALUE">
                                            <shadow type="text">
                                              <field name="TEXT">abc</field>
                                            </shadow>
                                            <block type="variables_get" id="{QR`#Nx7ylWYqUIFpE,8">
                                              <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="wWYFy/j@xxIs/Z_t{ria">
                                          <field name="NUM">250</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="HN620Ed|Q7FV=tm]mTz]">
                                  <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="al7=x,IaIa?:8WY5bD=l">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="controls_repeat_ext" id="X=7XyhCU$r{@Kfw/W$;%">
                                      <value name="TIMES">
                                        <shadow type="math_number" id="%I6B0iInDn7HVGbY;{,E">
                                          <field name="NUM">10</field>
                                        </shadow>
                                        <block type="variables_get" id="mZ6Kg{z72L@+Acq{q-*G">
                                          <field name="VAR" id="_vjn3WVb@^#`vL%#k/6h">AnzahlDurchlauf</field>
                                        </block>
                                      </value>
                                      <statement name="DO">
                                        <block type="procedures_callnoreturn" id="v;i,wop(~j~%zeE-9;%:">
                                          <mutation name="etwas tun"></mutation>
                                          <next>
                                            <block type="math_change" id="=+ra}WqVS22)PW]-4to7">
                                              <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                                              <value name="DELTA">
                                                <shadow type="math_number" id="eUnZO!jEgG/v9H;ZFxyq">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                          <next>
                            <block type="debug" id="CS0OvId}+[u0`$|l?^K=">
                              <field name="Severity">log</field>
                              <value name="TEXT">
                                <shadow type="text" id="hT]V6h@V$Vbp0)y=|[X+">
                                  <field name="TEXT">test</field>
                                </shadow>
                                <block type="variables_get" id="VQvaW=TM^-~_rq,=;D0+">
                                  <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                </block>
                              </value>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
            <block type="procedures_defnoreturn" id="vJB4(k|`W5|mU%Gr8}GK" x="38" y="538">
              <field name="NAME">etwas tun</field>
              <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
              <statement name="STACK">
                <block type="variables_set" id="T^03@FO*[if3TkA^eV80">
                  <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                  <value name="VALUE">
                    <block type="text_getSubstring" id="QRYT;Md=|?icSYh$CyY*">
                      <mutation at1="true" at2="true"></mutation>
                      <field name="WHERE1">FROM_START</field>
                      <field name="WHERE2">FROM_START</field>
                      <value name="STRING">
                        <block type="variables_get" id="r$U0(iA_SQ;[dJ$ghTk{">
                          <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                        </block>
                      </value>
                      <value name="AT1">
                        <block type="math_number" id="$YFF%6Y+HcbOynqZH{ZB">
                          <field name="NUM">1</field>
                        </block>
                      </value>
                      <value name="AT2">
                        <block type="math_arithmetic" id="+R*6|LFDO4u#!^v+2Q{H">
                          <field name="OP">MULTIPLY</field>
                          <value name="A">
                            <shadow type="math_number" id="!VRlkc-Q8%d!nRtn%J}.">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="variables_get" id="u-!Sf66I63t]x=z+9p+=">
                              <field name="VAR" id="jdD!,*Yl9^E~7-~@r.*{">Zaehler</field>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="/_X[Lr$e#gJ`FAG::jg_">
                              <field name="NUM">250</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="Oa09_q#iu{rX^x~rsg`B">
                      <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                      <value name="VALUE">
                        <block type="text_indexOf" id="3+MPtMHhTAe;#NJnV-4A">
                          <field name="END">LAST</field>
                          <value name="VALUE">
                            <block type="variables_get" id="5Z/zuT8}+g()Uh*,X)@r">
                              <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                            </block>
                          </value>
                          <value name="FIND">
                            <shadow type="text" id="|;5Zlyr.902bUtFdA9p,">
                              <field name="TEXT">,</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="controls_if" id="19EmJGA`l+u{y,F+q33-">
                          <value name="IF0">
                            <block type="logic_compare" id="uT+*1w@e5OxTF$UGZ[wT">
                              <field name="OP">GT</field>
                              <value name="A">
                                <block type="variables_get" id="Pelhp;C]yYmEGftw{XC.">
                                  <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                </block>
                              </value>
                              <value name="B">
                                <block type="math_number" id="J_d~,9#l:|F!pB%XGyt|">
                                  <field name="NUM">0</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="variables_set" id="z0hH8zn%SX|PtC^A`dBy">
                              <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                              <value name="VALUE">
                                <block type="text_getSubstring" id="(1K~4B/;hRq4LcEEjx:A">
                                  <mutation at1="false" at2="true"></mutation>
                                  <field name="WHERE1">FIRST</field>
                                  <field name="WHERE2">FROM_START</field>
                                  <value name="STRING">
                                    <block type="variables_get" id="eon-{j~:rQ~a]n=WVtO%">
                                      <field name="VAR" id="V@1Wsn~^*Ib^g{VPen+Z">PruefText</field>
                                    </block>
                                  </value>
                                  <value name="AT2">
                                    <block type="math_arithmetic" id="/J~-dDEP{q1Q9w1~0,^T">
                                      <field name="OP">MINUS</field>
                                      <value name="A">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="variables_get" id="Q?IP)z%/F{7@|~$]:0eL">
                                          <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="@^CPOeP.};O[d,Es#iCn">
                                          <field name="NUM">1</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="mDPw_Z}^BO;TmCFVhdv^">
                                  <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                                  <value name="VALUE">
                                    <block type="text_getSubstring" id="#i]iQl!,bcV+av,GFYz=">
                                      <mutation at1="true" at2="false"></mutation>
                                      <field name="WHERE1">FROM_START</field>
                                      <field name="WHERE2">LAST</field>
                                      <value name="STRING">
                                        <block type="variables_get" id="AI.jRvx_TV:8FD|Yg}We">
                                          <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                        </block>
                                      </value>
                                      <value name="AT1">
                                        <block type="math_arithmetic" id=":w06g;GzB!/,,4{6[NL{">
                                          <field name="OP">ADD</field>
                                          <value name="A">
                                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="variables_get" id="JQ;*V2L%IywMQ`0P0IWb">
                                              <field name="VAR" id="Jj`q+?wfujVA5m,ym8fZ">Stelle</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <shadow type="math_number" id="4F=H0Ua8RW*a-k%w70^c">
                                              <field name="NUM">1</field>
                                            </shadow>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="Q55pFK%/0G[HKAFoCuK/">
                                      <field name="VAR" id="UU7uV-BrPR`oZ7}SlnaF">MeinText</field>
                                      <value name="VALUE">
                                        <block type="text_join" id=";uh{bOFEE#++qrTxNe,L">
                                          <mutation items="3"></mutation>
                                          <value name="ADD0">
                                            <block type="variables_get" id="!aKN=tk^`zVbU8wSv~xP">
                                              <field name="VAR" id="m6sx_t9-csQoDVP3jNN7">Teil_1</field>
                                            </block>
                                          </value>
                                          <value name="ADD1">
                                            <block type="text" id="|7|8^T2617I6biR=zw;q">
                                              <field name="TEXT">;</field>
                                            </block>
                                          </value>
                                          <value name="ADD2">
                                            <block type="variables_get" id="=|Vlq[7uU5lDaO3_eM7M">
                                              <field name="VAR" id="e#{w_y/*kb@=|-sF^8kS">Teil_2</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </xml>
          

          padrinoP Offline
          padrinoP Offline
          padrino
          Most Active
          wrote on last edited by padrino
          #43

          @rantanplan
          Witzig, einen Ansatz mit Durchläufe = Länge durch 250 hatte ich zuerst auch, bis ich dann gemerkt habe, war am Ende in meinem Code unnötig. :D:+1:

          rantanplanR 1 Reply Last reply
          0
          • padrinoP padrino

            @rantanplan
            Witzig, einen Ansatz mit Durchläufe = Länge durch 250 hatte ich zuerst auch, bis ich dann gemerkt habe, war am Ende in meinem Code unnötig. :D:+1:

            rantanplanR Offline
            rantanplanR Offline
            rantanplan
            wrote on last edited by
            #44

            @padrino sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

            @rantanplan
            Witzig, einen Ansatz mit Durchläufe = Länge durch 250 hatte ich zuerst auch, bis ich dann gemerkt habe, war am Ende in meinem Code unnötig. :D:+1:

            Ich finde nur den Intevall für diese Lösung etwas unglücklich.

            Grüße

            Rantanplan

            CCU3 / MS Server 2019(VM) / Scripten mit Blockly

            dslraserD 1 Reply Last reply
            0
            • rantanplanR rantanplan

              @padrino sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

              @rantanplan
              Witzig, einen Ansatz mit Durchläufe = Länge durch 250 hatte ich zuerst auch, bis ich dann gemerkt habe, war am Ende in meinem Code unnötig. :D:+1:

              Ich finde nur den Intevall für diese Lösung etwas unglücklich.

              Grüße

              dslraserD Offline
              dslraserD Offline
              dslraser
              Forum Testing Most Active
              wrote on last edited by
              #45

              @rantanplan sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

              Ich finde nur den Intevall für diese Lösung etwas unglücklich.

              Warum ? Was ist der "Nachteil" bzw. an Deiner Lösung der Vorteil ?

              rantanplanR 1 Reply Last reply
              0
              • dslraserD dslraser

                @rantanplan sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

                Ich finde nur den Intevall für diese Lösung etwas unglücklich.

                Warum ? Was ist der "Nachteil" bzw. an Deiner Lösung der Vorteil ?

                rantanplanR Offline
                rantanplanR Offline
                rantanplan
                wrote on last edited by
                #46

                @dslraser sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

                Warum ? Was ist der "Nachteil" bzw. an Deiner Lösung der Vorteil ?

                Ich versuche immer das System so wenig wie möglich zu belasten.
                Ein Intervall ist für das System arbeitsintensiver als eine kleine Schleife.

                Ein so kleines Blockly wird das System wohl nicht in Schwierigkeiten bringen:blush:
                Wenn man aber so etwas laufend einsetzt, obwohl es nicht notwendig ist, und man hat viele Scripte.......

                Grüße

                Rantanplan

                CCU3 / MS Server 2019(VM) / Scripten mit Blockly

                1 Reply Last reply
                0
                • dslraserD Offline
                  dslraserD Offline
                  dslraser
                  Forum Testing Most Active
                  wrote on last edited by dslraser
                  #47

                  @padrino
                  @rantanplan
                  Gute Nachrichten, beide Varianten funktionieren bei meinen bisherigen Test zuverlässig.

                  Für meine Blocklys werde ich mich für die Variante von @rantanplan entscheiden, weil dort kein Intervall gestoppt werden muß. (ein möglicher Fehler weniger)

                  Ich habe mit beiden Varianten mal einen beliebigen Text (z.B. Reiseportal Bewertungen---da gab es ellenlange Bewertungen) umwandeln lassen. Dort waren Texte mit mehreren Tausend Zeichen dabei. Ich habe mir jetzt nicht die ganzen Texte angehört (immer abgebrochen), aber Alexa fing immer brav an zu sprechen, was sie ja nicht macht, wenn der Text ohne Semikolon in der Länge nicht stimmt bzw. länger als 250 Zeichen ohne Semikolon ist.

                  Danke Euch Beiden:+1:

                  1 Reply Last reply
                  1
                  • dslraserD Offline
                    dslraserD Offline
                    dslraser
                    Forum Testing Most Active
                    wrote on last edited by dslraser
                    #48

                    @padrino
                    @rantanplan

                    Ich habe nun doch noch mal einiges getestet und mir dann auch Texte angehört. Bei der Variante von @rantanplan fehlen Textbereiche. (ich muß nochmal schauen, ob das ein Timing Problem ist, wenn man den Text ansagen lassen will)

                    Beim gleichen Text mit @padrino seiner Variante endet die Ansage irgendwann und der letzte Teil fehlt in der Ansage...

                    Ich werde weiter testen und schauen woran es liegt....

                    PS: es könnte auch sein, das die Geschichte mit den Semikolons bei Alexa nicht bis ins Endlose reicht (also z.B. max 5 ?) oder ist so eine Ansage zeitlich begrenzt ?
                    @padrino , weißt Du da was ?

                    padrinoP 1 Reply Last reply
                    0
                    • dslraserD dslraser

                      @padrino
                      @rantanplan

                      Ich habe nun doch noch mal einiges getestet und mir dann auch Texte angehört. Bei der Variante von @rantanplan fehlen Textbereiche. (ich muß nochmal schauen, ob das ein Timing Problem ist, wenn man den Text ansagen lassen will)

                      Beim gleichen Text mit @padrino seiner Variante endet die Ansage irgendwann und der letzte Teil fehlt in der Ansage...

                      Ich werde weiter testen und schauen woran es liegt....

                      PS: es könnte auch sein, das die Geschichte mit den Semikolons bei Alexa nicht bis ins Endlose reicht (also z.B. max 5 ?) oder ist so eine Ansage zeitlich begrenzt ?
                      @padrino , weißt Du da was ?

                      padrinoP Offline
                      padrinoP Offline
                      padrino
                      Most Active
                      wrote on last edited by padrino
                      #49

                      @dslraser
                      Ich glaube, hier im Forum etwas von "um die 1000" als maximale Länge gelesen zu haben, aber genau ergründet wurde das wohl nicht...
                      Mein informatisch angehauchtes Herz würde ja sagen 256/1024 - aber, da schon die 256 nicht stimmen... 🤷‍♂️

                      Mit Debug Ausgaben des Strings, ist mir auch schon aufgefallen, dass Textteile manchmal fehlen.
                      Also der String im Log ist korrekt und vollständig, aber Alexa lässt einen Block mittendtin einfach weg. :(
                      Es passiert hier ab und an auch bei einem ganz normalen speak, dass nichts kommt.
                      Da ich nicht weiß wieso, hab ich es mehr oder weniger so akzeptiert. :relieved:

                      1 Reply Last reply
                      0
                      • rantanplanR rantanplan

                        Hallo

                        Manchmal ist es notwendig unliebsame Zeichen aus einem Text zu entfernen um diese z.B. in VIS vernünftig darstellen zu können.
                        Mit dem folgenden Blockly kann man jedes Zeichen, ganze Wörter oder eine Folge von Steuerzeichen gegen etwas anderes tauschen.

                        Der von @robson gefundene Bug wurde behoben.

                        Zeichentausch.png

                        Hier der geänderte Export:

                        <xml xmlns="https://developers.google.com/blockly/xml">
                          <variables>
                            <variable id="xSVSX?qYBxERx4)1(5:3">originalText</variable>
                            <variable id=";bO,k;{f-t4YW^V4Yaby">suchText</variable>
                            <variable id="=KxFmb,!C-6!HK%6iSz4">tauschText</variable>
                            <variable id="pF_ac~cY~|C(S.I!U%Uu">MeinText</variable>
                            <variable id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</variable>
                            <variable id="P8$b81v9fsrHHrb+z]g1">Text</variable>
                            <variable id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</variable>
                            <variable id="I;i^c)UORMgY^LOatF[8">neuerText</variable>
                            <variable id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</variable>
                            <variable id="(NMF97xgk;{xp~AH$Ln*">Stelle</variable>
                          </variables>
                          <block type="comment" id="?t^|J^}%io+OnqAwVT4A" x="-237" y="-87">
                            <field name="COMMENT">Beliebige Zeichen tauschen</field>
                            <next>
                              <block type="variables_set" id="-P{_[1=caHEAoB9cP4Qx">
                                <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                <value name="VALUE">
                                  <block type="text" id="]-v|)OoSpw-K*Z-|~Z|L">
                                    <field name="TEXT">Dieser Text müßte geändert werden.</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS">
                                    <value name="IF0">
                                      <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)">
                                        <value name="BOOL">
                                          <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN">
                                            <value name="VALUE">
                                              <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="9LrDM?0xYv?MX-(}2OrI">
                                                <field name="TEXT"></field>
                                              </shadow>
                                              <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM">
                                                <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#">
                                        <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                        <value name="VALUE">
                                          <block type="procedures_callreturn" id="ECH/%?YEFylSUOK._8/K">
                                            <mutation name="changeText">
                                              <arg name="originalText"></arg>
                                              <arg name="suchText"></arg>
                                              <arg name="tauschText"></arg>
                                            </mutation>
                                            <value name="ARG0">
                                              <block type="variables_get" id="Y(bM=~D[D5v)7a#1{`}`">
                                                <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                              </block>
                                            </value>
                                            <value name="ARG1">
                                              <block type="text" id="(iqf|@QE;6:tP0}rbaEj">
                                                <field name="TEXT">ü</field>
                                              </block>
                                            </value>
                                            <value name="ARG2">
                                              <block type="text" id="_{HiLh|2|F3|a#[4lCvX">
                                                <field name="TEXT">ue</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="variables_set" id="`vGUP!R!*|3sjY~dZXxZ">
                                            <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                            <value name="VALUE">
                                              <block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
                                                <mutation name="changeText">
                                                  <arg name="originalText"></arg>
                                                  <arg name="suchText"></arg>
                                                  <arg name="tauschText"></arg>
                                                </mutation>
                                                <value name="ARG0">
                                                  <block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
                                                    <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                  </block>
                                                </value>
                                                <value name="ARG1">
                                                  <block type="text" id="mbk@+N`6F_eG)N%Jw|2J">
                                                    <field name="TEXT">ä</field>
                                                  </block>
                                                </value>
                                                <value name="ARG2">
                                                  <block type="text" id="OtGH;LSHf;*t,59fJ)5i">
                                                    <field name="TEXT">ae</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
                                                <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                <value name="VALUE">
                                                  <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V">
                                                    <mutation name="changeText">
                                                      <arg name="originalText"></arg>
                                                      <arg name="suchText"></arg>
                                                      <arg name="tauschText"></arg>
                                                    </mutation>
                                                    <value name="ARG0">
                                                      <block type="variables_get" id=",eH?bND1?H}TimRX_wnz">
                                                        <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                      </block>
                                                    </value>
                                                    <value name="ARG1">
                                                      <block type="text" id="6AWuk;A#5~8;jXas31)I">
                                                        <field name="TEXT">ß</field>
                                                      </block>
                                                    </value>
                                                    <value name="ARG2">
                                                      <block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
                                                        <field name="TEXT">ss</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="debug" id="g8IUrYe_.rei!S6]Mc?a">
                                                    <field name="Severity">log</field>
                                                    <value name="TEXT">
                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                        <field name="TEXT"></field>
                                                      </shadow>
                                                      <block type="variables_get" id="^/WzSct]9kWQNOvtqOg/">
                                                        <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="debug" id="Hme!w3Ag?_DUH%uRzR)U">
                                                        <field name="Severity">log</field>
                                                        <value name="TEXT">
                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="variables_get" id="`v3q2Xw=qC`r6)o/kUEY">
                                                            <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                          <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="288" y="-87">
                            <mutation>
                              <arg name="originalText" varid="xSVSX?qYBxERx4)1(5:3"></arg>
                              <arg name="suchText" varid=";bO,k;{f-t4YW^V4Yaby"></arg>
                              <arg name="tauschText" varid="=KxFmb,!C-6!HK%6iSz4"></arg>
                            </mutation>
                            <field name="NAME">changeText</field>
                            <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                            <statement name="STACK">
                              <block type="variables_set" id=",*Bi*dYY8!8mI7(mg9V.">
                                <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                <value name="VALUE">
                                  <block type="text" id="|BZm+^ZNZWW}2Oo#`j;?">
                                    <field name="TEXT"></field>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="w]M[kO6!;:DS!~0O}SHV">
                                    <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                    <value name="VALUE">
                                      <block type="text" id="LK!;|?K5!yeQYlUax(!P">
                                        <field name="TEXT"></field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN">
                                        <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                        <value name="VALUE">
                                          <block type="variables_get" id="da5*p]}sO:{{|ZE!nhDe">
                                            <field name="VAR" id="xSVSX?qYBxERx4)1(5:3">originalText</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
                                            <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                                            <value name="VALUE">
                                              <block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
                                                <value name="VALUE">
                                                  <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="RZWm!~Yo4w5)66Gu|Gs_">
                                                    <field name="TEXT">abc</field>
                                                  </shadow>
                                                  <block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
                                                    <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
                                                <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                <value name="VALUE">
                                                  <block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
                                                    <field name="END">FIRST</field>
                                                    <value name="VALUE">
                                                      <block type="variables_get" id="}de%ffO*rIt%j6)99pf3">
                                                        <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                      </block>
                                                    </value>
                                                    <value name="FIND">
                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="7MprEQxoWq}#3~Xz:32k">
                                                        <field name="TEXT">%0D%0A</field>
                                                      </shadow>
                                                      <block type="variables_get" id="7)r.X1a~Tee1!dAwZy`!">
                                                        <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
                                                    <field name="MODE">WHILE</field>
                                                    <value name="BOOL">
                                                      <block type="logic_compare" id="e`eUWK6kyOU=[/x]M({`">
                                                        <field name="OP">GT</field>
                                                        <value name="A">
                                                          <block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
                                                            <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
                                                            <field name="NUM">0</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO">
                                                      <block type="comment" id="38%#2?@btrH6%hebNg3_">
                                                        <field name="COMMENT">Wenn nicht erste Zeichen im Text!</field>
                                                        <next>
                                                          <block type="controls_if" id="R]}Pl(*eeA:Dh@;{q_CH">
                                                            <value name="IF0">
                                                              <block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
                                                                <field name="OP">GT</field>
                                                                <value name="A">
                                                                  <block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
                                                                    <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
                                                                    <field name="NUM">1</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{">
                                                                <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                                                <value name="VALUE">
                                                                  <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw">
                                                                    <mutation at1="false" at2="true"></mutation>
                                                                    <field name="WHERE1">FIRST</field>
                                                                    <field name="WHERE2">FROM_START</field>
                                                                    <value name="STRING">
                                                                      <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,=">
                                                                        <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="AT2">
                                                                      <block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
                                                                        <field name="OP">MINUS</field>
                                                                        <value name="A">
                                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="u@:!j5WimCjV%fG9hPGs">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
                                                                            <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </statement>
                                                            <next>
                                                              <block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
                                                                <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                                <value name="VALUE">
                                                                  <block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
                                                                    <mutation at1="true" at2="false"></mutation>
                                                                    <field name="WHERE1">FROM_START</field>
                                                                    <field name="WHERE2">LAST</field>
                                                                    <value name="STRING">
                                                                      <block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
                                                                        <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="AT1">
                                                                      <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG">
                                                                        <field name="OP">ADD</field>
                                                                        <value name="A">
                                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="8/I%=/~YReHV]Iwo{}(J">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{">
                                                                            <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=";Q(aJ::90?0?H;-45cgS">
                                                                            <field name="NUM">0</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A">
                                                                            <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc">
                                                                    <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                    <value name="VALUE">
                                                                      <block type="text_join" id="%%D@nUqB1tt^`?qrUahx">
                                                                        <mutation items="3"></mutation>
                                                                        <value name="ADD0">
                                                                          <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM">
                                                                            <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD1">
                                                                          <block type="variables_get" id="f~POFU0}K4-w]xVc1?,`">
                                                                            <field name="VAR" id="=KxFmb,!C-6!HK%6iSz4">tauschText</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD2">
                                                                          <block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
                                                                            <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
                                                                        <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                        <value name="VALUE">
                                                                          <block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
                                                                            <field name="END">FIRST</field>
                                                                            <value name="VALUE">
                                                                              <block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
                                                                                <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                              </block>
                                                                            </value>
                                                                            <value name="FIND">
                                                                              <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{Vd/Su8uk@lo|:3KMi1L">
                                                                                <field name="TEXT">%0D%0A</field>
                                                                              </shadow>
                                                                              <block type="variables_get" id="r|~fKkGR#@1@G6_GX`-g">
                                                                                <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <value name="RETURN">
                              <block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
                                <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                              </block>
                            </value>
                          </block>
                        </xml>
                        

                        Bei Fragen, fragen.

                        Grüße

                        David G.D Online
                        David G.D Online
                        David G.
                        wrote on last edited by
                        #50

                        @rantanplan

                        Hallo,

                        danke für deine Vorlage.
                        Baue Sie grad nach.

                        Aber irgendwie bin ich zu doof, den "change Text" Baustein zu finden.

                        Kann mir jemand sagen, wie ich den erreiche?

                        Zeigt eure Lovelace-Visualisierung klick
                        (Auch ideal um sich Anregungen zu holen)

                        Meine Tabellen für eure Visualisierung klick

                        dslraserD 1 Reply Last reply
                        0
                        • David G.D David G.

                          @rantanplan

                          Hallo,

                          danke für deine Vorlage.
                          Baue Sie grad nach.

                          Aber irgendwie bin ich zu doof, den "change Text" Baustein zu finden.

                          Kann mir jemand sagen, wie ich den erreiche?

                          dslraserD Offline
                          dslraserD Offline
                          dslraser
                          Forum Testing Most Active
                          wrote on last edited by dslraser
                          #51

                          @David-G
                          wenn Du es nachbaust mußt Du den selbst erstellen, das ist eine Funktion.
                          (oder Du importierst den Export aus dem ersten Beitrag)

                          David G.D 1 Reply Last reply
                          0
                          • dslraserD dslraser

                            @David-G
                            wenn Du es nachbaust mußt Du den selbst erstellen, das ist eine Funktion.
                            (oder Du importierst den Export aus dem ersten Beitrag)

                            David G.D Online
                            David G.D Online
                            David G.
                            wrote on last edited by
                            #52

                            @dslraser

                            Importieren ist was doof, möchte es in ein größeres Script was ich schon habe integrieren.
                            Kann man die Funktion aus dem Export extrahieren?

                            Zeigt eure Lovelace-Visualisierung klick
                            (Auch ideal um sich Anregungen zu holen)

                            Meine Tabellen für eure Visualisierung klick

                            dslraserD 1 Reply Last reply
                            0
                            • David G.D David G.

                              @dslraser

                              Importieren ist was doof, möchte es in ein größeres Script was ich schon habe integrieren.
                              Kann man die Funktion aus dem Export extrahieren?

                              dslraserD Offline
                              dslraserD Offline
                              dslraser
                              Forum Testing Most Active
                              wrote on last edited by
                              #53

                              @David-G
                              Man kann jeden einzelnen Baustein oder sogar ganze Bereiche extrahieren. Einfach den Baustein, also die gesamte Funktion anklicken und dann exportieren in die Zwischenablage und wieder in Dein anderes Blockly importieren.

                              David G.D 2 Replies Last reply
                              0
                              • dslraserD dslraser

                                @David-G
                                Man kann jeden einzelnen Baustein oder sogar ganze Bereiche extrahieren. Einfach den Baustein, also die gesamte Funktion anklicken und dann exportieren in die Zwischenablage und wieder in Dein anderes Blockly importieren.

                                David G.D Online
                                David G.D Online
                                David G.
                                wrote on last edited by
                                #54

                                @dslraser

                                Dann schaue ich nachher mal, ob ich die Funktion finde, wenn man auch in ein bestehendes Script einzelne Teile importieren kann.

                                Zeigt eure Lovelace-Visualisierung klick
                                (Auch ideal um sich Anregungen zu holen)

                                Meine Tabellen für eure Visualisierung klick

                                1 Reply Last reply
                                0
                                • dslraserD dslraser

                                  @David-G
                                  Man kann jeden einzelnen Baustein oder sogar ganze Bereiche extrahieren. Einfach den Baustein, also die gesamte Funktion anklicken und dann exportieren in die Zwischenablage und wieder in Dein anderes Blockly importieren.

                                  David G.D Online
                                  David G.D Online
                                  David G.
                                  wrote on last edited by
                                  #55

                                  @dslraser

                                  Habs hinbekommen.
                                  Die Tabelle von der wir gestern gesprochen habe, habe ich jetzt auch mit dem Pingadapter umgesetzt.
                                  Der haut immer ein doofes "Alive" vor den Namen.

                                  Jetzt ist es weg (und kann noch ein wenig Einfluss nehmen).

                                  Zeigt eure Lovelace-Visualisierung klick
                                  (Auch ideal um sich Anregungen zu holen)

                                  Meine Tabellen für eure Visualisierung klick

                                  1 Reply Last reply
                                  1
                                  • rantanplanR rantanplan

                                    Hallo

                                    Manchmal ist es notwendig unliebsame Zeichen aus einem Text zu entfernen um diese z.B. in VIS vernünftig darstellen zu können.
                                    Mit dem folgenden Blockly kann man jedes Zeichen, ganze Wörter oder eine Folge von Steuerzeichen gegen etwas anderes tauschen.

                                    Der von @robson gefundene Bug wurde behoben.

                                    Zeichentausch.png

                                    Hier der geänderte Export:

                                    <xml xmlns="https://developers.google.com/blockly/xml">
                                      <variables>
                                        <variable id="xSVSX?qYBxERx4)1(5:3">originalText</variable>
                                        <variable id=";bO,k;{f-t4YW^V4Yaby">suchText</variable>
                                        <variable id="=KxFmb,!C-6!HK%6iSz4">tauschText</variable>
                                        <variable id="pF_ac~cY~|C(S.I!U%Uu">MeinText</variable>
                                        <variable id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</variable>
                                        <variable id="P8$b81v9fsrHHrb+z]g1">Text</variable>
                                        <variable id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</variable>
                                        <variable id="I;i^c)UORMgY^LOatF[8">neuerText</variable>
                                        <variable id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</variable>
                                        <variable id="(NMF97xgk;{xp~AH$Ln*">Stelle</variable>
                                      </variables>
                                      <block type="comment" id="?t^|J^}%io+OnqAwVT4A" x="-237" y="-87">
                                        <field name="COMMENT">Beliebige Zeichen tauschen</field>
                                        <next>
                                          <block type="variables_set" id="-P{_[1=caHEAoB9cP4Qx">
                                            <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                            <value name="VALUE">
                                              <block type="text" id="]-v|)OoSpw-K*Z-|~Z|L">
                                                <field name="TEXT">Dieser Text müßte geändert werden.</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS">
                                                <value name="IF0">
                                                  <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)">
                                                    <value name="BOOL">
                                                      <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN">
                                                        <value name="VALUE">
                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="9LrDM?0xYv?MX-(}2OrI">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM">
                                                            <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO0">
                                                  <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#">
                                                    <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                    <value name="VALUE">
                                                      <block type="procedures_callreturn" id="ECH/%?YEFylSUOK._8/K">
                                                        <mutation name="changeText">
                                                          <arg name="originalText"></arg>
                                                          <arg name="suchText"></arg>
                                                          <arg name="tauschText"></arg>
                                                        </mutation>
                                                        <value name="ARG0">
                                                          <block type="variables_get" id="Y(bM=~D[D5v)7a#1{`}`">
                                                            <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                                          </block>
                                                        </value>
                                                        <value name="ARG1">
                                                          <block type="text" id="(iqf|@QE;6:tP0}rbaEj">
                                                            <field name="TEXT">ü</field>
                                                          </block>
                                                        </value>
                                                        <value name="ARG2">
                                                          <block type="text" id="_{HiLh|2|F3|a#[4lCvX">
                                                            <field name="TEXT">ue</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="`vGUP!R!*|3sjY~dZXxZ">
                                                        <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                        <value name="VALUE">
                                                          <block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
                                                            <mutation name="changeText">
                                                              <arg name="originalText"></arg>
                                                              <arg name="suchText"></arg>
                                                              <arg name="tauschText"></arg>
                                                            </mutation>
                                                            <value name="ARG0">
                                                              <block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
                                                                <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                              </block>
                                                            </value>
                                                            <value name="ARG1">
                                                              <block type="text" id="mbk@+N`6F_eG)N%Jw|2J">
                                                                <field name="TEXT">ä</field>
                                                              </block>
                                                            </value>
                                                            <value name="ARG2">
                                                              <block type="text" id="OtGH;LSHf;*t,59fJ)5i">
                                                                <field name="TEXT">ae</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
                                                            <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                            <value name="VALUE">
                                                              <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V">
                                                                <mutation name="changeText">
                                                                  <arg name="originalText"></arg>
                                                                  <arg name="suchText"></arg>
                                                                  <arg name="tauschText"></arg>
                                                                </mutation>
                                                                <value name="ARG0">
                                                                  <block type="variables_get" id=",eH?bND1?H}TimRX_wnz">
                                                                    <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ARG1">
                                                                  <block type="text" id="6AWuk;A#5~8;jXas31)I">
                                                                    <field name="TEXT">ß</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ARG2">
                                                                  <block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
                                                                    <field name="TEXT">ss</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="debug" id="g8IUrYe_.rei!S6]Mc?a">
                                                                <field name="Severity">log</field>
                                                                <value name="TEXT">
                                                                  <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                    <field name="TEXT"></field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="^/WzSct]9kWQNOvtqOg/">
                                                                    <field name="VAR" id="pF_ac~cY~|C(S.I!U%Uu">MeinText</field>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="debug" id="Hme!w3Ag?_DUH%uRzR)U">
                                                                    <field name="Severity">log</field>
                                                                    <value name="TEXT">
                                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                        <field name="TEXT"></field>
                                                                      </shadow>
                                                                      <block type="variables_get" id="`v3q2Xw=qC`r6)o/kUEY">
                                                                        <field name="VAR" id="I;i^c)UORMgY^LOatF[8">neuerText</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </statement>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                      <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="288" y="-87">
                                        <mutation>
                                          <arg name="originalText" varid="xSVSX?qYBxERx4)1(5:3"></arg>
                                          <arg name="suchText" varid=";bO,k;{f-t4YW^V4Yaby"></arg>
                                          <arg name="tauschText" varid="=KxFmb,!C-6!HK%6iSz4"></arg>
                                        </mutation>
                                        <field name="NAME">changeText</field>
                                        <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                        <statement name="STACK">
                                          <block type="variables_set" id=",*Bi*dYY8!8mI7(mg9V.">
                                            <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                            <value name="VALUE">
                                              <block type="text" id="|BZm+^ZNZWW}2Oo#`j;?">
                                                <field name="TEXT"></field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="w]M[kO6!;:DS!~0O}SHV">
                                                <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                <value name="VALUE">
                                                  <block type="text" id="LK!;|?K5!yeQYlUax(!P">
                                                    <field name="TEXT"></field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN">
                                                    <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                    <value name="VALUE">
                                                      <block type="variables_get" id="da5*p]}sO:{{|ZE!nhDe">
                                                        <field name="VAR" id="xSVSX?qYBxERx4)1(5:3">originalText</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
                                                        <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                                                        <value name="VALUE">
                                                          <block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
                                                            <value name="VALUE">
                                                              <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="RZWm!~Yo4w5)66Gu|Gs_">
                                                                <field name="TEXT">abc</field>
                                                              </shadow>
                                                              <block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
                                                                <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
                                                            <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                            <value name="VALUE">
                                                              <block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
                                                                <field name="END">FIRST</field>
                                                                <value name="VALUE">
                                                                  <block type="variables_get" id="}de%ffO*rIt%j6)99pf3">
                                                                    <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                  </block>
                                                                </value>
                                                                <value name="FIND">
                                                                  <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="7MprEQxoWq}#3~Xz:32k">
                                                                    <field name="TEXT">%0D%0A</field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="7)r.X1a~Tee1!dAwZy`!">
                                                                    <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
                                                                <field name="MODE">WHILE</field>
                                                                <value name="BOOL">
                                                                  <block type="logic_compare" id="e`eUWK6kyOU=[/x]M({`">
                                                                    <field name="OP">GT</field>
                                                                    <value name="A">
                                                                      <block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
                                                                        <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="B">
                                                                      <block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
                                                                        <field name="NUM">0</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <statement name="DO">
                                                                  <block type="comment" id="38%#2?@btrH6%hebNg3_">
                                                                    <field name="COMMENT">Wenn nicht erste Zeichen im Text!</field>
                                                                    <next>
                                                                      <block type="controls_if" id="R]}Pl(*eeA:Dh@;{q_CH">
                                                                        <value name="IF0">
                                                                          <block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
                                                                            <field name="OP">GT</field>
                                                                            <value name="A">
                                                                              <block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
                                                                                <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                              </block>
                                                                            </value>
                                                                            <value name="B">
                                                                              <block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
                                                                                <field name="NUM">1</field>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                        <statement name="DO0">
                                                                          <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{">
                                                                            <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                                                            <value name="VALUE">
                                                                              <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw">
                                                                                <mutation at1="false" at2="true"></mutation>
                                                                                <field name="WHERE1">FIRST</field>
                                                                                <field name="WHERE2">FROM_START</field>
                                                                                <value name="STRING">
                                                                                  <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,=">
                                                                                    <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="AT2">
                                                                                  <block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
                                                                                    <field name="OP">MINUS</field>
                                                                                    <value name="A">
                                                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="u@:!j5WimCjV%fG9hPGs">
                                                                                        <field name="NUM">1</field>
                                                                                      </shadow>
                                                                                      <block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
                                                                                        <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="B">
                                                                                      <shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
                                                                                        <field name="NUM">1</field>
                                                                                      </shadow>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </statement>
                                                                        <next>
                                                                          <block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
                                                                            <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                                            <value name="VALUE">
                                                                              <block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
                                                                                <mutation at1="true" at2="false"></mutation>
                                                                                <field name="WHERE1">FROM_START</field>
                                                                                <field name="WHERE2">LAST</field>
                                                                                <value name="STRING">
                                                                                  <block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
                                                                                    <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                                  </block>
                                                                                </value>
                                                                                <value name="AT1">
                                                                                  <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG">
                                                                                    <field name="OP">ADD</field>
                                                                                    <value name="A">
                                                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="8/I%=/~YReHV]Iwo{}(J">
                                                                                        <field name="NUM">1</field>
                                                                                      </shadow>
                                                                                      <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{">
                                                                                        <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="B">
                                                                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=";Q(aJ::90?0?H;-45cgS">
                                                                                        <field name="NUM">0</field>
                                                                                      </shadow>
                                                                                      <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A">
                                                                                        <field name="VAR" id="6,6h67!#*?Hh,1(Sy,@u">AnzZeichenSuchtext</field>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc">
                                                                                <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                                <value name="VALUE">
                                                                                  <block type="text_join" id="%%D@nUqB1tt^`?qrUahx">
                                                                                    <mutation items="3"></mutation>
                                                                                    <value name="ADD0">
                                                                                      <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM">
                                                                                        <field name="VAR" id="Uf:U=$(.HDJ72/VPr1!o">Teil_1</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="ADD1">
                                                                                      <block type="variables_get" id="f~POFU0}K4-w]xVc1?,`">
                                                                                        <field name="VAR" id="=KxFmb,!C-6!HK%6iSz4">tauschText</field>
                                                                                      </block>
                                                                                    </value>
                                                                                    <value name="ADD2">
                                                                                      <block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
                                                                                        <field name="VAR" id="g[0H+Z8J_%|p]v;tR.p.">Teil_2</field>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </value>
                                                                                <next>
                                                                                  <block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
                                                                                    <field name="VAR" id="(NMF97xgk;{xp~AH$Ln*">Stelle</field>
                                                                                    <value name="VALUE">
                                                                                      <block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
                                                                                        <field name="END">FIRST</field>
                                                                                        <value name="VALUE">
                                                                                          <block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
                                                                                            <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                                                                          </block>
                                                                                        </value>
                                                                                        <value name="FIND">
                                                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="{Vd/Su8uk@lo|:3KMi1L">
                                                                                            <field name="TEXT">%0D%0A</field>
                                                                                          </shadow>
                                                                                          <block type="variables_get" id="r|~fKkGR#@1@G6_GX`-g">
                                                                                            <field name="VAR" id=";bO,k;{f-t4YW^V4Yaby">suchText</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                  </block>
                                                                                </next>
                                                                              </block>
                                                                            </next>
                                                                          </block>
                                                                        </next>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </statement>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                        <value name="RETURN">
                                          <block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
                                            <field name="VAR" id="P8$b81v9fsrHHrb+z]g1">Text</field>
                                          </block>
                                        </value>
                                      </block>
                                    </xml>
                                    

                                    Bei Fragen, fragen.

                                    Grüße

                                    R Offline
                                    R Offline
                                    robson
                                    wrote on last edited by
                                    #56

                                    @rantanplan sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

                                    Hallo

                                    Manchmal ist es notwendig unliebsame Zeichen aus einem Text zu entfernen um diese z.B. in VIS vernünftig darstellen zu können.
                                    Mit dem folgenden Blockly kann man jedes Zeichen, ganze Wörter oder eine Folge von Steuerzeichen gegen etwas anderes tauschen.
                                    Forum_TauscheZeichen.png
                                    Hier der Export:

                                    <xml xmlns="http://www.w3.org/1999/xhtml">
                                      <block type="comment" id="?t^|J^}%io+OnqAwVT4A" x="-237" y="-87">
                                        <field name="COMMENT">Beliebige Zeichen tauschen</field>
                                        <next>
                                          <block type="variables_set" id="-P{_[1=caHEAoB9cP4Qx">
                                            <field name="VAR">MeinText</field>
                                            <value name="VALUE">
                                              <block type="text" id="]-v|)OoSpw-K*Z-|~Z|L">
                                                <field name="TEXT">Dieser Text müßte geändert werden</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS">
                                                <value name="IF0">
                                                  <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)">
                                                    <value name="BOOL">
                                                      <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN">
                                                        <value name="VALUE">
                                                          <shadow type="text" id="9LrDM?0xYv?MX-(}2OrI">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM">
                                                            <field name="VAR">MeinText</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO0">
                                                  <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#">
                                                    <field name="VAR">neuerText</field>
                                                    <value name="VALUE">
                                                      <block type="procedures_callreturn" id="ECH/%?YEFylSUOK._8/K">
                                                        <mutation name="changeText">
                                                          <arg name="originalText"></arg>
                                                          <arg name="suchText"></arg>
                                                          <arg name="tauschText"></arg>
                                                        </mutation>
                                                        <value name="ARG0">
                                                          <block type="variables_get" id="Y(bM=~D[D5v)7a#1{`}`">
                                                            <field name="VAR">MeinText</field>
                                                          </block>
                                                        </value>
                                                        <value name="ARG1">
                                                          <block type="text" id="(iqf|@QE;6:tP0}rbaEj">
                                                            <field name="TEXT">ü</field>
                                                          </block>
                                                        </value>
                                                        <value name="ARG2">
                                                          <block type="text" id="_{HiLh|2|F3|a#[4lCvX">
                                                            <field name="TEXT">ue</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="`vGUP!R!*|3sjY~dZXxZ">
                                                        <field name="VAR">neuerText</field>
                                                        <value name="VALUE">
                                                          <block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
                                                            <mutation name="changeText">
                                                              <arg name="originalText"></arg>
                                                              <arg name="suchText"></arg>
                                                              <arg name="tauschText"></arg>
                                                            </mutation>
                                                            <value name="ARG0">
                                                              <block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
                                                                <field name="VAR">neuerText</field>
                                                              </block>
                                                            </value>
                                                            <value name="ARG1">
                                                              <block type="text" id="mbk@+N`6F_eG)N%Jw|2J">
                                                                <field name="TEXT">ä</field>
                                                              </block>
                                                            </value>
                                                            <value name="ARG2">
                                                              <block type="text" id="OtGH;LSHf;*t,59fJ)5i">
                                                                <field name="TEXT">ae</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
                                                            <field name="VAR">neuerText</field>
                                                            <value name="VALUE">
                                                              <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V">
                                                                <mutation name="changeText">
                                                                  <arg name="originalText"></arg>
                                                                  <arg name="suchText"></arg>
                                                                  <arg name="tauschText"></arg>
                                                                </mutation>
                                                                <value name="ARG0">
                                                                  <block type="variables_get" id=",eH?bND1?H}TimRX_wnz">
                                                                    <field name="VAR">neuerText</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ARG1">
                                                                  <block type="text" id="6AWuk;A#5~8;jXas31)I">
                                                                    <field name="TEXT">ß</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ARG2">
                                                                  <block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
                                                                    <field name="TEXT">ss</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="debug" id="g8IUrYe_.rei!S6]Mc?a">
                                                                <field name="Severity">log</field>
                                                                <value name="TEXT">
                                                                  <shadow type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                    <field name="TEXT"></field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="^/WzSct]9kWQNOvtqOg/">
                                                                    <field name="VAR">MeinText</field>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="debug" id="Hme!w3Ag?_DUH%uRzR)U">
                                                                    <field name="Severity">log</field>
                                                                    <value name="TEXT">
                                                                      <shadow type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                        <field name="TEXT"></field>
                                                                      </shadow>
                                                                      <block type="variables_get" id="`v3q2Xw=qC`r6)o/kUEY">
                                                                        <field name="VAR">neuerText</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </statement>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                      <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="288" y="-87">
                                        <mutation>
                                          <arg name="originalText"></arg>
                                          <arg name="suchText"></arg>
                                          <arg name="tauschText"></arg>
                                        </mutation>
                                        <field name="NAME">changeText</field>
                                        <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                        <statement name="STACK">
                                          <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN">
                                            <field name="VAR">Text</field>
                                            <value name="VALUE">
                                              <block type="variables_get" id="da5*p]}sO:{{|ZE!nhDe">
                                                <field name="VAR">originalText</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
                                                <field name="VAR">AnzZeichenSuchtext</field>
                                                <value name="VALUE">
                                                  <block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
                                                    <value name="VALUE">
                                                      <shadow type="text" id="RZWm!~Yo4w5)66Gu|Gs_">
                                                        <field name="TEXT">abc</field>
                                                      </shadow>
                                                      <block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
                                                        <field name="VAR">suchText</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
                                                    <field name="VAR">Stelle</field>
                                                    <value name="VALUE">
                                                      <block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
                                                        <field name="END">FIRST</field>
                                                        <value name="VALUE">
                                                          <block type="variables_get" id="}de%ffO*rIt%j6)99pf3">
                                                            <field name="VAR">Text</field>
                                                          </block>
                                                        </value>
                                                        <value name="FIND">
                                                          <shadow type="text" id="7MprEQxoWq}#3~Xz:32k">
                                                            <field name="TEXT">%0D%0A</field>
                                                          </shadow>
                                                          <block type="variables_get" id="7)r.X1a~Tee1!dAwZy`!">
                                                            <field name="VAR">suchText</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
                                                        <field name="MODE">WHILE</field>
                                                        <value name="BOOL">
                                                          <block type="logic_compare" id="e`eUWK6kyOU=[/x]M({`">
                                                            <field name="OP">GT</field>
                                                            <value name="A">
                                                              <block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
                                                                <field name="VAR">Stelle</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
                                                                <field name="NUM">0</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <statement name="DO">
                                                          <block type="controls_if" id="PM@Su)b1YOhTZo2qPxB]">
                                                            <mutation else="1"></mutation>
                                                            <value name="IF0">
                                                              <block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
                                                                <field name="OP">EQ</field>
                                                                <value name="A">
                                                                  <block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
                                                                    <field name="VAR">Stelle</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
                                                                    <field name="NUM">1</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <statement name="DO0">
                                                              <block type="comment" id="uN{|N4-0EabDJqYE0]@#">
                                                                <field name="COMMENT">steht am Textanfang</field>
                                                                <next>
                                                                  <block type="variables_set" id="9?Gy,w.t#1pdl^AOxc#Y">
                                                                    <field name="VAR">Teil_1</field>
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="h(#=bJ`DU%y/Jd9%HR9I">
                                                                        <field name="VAR">tauschText</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </statement>
                                                            <statement name="ELSE">
                                                              <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{">
                                                                <field name="VAR">Teil_1</field>
                                                                <value name="VALUE">
                                                                  <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw">
                                                                    <mutation at1="false" at2="true"></mutation>
                                                                    <field name="WHERE1">FIRST</field>
                                                                    <field name="WHERE2">FROM_START</field>
                                                                    <value name="STRING">
                                                                      <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,=">
                                                                        <field name="VAR">Text</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="AT2">
                                                                      <block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
                                                                        <field name="OP">MINUS</field>
                                                                        <value name="A">
                                                                          <shadow type="math_number" id="u@:!j5WimCjV%fG9hPGs">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
                                                                            <field name="VAR">Stelle</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </statement>
                                                            <next>
                                                              <block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
                                                                <field name="VAR">Teil_2</field>
                                                                <value name="VALUE">
                                                                  <block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
                                                                    <mutation at1="true" at2="false"></mutation>
                                                                    <field name="WHERE1">FROM_START</field>
                                                                    <field name="WHERE2">LAST</field>
                                                                    <value name="STRING">
                                                                      <block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
                                                                        <field name="VAR">Text</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="AT1">
                                                                      <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG">
                                                                        <field name="OP">ADD</field>
                                                                        <value name="A">
                                                                          <shadow type="math_number" id="8/I%=/~YReHV]Iwo{}(J">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{">
                                                                            <field name="VAR">Stelle</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <shadow type="math_number" id=";Q(aJ::90?0?H;-45cgS">
                                                                            <field name="NUM">0</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A">
                                                                            <field name="VAR">AnzZeichenSuchtext</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc">
                                                                    <field name="VAR">Text</field>
                                                                    <value name="VALUE">
                                                                      <block type="text_join" id="%%D@nUqB1tt^`?qrUahx">
                                                                        <mutation items="3"></mutation>
                                                                        <value name="ADD0">
                                                                          <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM">
                                                                            <field name="VAR">Teil_1</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD1">
                                                                          <block type="variables_get" id="f~POFU0}K4-w]xVc1?,`">
                                                                            <field name="VAR">tauschText</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD2">
                                                                          <block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
                                                                            <field name="VAR">Teil_2</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
                                                                        <field name="VAR">Stelle</field>
                                                                        <value name="VALUE">
                                                                          <block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
                                                                            <field name="END">FIRST</field>
                                                                            <value name="VALUE">
                                                                              <block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
                                                                                <field name="VAR">Text</field>
                                                                              </block>
                                                                            </value>
                                                                            <value name="FIND">
                                                                              <shadow type="text" id="{Vd/Su8uk@lo|:3KMi1L">
                                                                                <field name="TEXT">%0D%0A</field>
                                                                              </shadow>
                                                                              <block type="variables_get" id="r|~fKkGR#@1@G6_GX`-g">
                                                                                <field name="VAR">suchText</field>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </statement>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                        <value name="RETURN">
                                          <block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
                                            <field name="VAR">Text</field>
                                          </block>
                                        </value>
                                      </block>
                                    </xml>
                                    

                                    Bei Fragen, fragen.

                                    Grüße

                                    Hi @rantanplan ,
                                    danke für deine Vorlage.

                                    Ich hatte bei Nutzung nun aber das Problem, dass das erste Zeichen im String dupliziert getauscht wird.
                                    Bsp: Im String "Wurst" soll das "W" durch ein "D" getauscht werden. Anstatt "Durst" gibt mir das Skript "DDurst" aus.

                                    Das liegt mMn an folgender Funktion:
                                    8707825d-500a-4368-8c40-ea4c82daff7f-image.png

                                    Da "Teil_1" und "tauschText" identisch sind, werden diese hintereinander geschrieben.

                                    Ich habe dies mit einer einfachen Prüfung behoben.
                                    b7ef10e1-ab66-4091-a8f7-e4de58d95292-image.png
                                    Falls "Teil_1" und "tauschtext" identisch sind, dann erstelle Text aus "Teil_1" und Teil_2".
                                    Falls sie nicht identisch sind, dann erstelle Text aus "Teil_1", "tauschtext" und "Teil_2".

                                    Ich hoffe, dass hilft dem ein oder anderen.

                                    rantanplanR 1 Reply Last reply
                                    0
                                    • R robson

                                      @rantanplan sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

                                      Hallo

                                      Manchmal ist es notwendig unliebsame Zeichen aus einem Text zu entfernen um diese z.B. in VIS vernünftig darstellen zu können.
                                      Mit dem folgenden Blockly kann man jedes Zeichen, ganze Wörter oder eine Folge von Steuerzeichen gegen etwas anderes tauschen.
                                      Forum_TauscheZeichen.png
                                      Hier der Export:

                                      <xml xmlns="http://www.w3.org/1999/xhtml">
                                        <block type="comment" id="?t^|J^}%io+OnqAwVT4A" x="-237" y="-87">
                                          <field name="COMMENT">Beliebige Zeichen tauschen</field>
                                          <next>
                                            <block type="variables_set" id="-P{_[1=caHEAoB9cP4Qx">
                                              <field name="VAR">MeinText</field>
                                              <value name="VALUE">
                                                <block type="text" id="]-v|)OoSpw-K*Z-|~Z|L">
                                                  <field name="TEXT">Dieser Text müßte geändert werden</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="controls_if" id="eO-Yu;zv=:r~yJNHR:iS">
                                                  <value name="IF0">
                                                    <block type="logic_negate" id="u@28{:]xG=4a9HU}|/v)">
                                                      <value name="BOOL">
                                                        <block type="text_isEmpty" id="W-_T.2)lUsLG/Z(5zIQN">
                                                          <value name="VALUE">
                                                            <shadow type="text" id="9LrDM?0xYv?MX-(}2OrI">
                                                              <field name="TEXT"></field>
                                                            </shadow>
                                                            <block type="variables_get" id="B?L(8|(8?-Z7Ao*[F/VM">
                                                              <field name="VAR">MeinText</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="variables_set" id="ziw)~y|7*7le5/J*8HC#">
                                                      <field name="VAR">neuerText</field>
                                                      <value name="VALUE">
                                                        <block type="procedures_callreturn" id="ECH/%?YEFylSUOK._8/K">
                                                          <mutation name="changeText">
                                                            <arg name="originalText"></arg>
                                                            <arg name="suchText"></arg>
                                                            <arg name="tauschText"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="variables_get" id="Y(bM=~D[D5v)7a#1{`}`">
                                                              <field name="VAR">MeinText</field>
                                                            </block>
                                                          </value>
                                                          <value name="ARG1">
                                                            <block type="text" id="(iqf|@QE;6:tP0}rbaEj">
                                                              <field name="TEXT">ü</field>
                                                            </block>
                                                          </value>
                                                          <value name="ARG2">
                                                            <block type="text" id="_{HiLh|2|F3|a#[4lCvX">
                                                              <field name="TEXT">ue</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="`vGUP!R!*|3sjY~dZXxZ">
                                                          <field name="VAR">neuerText</field>
                                                          <value name="VALUE">
                                                            <block type="procedures_callreturn" id="rvKR.cz9FhImw~YT8:YY">
                                                              <mutation name="changeText">
                                                                <arg name="originalText"></arg>
                                                                <arg name="suchText"></arg>
                                                                <arg name="tauschText"></arg>
                                                              </mutation>
                                                              <value name="ARG0">
                                                                <block type="variables_get" id="4r-=T6yu%Y[}Zn!QhpR/">
                                                                  <field name="VAR">neuerText</field>
                                                                </block>
                                                              </value>
                                                              <value name="ARG1">
                                                                <block type="text" id="mbk@+N`6F_eG)N%Jw|2J">
                                                                  <field name="TEXT">ä</field>
                                                                </block>
                                                              </value>
                                                              <value name="ARG2">
                                                                <block type="text" id="OtGH;LSHf;*t,59fJ)5i">
                                                                  <field name="TEXT">ae</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="variables_set" id="3+|QU5[xS;U@Qijfuu@7">
                                                              <field name="VAR">neuerText</field>
                                                              <value name="VALUE">
                                                                <block type="procedures_callreturn" id="~C~TrH*=xX3Xl-l@tg#V">
                                                                  <mutation name="changeText">
                                                                    <arg name="originalText"></arg>
                                                                    <arg name="suchText"></arg>
                                                                    <arg name="tauschText"></arg>
                                                                  </mutation>
                                                                  <value name="ARG0">
                                                                    <block type="variables_get" id=",eH?bND1?H}TimRX_wnz">
                                                                      <field name="VAR">neuerText</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="ARG1">
                                                                    <block type="text" id="6AWuk;A#5~8;jXas31)I">
                                                                      <field name="TEXT">ß</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="ARG2">
                                                                    <block type="text" id="[M[ZL8Y,u8fNWw|eR|g)">
                                                                      <field name="TEXT">ss</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="debug" id="g8IUrYe_.rei!S6]Mc?a">
                                                                  <field name="Severity">log</field>
                                                                  <value name="TEXT">
                                                                    <shadow type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                      <field name="TEXT"></field>
                                                                    </shadow>
                                                                    <block type="variables_get" id="^/WzSct]9kWQNOvtqOg/">
                                                                      <field name="VAR">MeinText</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="debug" id="Hme!w3Ag?_DUH%uRzR)U">
                                                                      <field name="Severity">log</field>
                                                                      <value name="TEXT">
                                                                        <shadow type="text" id="d7HPm]yEeu9+?9HT0u|l">
                                                                          <field name="TEXT"></field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="`v3q2Xw=qC`r6)o/kUEY">
                                                                          <field name="VAR">neuerText</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                        <block type="procedures_defreturn" id="*?%n[KG5e1!^tNun#Hj5" x="288" y="-87">
                                          <mutation>
                                            <arg name="originalText"></arg>
                                            <arg name="suchText"></arg>
                                            <arg name="tauschText"></arg>
                                          </mutation>
                                          <field name="NAME">changeText</field>
                                          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                          <statement name="STACK">
                                            <block type="variables_set" id="LyZ2%lYW+kfm,4)yV8UN">
                                              <field name="VAR">Text</field>
                                              <value name="VALUE">
                                                <block type="variables_get" id="da5*p]}sO:{{|ZE!nhDe">
                                                  <field name="VAR">originalText</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="yx;qp1@1fC(oiG4c5gZt">
                                                  <field name="VAR">AnzZeichenSuchtext</field>
                                                  <value name="VALUE">
                                                    <block type="text_length" id="Jwz33ARDLc!=8:eDagDD">
                                                      <value name="VALUE">
                                                        <shadow type="text" id="RZWm!~Yo4w5)66Gu|Gs_">
                                                          <field name="TEXT">abc</field>
                                                        </shadow>
                                                        <block type="variables_get" id="G2I+np)5qee]q{4)BlN2">
                                                          <field name="VAR">suchText</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="eAGK[85W)DRaIaN!oMiH">
                                                      <field name="VAR">Stelle</field>
                                                      <value name="VALUE">
                                                        <block type="text_indexOf" id="/@rj}{;VUCJ8O|28^(Hf">
                                                          <field name="END">FIRST</field>
                                                          <value name="VALUE">
                                                            <block type="variables_get" id="}de%ffO*rIt%j6)99pf3">
                                                              <field name="VAR">Text</field>
                                                            </block>
                                                          </value>
                                                          <value name="FIND">
                                                            <shadow type="text" id="7MprEQxoWq}#3~Xz:32k">
                                                              <field name="TEXT">%0D%0A</field>
                                                            </shadow>
                                                            <block type="variables_get" id="7)r.X1a~Tee1!dAwZy`!">
                                                              <field name="VAR">suchText</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="controls_whileUntil" id="4lR}{f])DWKyjt}.(6cc">
                                                          <field name="MODE">WHILE</field>
                                                          <value name="BOOL">
                                                            <block type="logic_compare" id="e`eUWK6kyOU=[/x]M({`">
                                                              <field name="OP">GT</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="}7HLWRwI(SDg1^@=czoV">
                                                                  <field name="VAR">Stelle</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="math_number" id="#y,za{r#@s7Ri.U!9v)A">
                                                                  <field name="NUM">0</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO">
                                                            <block type="controls_if" id="PM@Su)b1YOhTZo2qPxB]">
                                                              <mutation else="1"></mutation>
                                                              <value name="IF0">
                                                                <block type="logic_compare" id="l,u?h{)Z-u/OozI,.79G">
                                                                  <field name="OP">EQ</field>
                                                                  <value name="A">
                                                                    <block type="variables_get" id="B/K~z.ANK2);I3(uk4Bh">
                                                                      <field name="VAR">Stelle</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="math_number" id="|3~K:6jrHq7oxz=fL:Yz">
                                                                      <field name="NUM">1</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <statement name="DO0">
                                                                <block type="comment" id="uN{|N4-0EabDJqYE0]@#">
                                                                  <field name="COMMENT">steht am Textanfang</field>
                                                                  <next>
                                                                    <block type="variables_set" id="9?Gy,w.t#1pdl^AOxc#Y">
                                                                      <field name="VAR">Teil_1</field>
                                                                      <value name="VALUE">
                                                                        <block type="variables_get" id="h(#=bJ`DU%y/Jd9%HR9I">
                                                                          <field name="VAR">tauschText</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                              <statement name="ELSE">
                                                                <block type="variables_set" id="{R*X,7K)DA^dq/.~KK7{">
                                                                  <field name="VAR">Teil_1</field>
                                                                  <value name="VALUE">
                                                                    <block type="text_getSubstring" id="Img0opt.EB#)RM-bp~hw">
                                                                      <mutation at1="false" at2="true"></mutation>
                                                                      <field name="WHERE1">FIRST</field>
                                                                      <field name="WHERE2">FROM_START</field>
                                                                      <value name="STRING">
                                                                        <block type="variables_get" id="A9h*F{tgJR0y[Q0uv7,=">
                                                                          <field name="VAR">Text</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="AT2">
                                                                        <block type="math_arithmetic" id="([5R[:8Ywn-thKN@r:~}">
                                                                          <field name="OP">MINUS</field>
                                                                          <value name="A">
                                                                            <shadow type="math_number" id="u@:!j5WimCjV%fG9hPGs">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="U0qw,~,2KoaAc37UO{l#">
                                                                              <field name="VAR">Stelle</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <shadow type="math_number" id="DT#zRSRu1.y^|5Z#G37W">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </statement>
                                                              <next>
                                                                <block type="variables_set" id="Else^,?QE9TTS.Y%K]W=">
                                                                  <field name="VAR">Teil_2</field>
                                                                  <value name="VALUE">
                                                                    <block type="text_getSubstring" id="e8A7NqY7O!@K(aFlMpV#" inline="false">
                                                                      <mutation at1="true" at2="false"></mutation>
                                                                      <field name="WHERE1">FROM_START</field>
                                                                      <field name="WHERE2">LAST</field>
                                                                      <value name="STRING">
                                                                        <block type="variables_get" id="|jU0g8+eIgwn_|IB56)@">
                                                                          <field name="VAR">Text</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="AT1">
                                                                        <block type="math_arithmetic" id="F#*%;R9ugmwaaas?WBwG">
                                                                          <field name="OP">ADD</field>
                                                                          <value name="A">
                                                                            <shadow type="math_number" id="8/I%=/~YReHV]Iwo{}(J">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="R0|a}kx2M~SYjPKS5Cc{">
                                                                              <field name="VAR">Stelle</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <shadow type="math_number" id=";Q(aJ::90?0?H;-45cgS">
                                                                              <field name="NUM">0</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="dY33=1IVxkrSH1k1#X6A">
                                                                              <field name="VAR">AnzZeichenSuchtext</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="variables_set" id="OcJS!-Ku1vQY4)I+r,gc">
                                                                      <field name="VAR">Text</field>
                                                                      <value name="VALUE">
                                                                        <block type="text_join" id="%%D@nUqB1tt^`?qrUahx">
                                                                          <mutation items="3"></mutation>
                                                                          <value name="ADD0">
                                                                            <block type="variables_get" id="q]l%0Dpb89BZy1-m[TjM">
                                                                              <field name="VAR">Teil_1</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ADD1">
                                                                            <block type="variables_get" id="f~POFU0}K4-w]xVc1?,`">
                                                                              <field name="VAR">tauschText</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ADD2">
                                                                            <block type="variables_get" id="U77~u,Qfmb2g[O19eHoh">
                                                                              <field name="VAR">Teil_2</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="variables_set" id="lao?KUxF77Si~Xc2j%^{">
                                                                          <field name="VAR">Stelle</field>
                                                                          <value name="VALUE">
                                                                            <block type="text_indexOf" id="[),PN,ZrAW,C/~:K[x[:">
                                                                              <field name="END">FIRST</field>
                                                                              <value name="VALUE">
                                                                                <block type="variables_get" id="6{t:BeVh6=bsQF(zUhYG">
                                                                                  <field name="VAR">Text</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="FIND">
                                                                                <shadow type="text" id="{Vd/Su8uk@lo|:3KMi1L">
                                                                                  <field name="TEXT">%0D%0A</field>
                                                                                </shadow>
                                                                                <block type="variables_get" id="r|~fKkGR#@1@G6_GX`-g">
                                                                                  <field name="VAR">suchText</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <value name="RETURN">
                                            <block type="variables_get" id=".*DA-:q/GzURSEPH2ZiQ">
                                              <field name="VAR">Text</field>
                                            </block>
                                          </value>
                                        </block>
                                      </xml>
                                      

                                      Bei Fragen, fragen.

                                      Grüße

                                      Hi @rantanplan ,
                                      danke für deine Vorlage.

                                      Ich hatte bei Nutzung nun aber das Problem, dass das erste Zeichen im String dupliziert getauscht wird.
                                      Bsp: Im String "Wurst" soll das "W" durch ein "D" getauscht werden. Anstatt "Durst" gibt mir das Skript "DDurst" aus.

                                      Das liegt mMn an folgender Funktion:
                                      8707825d-500a-4368-8c40-ea4c82daff7f-image.png

                                      Da "Teil_1" und "tauschText" identisch sind, werden diese hintereinander geschrieben.

                                      Ich habe dies mit einer einfachen Prüfung behoben.
                                      b7ef10e1-ab66-4091-a8f7-e4de58d95292-image.png
                                      Falls "Teil_1" und "tauschtext" identisch sind, dann erstelle Text aus "Teil_1" und Teil_2".
                                      Falls sie nicht identisch sind, dann erstelle Text aus "Teil_1", "tauschtext" und "Teil_2".

                                      Ich hoffe, dass hilft dem ein oder anderen.

                                      rantanplanR Offline
                                      rantanplanR Offline
                                      rantanplan
                                      wrote on last edited by
                                      #57

                                      @robson Danke für die Info.
                                      Da hast Du aber nach langer, langer, langer Zeit einen Bug gefunden:grin:

                                      Habe das Blockly geändert und im ersten Post neu hinterlegt.
                                      Hier die Änderung.
                                      Zeichentausch2.png

                                      Grüße

                                      Rantanplan

                                      CCU3 / MS Server 2019(VM) / Scripten mit Blockly

                                      R N 2 Replies Last reply
                                      0
                                      • rantanplanR rantanplan

                                        @robson Danke für die Info.
                                        Da hast Du aber nach langer, langer, langer Zeit einen Bug gefunden:grin:

                                        Habe das Blockly geändert und im ersten Post neu hinterlegt.
                                        Hier die Änderung.
                                        Zeichentausch2.png

                                        Grüße

                                        R Offline
                                        R Offline
                                        robson
                                        wrote on last edited by robson
                                        #58

                                        @rantanplan sagte in [Vorlage] Blockly - Beliebiges Zeichen im Text tauschen:

                                        @robson Danke für die Info.
                                        Da hast Du aber nach langer, langer, langer Zeit einen Bug gefunden:grin:

                                        Sehe es als Kompliment für dich und dein Skript an ;)

                                        1 Reply Last reply
                                        0
                                        • rantanplanR rantanplan

                                          @robson Danke für die Info.
                                          Da hast Du aber nach langer, langer, langer Zeit einen Bug gefunden:grin:

                                          Habe das Blockly geändert und im ersten Post neu hinterlegt.
                                          Hier die Änderung.
                                          Zeichentausch2.png

                                          Grüße

                                          N Offline
                                          N Offline
                                          newBroker
                                          wrote on last edited by
                                          #59

                                          Moin zusammen,

                                          sagt mal wird der "rechte" Abschnitt benötigt?
                                          was macht er in dem Skript?

                                          Beste Grüße

                                          David G.D 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          561

                                          Online

                                          32.7k

                                          Users

                                          82.5k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Home
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe