Hi Steve,
This is a bad idea in theory (and possibly practice). Builder is designed around a frame-drawing & event loop, and by inserting a call to event.waitKeys(), you're breaking that cycle by putting in an indefinite pause, so Builder loses track of which frames have been drawn.
*** event.waitKeys() should only be used in Coder environments, where you control everything. It breaks the code structure and drawing/event loop that Builder relies upon. ***
In essence, your logic of checking the current trial number from a list is the way to go. But after that, a preferable route is to selectively set a variable which decides whether or not a subsequent "pause" routine runs.
e.g. Make your additional routine into a proper "pause" routine, which contains something like a text stimulus telling the participant to push a key when ready, and a keyboard component which ends the trial when any key is pushed. Surround the routine with its own loop, not linked to a conditions file, and with a variable name (say "pause_reps") in the nReps field.
Then your code would look something like this:
if TrialList.thisN in [39, 79, 119]:
pause_reps = 1
else:
pause_reps = 0
Put it in the "End routine" tab *of the trial routine*, i.e. the routine preceding the pause routine. That way, the pause routine will generally not run at all, except on the nominated trials, and the timing and drawing loops that Builder relies upon will be preserved, as you are letting the pause be controlled by a proper keyboard component, rather than brute forcing a waitKeys() period
Also, in the "begin experiment" tab, you might need to put this to give the variable an initial value:
pause_reps = 0
Cheers,
Mike
> On 14/02/2016, at 06:54, Steve L <
lisk....@gmail.com> wrote:
>
> I figured it out. Added another routine within the loop, with a small code:
>
> if TrialList.thisN in [39,79,119]:
> win.flip()
> event.waitKeys()
> continueRoutine=False
>
> Filled by the text for the break.
>
> in case anyone is having the same problem :)
--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND
Senior Research Fellow,
michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph:
+64 3 3786 072
University of Otago, Christchurch
http://www.nzbri.org/macaskill