# “Take a break” works on psychopy but not in pavlovia

**URL:** https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061
**Category:** Online experiments
**Tags:** pavlovia
**Created:** [April 6, 2021, 12:10pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061 "2021-04-06T12:10:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Selma](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Selma](https://discourse.psychopy.org/u/Selma)
#### Post date: [April 6, 2021, 12:10pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061/1 "2021-04-06T12:10:00Z")

</div>

Hi,  
I tried to insert a break after every 60 trials.The following lines were added 🙂

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/e/3e3a6d10a81808cea685015ef022c03dd109d9a3.png)

This works perfectly when PsychoPy runs off the local computer. But when tested online, the break does not appear.  
So my different lists (60 stimuli per list) keep scrolling without a break. I know there are often translation problems between python and java, but I have no idea how to make the break appear on pavlovia.

Thanks for any help or ideas.

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [April 6, 2021, 1:04pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061/2 "2021-04-06T13:04:58Z")

</div>

thisN and thisTrialN doesn’t work online. You need to set up your own counter.

loopIdx=-1

loopIdx+=1

if loopIdx == 59:

---

<div class="post-metadata">

### Author: ![Selma](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Selma](https://discourse.psychopy.org/u/Selma)
#### Post date: [April 6, 2021, 2:34pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061/3 "2021-04-06T14:34:56Z")

</div>

Thank you for your answer, i tried your solution but now i have a break between each stimulus. Do you know why?

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [April 6, 2021, 4:06pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061/4 "2021-04-06T16:06:11Z")

</div>

Probably because I missed the not

Try if loopId != 59:

I’m hoping that you realised that loopIdx=-1 should go in Begin Experiment not in the same place as the other two lines.

---

<div class="post-metadata">

### Author: ![doboost](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@doboost](https://discourse.psychopy.org/u/doboost)
#### Post date: [August 13, 2021, 4:14pm UTC](https://discourse.psychopy.org/t/take-a-break-works-on-psychopy-but-not-in-pavlovia/22061/5 "2021-08-13T16:14:34Z")

</div>

Hi  
I have the same issue, please could you paste the answer, how the final code will look like along with other settings?
