Script execute from lambda couses stop

Hello, I’m having trouble executing a lambda script inside an interval. The script itself executes, but the interval stops working right after the script. Removing line “if(licznik1 == 10) {id(r1).execute();}” causes the interval to work normally.
script:

  • id: r1
    then:
    • switch.turn_on: sw1
    • delay: 4s
    • switch.turn_on: sw2
    • delay: 2s
    • switch.turn_off: sw2
    • delay: 4s
    • switch.turn_on: sw3
    • delay: 2s
    • if:
      condition:
      - binary_sensor.is_on: sensor1 2;’
      then:
      - switch.turn_off: sw1
      - globals.set:
      id: p1
      value: “0”
      mode:single
      interval:
  • interval: 0.1s
    then:
    • lambda: |-

      if (id(stan_praca) == true && dziala==false && licznik1 < 302) {
      …other code works fine here…
      if(licznik1 == 10) {id(r1).execute();}
      …stops here until I remove the line containing the script execution…
      licznik1++;}

Dude… First things first here, you need to post properly formatted syntax in your posts. The alignment of your lines of code matter a lot and not posting it correctly causes everything to be aligned on the left side which then makes every single one of the lines of code is an error so, please edit your post and fix it so that people will at least consider wanting to help you out because, as it is now no one wants to touch that with a 10’ pole…

No need to bite their head of for a rookie mistake. I know it gets tired having to ask all first posters the same question, but there’s no need to take out the frustration with the many to just one individual.

Thanks for your interest. I found the problem, and it was in a completely different place. That’s what happens when you overdo security. But when a program is over 1,000 lines long, you can miss something.

As for the code, it looks better in the editor than it does when published.