Issue with my protocol

Hello Chris!
I am an intern at the DPZ.

I have an issue with my protocol of blue circles. I wanted to add a state, in which no double-colored circle pops up and after a random timer, the new set of circles pops up, depending on the value of N.

But, while I run it, it stops and it’s not updating the display, like it’s stuck.

Also, the 12Distractors part brings up 24Distractors.
Any idea what can fix it?

I am copying the code here, because I can’t send a file:

trial (nsamples = 1) {
        task {

		state 'checkN' {
			goto (
				target = 'randN'
				 when = N == 2 || N == 3 || N == 4 || N == 5
				)

			goto ('init')
		}

		state 'randN' {
			N = disc_rand(1,4)




	goto (
		target = 'gBall10'
			when = timer_expired(Timer10)
		)
	goto (
		target = 'gBall9'
			when = timer_expired(Timer9)
		)
	goto (
		target = 'gBall8'
			when = timer_expired(Timer8)
		)
	goto (
		target = 'gBall7'
			when = timer_expired(Timer7)
		)
	goto (
		target = 'gBall6'
			when = timer_expired(Timer6)
		)
	goto (
		target = 'gBall5'
			when = timer_expired(Timer5)
		)
	goto (
		target = 'gBall4'
			when = timer_expired(Timer4)
		)
	goto (
		target = 'gBall3'
			when = timer_expired(Timer3)
		)
	goto (
		target = 'gBall2'
			when = timer_expired(Timer2)
		)
	goto(
		target = 'gBall1'
		when = timer_expired(Timer1)
		)




			goto ('init')
			
			}
	state 'gBall1' {
		size_gBall = 0.5
		update_display ()
		goto ('init')
		}
	state 'gBall2' {
		size_gBall = 1
		update_display ()
		goto ('init')
		}
	state 'gBall3' {
		size_gBall = 1.5
		update_display ()
		goto ('init')
		}
	state 'gBall4' {
		size_gBall = 2
		update_display ()
		goto ('init')
		}
	state 'gBall5' {
		size_gBall = 2.5
		update_display ()
		goto ('init')
		}
	state 'gBall6' {
		size_gBall = 3
		update_display ()
		goto ('init')
		}
	state 'gBall7' {
		size_gBall = 3.5
		update_display ()
		goto ('init')
		}
	state 'gBall8' {
		size_gBall = 4
		update_display ()
		goto ('init')
		}
	state 'gBall9' {
		size_gBall = 4.5
		update_display ()
		goto ('init')
		}	
	state 'gBall10' {
		size_gBall = 5
		update_display ()
		goto ('init')
		}


	state 'gBall' {
		//size_gBall += (3/(20/5))
		size_gBall = 0.5
		update_display ()
		timenow = now()
		goto ('init')
		}	
	

		    state 'init' {


		        dequeue_stimulus(feederFull0)
		       	dequeue_stimulus(feederFull1)
		       	dequeue_stimulus(feederFull2)
		       	dequeue_stimulus(feederFull3)
		       	dequeue_stimulus(feederFull4)
		       	dequeue_stimulus(feederFull5)
		       	dequeue_stimulus(feederFull6)
		       	dequeue_stimulus(feederFull7)
		       	dequeue_stimulus(feederFull8)
				dequeue_stimulus(feederFull9)
		       	dequeue_stimulus(feederFull10)
		       	dequeue_stimulus(feederFull11)

				update_display ()

				random_delay = 1e6 * disc_rand(0.7, 2)

				random_delay2 = 1e6 * disc_rand(3, 10)
				

				feedStatR = 1 
				feedStatG = 1
				feedStatB = 0

			goto (target = '7Distractors'; when = N >= 4)
			goto (target = '12Distractors'; when = N < 4 && N >= 3)
			goto (target = '8Distractors'; when = N < 3 && N >=2)
			goto (target = '4Distractors'; when = N < 2)
		 
		    }

		state '7Distractors' {
			i = disc_rand(1,7)
			queue_stimulus (feederEmpty0)
			queue_stimulus (feederEmpty1)
			queue_stimulus (feederEmpty2)
			queue_stimulus (feederEmpty3)
			queue_stimulus (feederEmpty4)
			queue_stimulus (feederEmpty5)
			queue_stimulus (feederEmpty6)

			update_display ()

			goto (target = 'feeder0Empty'; when = i == 1)
		        goto (target = 'feeder1Empty'; when = i == 2)
		        goto (target = 'feeder2Empty'; when = i == 3)
		        goto (target = 'feeder3Empty'; when = i == 4)
		        goto (target = 'feeder4Empty'; when = i == 5)
		        goto (target = 'feeder5Empty'; when = i == 6)
		        goto (target = 'feeder6Empty'; when = i == 7)
		}

		state '12Distractors'{
			i = disc_rand(1,25)
				queue_stimulus(feederEmpty0)
				queue_stimulus(feederEmpty1)
				queue_stimulus(feederEmpty2)
				queue_stimulus(feederEmpty3)
				queue_stimulus(feederEmpty4)
				queue_stimulus(feederEmpty5)
				queue_stimulus(feederEmpty6)
				queue_stimulus(feederEmpty7)
				queue_stimulus(feederEmpty8)
				queue_stimulus(feederEmpty9)
				queue_stimulus(feederEmpty10)
				queue_stimulus(feederEmpty11)

				queue_stimulus(feederEmpty12)
				queue_stimulus(feederEmpty13)
				queue_stimulus(feederEmpty14)
				queue_stimulus(feederEmpty15)
				queue_stimulus(feederEmpty16)
				queue_stimulus(feederEmpty17)
				queue_stimulus(feederEmpty18)
				queue_stimulus(feederEmpty19)
				queue_stimulus(feederEmpty20)
				queue_stimulus(feederEmpty21)
				queue_stimulus(feederEmpty22)
				queue_stimulus(feederEmpty23)
				queue_stimulus(feederEmpty24)

				//wait(random_delay)
				update_display ()

			goto (target = 'feeder0Full'; when = i == 1)
		        goto (target = 'feeder1Full'; when = i == 2)
		        goto (target = 'feeder2Full'; when = i == 3)
		        goto (target = 'feeder3Full'; when = i == 4)
		        goto (target = 'feeder4Full'; when = i == 5)
		        goto (target = 'feeder5Full'; when = i == 6)
		        goto (target = 'feeder6Full'; when = i == 7)
		        goto (target = 'feeder7Full'; when = i == 8)
		        goto (target = 'feeder8Full'; when = i == 9)
		       	goto (target = 'feeder9Full'; when = i == 10)
		        goto (target = 'feeder10Full'; when = i == 11)
		        goto (target = 'feeder11Full'; when = i == 12)

				goto (target = 'feeder12Empty'; when = i == 13)
				goto (target = 'feeder13Empty'; when = i == 14)
				goto (target = 'feeder14Empty'; when = i == 15)
				goto (target = 'feeder15Empty'; when = i == 16)
				goto (target = 'feeder16Empty'; when = i == 17)
				goto (target = 'feeder17Empty'; when = i == 18)
				goto (target = 'feeder18Empty'; when = i == 19)
				goto (target = 'feeder19Empty'; when = i == 20)
				goto (target = 'feeder20Empty'; when = i == 21)
				goto (target = 'feeder21Empty'; when = i == 22)
				goto (target = 'feeder22Empty'; when = i == 23)
				goto (target = 'feeder23Empty'; when = i == 24)
				goto (target = 'feeder24Empty'; when = i == 25)
			}


		state '8Distractors'{

				dequeue_stimulus(feederEmpty24)
				dequeue_stimulus(feederEmpty23)
				dequeue_stimulus(feederEmpty22)
				dequeue_stimulus(feederEmpty21)
				dequeue_stimulus(feederEmpty20)
				dequeue_stimulus(feederEmpty19)
				dequeue_stimulus(feederEmpty18)
				dequeue_stimulus(feederEmpty17)
				dequeue_stimulus(feederEmpty16)
				dequeue_stimulus(feederEmpty15)
				dequeue_stimulus(feederEmpty14)
				dequeue_stimulus(feederEmpty13)
				dequeue_stimulus(feederEmpty12)
				dequeue_stimulus(feederEmpty11)
				dequeue_stimulus(feederEmpty10)
				dequeue_stimulus(feederEmpty9)
				dequeue_stimulus(feederEmpty8)

				

			i = disc_rand(1,8)

				queue_stimulus(feederEmpty0)
				queue_stimulus(feederEmpty1)
				queue_stimulus(feederEmpty2)
				queue_stimulus(feederEmpty3)
				queue_stimulus(feederEmpty4)
				queue_stimulus(feederEmpty5)
				queue_stimulus(feederEmpty6)
				queue_stimulus(feederEmpty7)

				//wait (random_delay)
				update_display ()

			goto (target = 'feeder0Full'; when = i == 1)
		        goto (target = 'feeder1Full'; when = i == 2)
		        goto (target = 'feeder2Full'; when = i == 3)
		        goto (target = 'feeder3Full'; when = i == 4)
		        goto (target = 'feeder4Full'; when = i == 5)
		        goto (target = 'feeder5Full'; when = i == 6)
		        goto (target = 'feeder6Full'; when = i == 7)
		        goto (target = 'feeder7Full'; when = i == 8)
			}


		state '4Distractors'{

				dequeue_stimulus(feederEmpty24)
				dequeue_stimulus(feederEmpty23)
				dequeue_stimulus(feederEmpty22)
				dequeue_stimulus(feederEmpty21)
				dequeue_stimulus(feederEmpty20)
				dequeue_stimulus(feederEmpty19)
				dequeue_stimulus(feederEmpty18)
				dequeue_stimulus(feederEmpty17)
				dequeue_stimulus(feederEmpty16)
				dequeue_stimulus(feederEmpty15)
				dequeue_stimulus(feederEmpty14)
				dequeue_stimulus(feederEmpty13)
				dequeue_stimulus(feederEmpty12)
				dequeue_stimulus(feederEmpty11)
				dequeue_stimulus(feederEmpty10)
				dequeue_stimulus(feederEmpty9)
				dequeue_stimulus(feederEmpty8)
				dequeue_stimulus(feederEmpty7)
				dequeue_stimulus(feederEmpty6)
				dequeue_stimulus(feederEmpty5)
				dequeue_stimulus(feederEmpty4)

			i = disc_rand(1,4)

				queue_stimulus(feederEmpty0)
				queue_stimulus(feederEmpty1)
				queue_stimulus(feederEmpty2)
				queue_stimulus(feederEmpty3)

				//wait (random_delay)
				update_display ()
		

			goto (target = 'feeder0Full'; when = i == 1)
		        goto (target = 'feeder1Full'; when = i == 2)
		        goto (target = 'feeder2Full'; when = i == 3)
		        goto (target = 'feeder3Full'; when = i == 4)

			}

			state 'feeder0Full'{
				//dequeue_stimulus(feederEmpty0)
		       	live_queue_stimulus(feederFull0)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag0)
			}
			state 'feeder1Full'{
		       	live_queue_stimulus(feederFull1)

				wait (random_delay)

		       	update_display ()
				goto(target = 'collect'; when = collectFlag1)
			}
			state 'feeder2Full'{
				//dequeue_stimulus(feederEmpty2)
		       	live_queue_stimulus(feederFull2)

				wait (random_delay)

		       	update_display ()
				goto(target = 'collect'; when = collectFlag2)
			}
			
			state 'feeder3Full'{
				//dequeue_stimulus(feederEmpty3)
		       	live_queue_stimulus(feederFull3)

				wait (random_delay)

		       	update_display ()
				goto(target = 'collect'; when = collectFlag3)

			}
			state 'feeder4Full'{
				//dequeue_stimulus(feederEmpty4)
		       	live_queue_stimulus(feederFull4)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag4)

			}
			state 'feeder5Full'{
				//dequeue_stimulus(feederEmpty5)
		       	live_queue_stimulus(feederFull5)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag5)

			}
			state 'feeder6Full'{
				//dequeue_stimulus(feederEmpty6)
		       	live_queue_stimulus(feederFull6)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag6)

			}
			state 'feeder7Full'{
				//dequeue_stimulus(feederEmpty7)
		       	live_queue_stimulus(feederFull7)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag7)
			}
			state 'feeder8Full'{
				//dequeue_stimulus(feederEmpty8)
		       	live_queue_stimulus(feederFull8)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag8)
			}
			state 'feeder9Full'{
				//dequeue_stimulus(feederEmpty9)
		       	live_queue_stimulus(feederFull9)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag9)
			}
			state 'feeder10Full'{
				//dequeue_stimulus(feederEmpty10)
		       	live_queue_stimulus(feederFull10)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag10)
			}
			state 'feeder11Full'{
				//dequeue_stimulus(feederEmpty11)
		       	live_queue_stimulus(feederFull11)

				wait (random_delay)

				update_display ()
				goto(target = 'collect'; when = collectFlag11)
			}



			state 'feeder0Empty' {
				live_queue_stimulus(feederEmpty0)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder1Empty' {
				live_queue_stimulus (feederEmpty1)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder2Empty' {
				live_queue_stimulus (feederEmpty2)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}
			state 'feeder3Empty' {
				live_queue_stimulus (feederEmpty3)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder4Empty' {
				live_queue_stimulus (feederEmpty4)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder5Empty' {
				live_queue_stimulus (feederEmpty5)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder6Empty' {
				live_queue_stimulus (feederEmpty6)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder7Empty' {
				live_queue_stimulus (feederEmpty7)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder8Empty' {
				live_queue_stimulus (feederEmpty8)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder9Empty' {
				live_queue_stimulus (feederEmpty9)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder10Empty' {
				live_queue_stimulus (feederEmpty10)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder11Empty' {
				live_queue_stimulus (feederEmpty11)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder12Empty' {
				live_queue_stimulus (feederEmpty12)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder13Empty' {
				live_queue_stimulus (feederEmpty13)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder14Empty' {
				live_queue_stimulus (feederEmpty14)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder15Empty' {
				live_queue_stimulus (feederEmpty15)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}
			
			state 'feeder16Empty' {
				live_queue_stimulus (feederEmpty16)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder17Empty' {
				live_queue_stimulus (feederEmpty17)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder18Empty' {
				live_queue_stimulus (feederEmpty18)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder19Empty' {
				live_queue_stimulus (feederEmpty19)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder20Empty' {
				live_queue_stimulus (feederEmpty20)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder21Empty' {
				live_queue_stimulus (feederEmpty21)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder22Empty' {
				live_queue_stimulus (feederEmpty22)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder23Empty' {
				live_queue_stimulus (feederEmpty23)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}

			state 'feeder24Empty' {
				live_queue_stimulus (feederEmpty24)
				update_display ()
				goto(target = 'no collect'; when = timer_expired(random_delay))
			}




			state 'no collect' {

			report ('timestamp1')
			report ('timestamp2')

				N = 0

				feedStatR = 1
				feedStatG = 0
				feedStatB = 0


				update_display ()

			x0 = disc_rand(xPos_A,xPos_B)
			x1 = disc_rand(xPos_A,xPos_B)
			x2 = disc_rand(xPos_A,xPos_B)
			x3 = disc_rand(xPos_A,xPos_B)
			x4 = disc_rand(xPos_A,xPos_B)
			x5 = disc_rand(xPos_A,xPos_B)
			x6 = disc_rand(xPos_A,xPos_B)
			x7 = disc_rand(xPos_A,xPos_B)
			x8 = disc_rand(xPos_A,xPos_B)
			x9 = disc_rand(xPos_A,xPos_B)
			x10 = disc_rand(xPos_A,xPos_B)
			x11 = disc_rand(xPos_A,xPos_B)

			x12 = disc_rand(xPos_A,xPos_B)
			x13 = disc_rand(xPos_A,xPos_B)
			x14 = disc_rand(xPos_A,xPos_B)
			x15 = disc_rand(xPos_A,xPos_B)
			x16 = disc_rand(xPos_A,xPos_B)
			x17 = disc_rand(xPos_A,xPos_B)
			x18 = disc_rand(xPos_A,xPos_B)
			x19 = disc_rand(xPos_A,xPos_B)
			x20 = disc_rand(xPos_A,xPos_B)
			x21 = disc_rand(xPos_A,xPos_B)
			x22 = disc_rand(xPos_A,xPos_B)
			x23 = disc_rand(xPos_A,xPos_B)
			x24 = disc_rand(xPos_A,xPos_B)

			y0 = disc_rand(yPos_A,yPos_B)
			y1 = disc_rand(yPos_A,yPos_B)
			y2 = disc_rand(yPos_A,yPos_B)
			y3 = disc_rand(yPos_A,yPos_B)
			y4 = disc_rand(yPos_A,yPos_B)
			y5 = disc_rand(yPos_A,yPos_B)
			y6 = disc_rand(yPos_A,yPos_B)
			y7 = disc_rand(yPos_A,yPos_B)
			y8 = disc_rand(yPos_A,yPos_B)
			y9 = disc_rand(yPos_A,yPos_B)
			y10 = disc_rand(yPos_A,yPos_B)
			y11 = disc_rand(yPos_A,yPos_B)

			y12 = disc_rand(yPos_A,yPos_B)
			y13 = disc_rand(yPos_A,yPos_B)
			y14 = disc_rand(yPos_A,yPos_B)
			y15 = disc_rand(yPos_A,yPos_B)
			y16 = disc_rand(yPos_A,yPos_B)
			y17 = disc_rand(yPos_A,yPos_B)
			y18 = disc_rand(yPos_A,yPos_B)
			y19 = disc_rand(yPos_A,yPos_B)
			y20 = disc_rand(yPos_A,yPos_B)
			y21 = disc_rand(yPos_A,yPos_B)
			y22 = disc_rand(yPos_A,yPos_B)
			y23 = disc_rand(yPos_A,yPos_B)
			y24 = disc_rand(yPos_A,yPos_B)

			xPos0 = xPosAll[x0]
			xPos1 = xPosAll[x1]
			xPos2 = xPosAll[x2]
			xPos3 = xPosAll[x3]
			xPos4 = xPosAll[x4]
			xPos5 = xPosAll[x5]
			xPos6 = xPosAll[x6]
			xPos7 = xPosAll[x7]
			xPos8 = xPosAll[x8]
			xPos9 = xPosAll[x9]
			xPos10 = xPosAll[x10]
			xPos11 = xPosAll[x11]

			xPos12 = xPosAll[x12]
			xPos13 = xPosAll[x13]
			xPos14 = xPosAll[x14]
			xPos15 = xPosAll[x15]
			xPos16 = xPosAll[x16]
			xPos17 = xPosAll[x17]
			xPos18 = xPosAll[x18]
			xPos19 = xPosAll[x19]
			xPos20 = xPosAll[x20]
			xPos21 = xPosAll[x21]
			xPos22 = xPosAll[x22]
			xPos23 = xPosAll[x23]
			xPos24 = xPosAll[x24]

			yPos0 = yPosAll[y0]
			yPos1 = yPosAll[y1]
			yPos2 = yPosAll[y2]
			yPos3 = yPosAll[y3]
			yPos4 = yPosAll[y4]
			yPos5 = yPosAll[y5]
			yPos6 = yPosAll[y6]
			yPos7 = yPosAll[y7]
			yPos8 = yPosAll[y8]
			yPos9 = yPosAll[y9]
			yPos10 = yPosAll[y10]
			yPos11 = yPosAll[y11]

			yPos12 = yPosAll[y12]
			yPos13 = yPosAll[y13]
			yPos14 = yPosAll[y14]
			yPos15 = yPosAll[y15]
			yPos16 = yPosAll[y16]
			yPos17 = yPosAll[y17]
			yPos18 = yPosAll[y18]
			yPos19 = yPosAll[y19]
			yPos20 = yPosAll[y20]
			yPos21 = yPosAll[y21]
			yPos22 = yPosAll[y22]
			yPos23 = yPosAll[y23]
			yPos24 = yPosAll[y24]


				wait(feedingTime)


			dequeue_stimulus (money)
			update_display ()
	queue_stimulus (money)
			
			update_display ()

			wait (random_delay2)
			
				goto (
					target = 'EndExp'
					when = timer_expired(MyTimer)
					)
				goto(target = 'checkN')	
			}


			state 'collect'{

			report('timestamp1')

			report('timestamp2')


				num_collected += 1
				///play_sound (correct_sound)
				N += 0.5
				feedStatR = 1
				feedStatG = 0
				feedStatB = 0

				///Random delay
				

				update_display ()
				

			x0 = disc_rand(xPos_A,xPos_B)
			x1 = disc_rand(xPos_A,xPos_B)
			x2 = disc_rand(xPos_A,xPos_B)
			x3 = disc_rand(xPos_A,xPos_B)
			x4 = disc_rand(xPos_A,xPos_B)
			x5 = disc_rand(xPos_A,xPos_B)
			x6 = disc_rand(xPos_A,xPos_B)
			x7 = disc_rand(xPos_A,xPos_B)
			x8 = disc_rand(xPos_A,xPos_B)
			x9 = disc_rand(xPos_A,xPos_B)
			x10 = disc_rand(xPos_A,xPos_B)
			x11 = disc_rand(xPos_A,xPos_B)

			x12 = disc_rand(xPos_A,xPos_B)
			x13 = disc_rand(xPos_A,xPos_B)
			x14 = disc_rand(xPos_A,xPos_B)
			x15 = disc_rand(xPos_A,xPos_B)
			x16 = disc_rand(xPos_A,xPos_B)
			x17 = disc_rand(xPos_A,xPos_B)
			x18 = disc_rand(xPos_A,xPos_B)
			x19 = disc_rand(xPos_A,xPos_B)
			x20 = disc_rand(xPos_A,xPos_B)
			x21 = disc_rand(xPos_A,xPos_B)
			x22 = disc_rand(xPos_A,xPos_B)
			x23 = disc_rand(xPos_A,xPos_B)
			x24 = disc_rand(xPos_A,xPos_B)


			y0 = disc_rand(yPos_A,yPos_B)
			y1 = disc_rand(yPos_A,yPos_B)
			y2 = disc_rand(yPos_A,yPos_B)
			y3 = disc_rand(yPos_A,yPos_B)
			y4 = disc_rand(yPos_A,yPos_B)
			y5 = disc_rand(yPos_A,yPos_B)
			y6 = disc_rand(yPos_A,yPos_B)
			y7 = disc_rand(yPos_A,yPos_B)
			y8 = disc_rand(yPos_A,yPos_B)
			y9 = disc_rand(yPos_A,yPos_B)
			y10 = disc_rand(yPos_A,yPos_B)
			y11 = disc_rand(yPos_A,yPos_B)

			y12 = disc_rand(yPos_A,yPos_B)
			y13 = disc_rand(yPos_A,yPos_B)
			y14 = disc_rand(yPos_A,yPos_B)
			y15 = disc_rand(yPos_A,yPos_B)
			y16 = disc_rand(yPos_A,yPos_B)
			y17 = disc_rand(yPos_A,yPos_B)
			y18 = disc_rand(yPos_A,yPos_B)
			y19 = disc_rand(yPos_A,yPos_B)
			y20 = disc_rand(yPos_A,yPos_B)
			y21 = disc_rand(yPos_A,yPos_B)
			y22 = disc_rand(yPos_A,yPos_B)
			y23 = disc_rand(yPos_A,yPos_B)
			y24 = disc_rand(yPos_A,yPos_B)


			xPos0 = xPosAll[x0]
			xPos1 = xPosAll[x1]
			xPos2 = xPosAll[x2]
			xPos3 = xPosAll[x3]
			xPos4 = xPosAll[x4]
			xPos5 = xPosAll[x5]
			xPos6 = xPosAll[x6]
			xPos7 = xPosAll[x7]
			xPos8 = xPosAll[x8]
			xPos9 = xPosAll[x9]
			xPos10 = xPosAll[x10]
			xPos11 = xPosAll[x11]


			yPos0 = yPosAll[y0]
			yPos1 = yPosAll[y1]
			yPos2 = yPosAll[y2]
			yPos3 = yPosAll[y3]
			yPos4 = yPosAll[y4]
			yPos5 = yPosAll[y5]
			yPos6 = yPosAll[y6]
			yPos7 = yPosAll[y7]
			yPos8 = yPosAll[y8]
			yPos9 = yPosAll[y9]
			yPos10 = yPosAll[y10]
			yPos11 = yPosAll[y11]




				wait(feedingTime)
		
			m += m_size
		m_string = (string)m


			dequeue_stimulus (money)
			update_display ()
	queue_stimulus (money)
			update_display ()

		       	totcir1 += cirStep


				//update_display ()
				goto (
					target = 'EndExp'
					when = timer_expired(MyTimer)
					)
				goto(target = 'checkN')				
			}

			state 'EndExp'{
 
				clear_display()
				wait (2s)

				queue_stimulus (thanks)
    			update_display ()
    			wait (3s)
    			dequeue_stimulus (thanks)

				action/wait(10s)
				yield()
			}
}
}
report ('$duration is the duration')
report ('$num_collected targets were collected')

}

