Thread: waitDirector
View Single Post
  #1  
Old 07-07-2010, 11:37 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
waitDirector

Dear users,

I'm running a series of experiment in which I have to run several functions in succession as trials. I'm trying to use the waitdirector command to do this at the moment

Code:
def runtrials():
	global currentTime
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
	currentTime=viz.tick()
	wedgemake()
	movewedge1(); print '1'
	yield viztask.waitDirector(movewedge1)
	movewedge2(); print '2'
	
viztask.schedule(runtrials())
So in the above example I want it to run wedgemake, and movewedge1 in quick succession and then run movewedge2 once movewedge1 has finished. At the moment movewedge1 and movewedge2 keep running at the same time.

I've previously got round the issue by using waittime commands within a loop which selects trials (as I know how long the trials will be). However, I would like to avoid doing this in this experiment.

Can anyone off advice on the waitDirector command?

Many thanks
Reply With Quote