Alternating images and variable delay
I'm very new to the OS world and I need to run an experiment for an university project in Process interference and cove overlap(Koch). The experiment starts by pressing a Home key( like "G" in my case) that must be pressed until onset of an auditory signal(leaving the home key before the go signal leads to an error), keypress triggers a 500ms blank space followed by a sequence that shows a blue X or a red X in the center. I tried to create in the loop a [cue_color] variable with "blue" and "red" as parameters so that the sketchpad coul draw randomly between the two images of X but instead they are shown in sequence. That's the sketchpad script:
set duration keypress
set description "Displays stimuli"
draw image center=1 file="x_[cue_color].png" scale=1 show_if=always x=0 y=0 z_index=0
The X should be followed by a very fast target stimulus of 28 ms of two dots(14 each), first one centered and second one slitghly to the left or right; immediately followed by a mask to interfere with memory processing until a go signal it's played. The interval between the X onset and the go signal is fixed in 1300 ms, but the interval between X onset and target stimulus needs to be random picked between 4 time configuration, like
100/1200 ; 300/900 ; 900/300 ; 1200/100 . This means that the first configuration has a 100 ms blank space after X onset, 28ms of target stimulus, and 1200 ms of mask. The second has a 300 ms blank space, 28 ms target stimulus, 900 ms of mask and so on