Hello,

I wanted to add a state, in which no double-colored circle pops up and after a random timer, the new set of circles pops up, depending on the value of N.

I’m having trouble understanding your experiment. What is the name of the state you added?

But, while I run it, it stops and it’s not updating the display, like it’s stuck.

Does anything display, or does it get stuck immediately?

Also, the 12Distractors part brings up 24Distractors.

Well, state “12Distractors” queues and displays 25 stimuli, so that makes sense. Maybe you meant to use dequeue_stimulus on some of the stimuli?

Cheers,
Chris

The purpose of the experiment is to calculate the time of a subject to select a double-colored ball, and to make it more difficult, we add distractors (1 colored circles) + to add random timers of when the targets appear.

The state is “no collect”.
It displays some balls, but sometimes it stucks, like there is no timer.
Yes, I used “dequeue_stimulus” and it got fixed, but I am still having issues on adding the random timers on the 1 colored balls.

Thanks for the additional info.

One issue is that, in states “feeder0Empty”, “feeder1Empty”, etc., you’re using timer_expired on a variable (random_delay) that isn’t a timer. To create a timer, you need to use start_timer. If you call timer_expired with a non-timer argument, it will just pass the argument through unchanged. (Actually, this is exactly what it does for timers, too, since those are implemented as variables.) If you don’t want random_delay to be a timer, you can pass it to wait, as you already do in states “feeder0Full”, “feeder1Full”, etc.

Apart from that, I don’t see any obvious problems. Can you try fixing the waits and let me know if that resolves the issue?

Cheers,
Chris