How can i insert a break midway through a set of 4 repeats?

I have a routine that on the outer loop does 4 reps at random selection from csv file. I need to pause after 2 reps for a break screen to show. once a key is pressed the routine continues with remainder 2 reps.

I am very new to psychopy builder and code in general. I am at a loss of where to start. I tried to set up 2 routines with 2 reps each and in between put in a pause routine, but then i lost the randomisation in the second loop as it repeated some selections.

attached is how my experiment looks in the builder view.

Some variation on this technique:

Thank you Michael, i will try to figure it out using this new information. Very much appreciated.

hello again, i tried to figure out what to do using the code snippet, and it helped me understand also that i didn’t need the 3 loops. Now when i run it, it shows the pause routine after each image display (trial). I need it it to show after. 67, 135, 203…

Below is what my routines now look like and the loops, and also the code snippet. I was trying to test it to show the pause after 5 image display from conditions file (trials) and 11.

As i said before, i am very new to code, to psychopy builder code snippets. I have tried the code also in the Each frame tab and no change.

Help would be hugely appreciated (again). Thank you in advance.

What version of PsychoPy are you using? There was a regression a few months ago, affecting versions 3.2.x, where this technique stopped working, but it was addressed as below, so should be working if you are using the latest release series (2020.1.x):

i am using version 3.2.4

thank you again Michael, i have just downloaded and installed version 2020.1.3 and i am still having issues. The previously posted screen grab, the code should be allowing the pause to be displayed after the 5th trial and the 11th trial (0-4 and 0-10)…

And what actually happens?

It was displaying pause after every trial.

i have figured it out now, i was being rather dense and had named my trial incorrectly so of course the code was not working.

It is now all running smoothly, i appreciate your time and patience with this.

thank you so much.