WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-24-2009, 09:57 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Here is an example that uses the viztask module to control the timing of the 3 different functions:
Code:
import viz
import vizact
import viztask
viz.go()

def func1():
	pass
	
def func2():
	pass
	
def func3():
	pass

def MainTask():
	
	#Run func1 for 3 minutes
	timer = vizact.ontimer(0,func1)
	yield viztask.waitTime(180)
	timer.remove()
	
	#Run func2 for 4 minutes
	timer = vizact.ontimer(0,func2)
	yield viztask.waitTime(240)
	timer.remove()
	
	#Run func3 for 3 minutes
	timer = vizact.ontimer(0,func3)
	yield viztask.waitTime(180)
	timer.remove()
	
	#Quit script
	viz.quit()
	
viztask.schedule( MainTask() )
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
General question and question regarding arrays dan12345 Vizard 1 01-15-2008 10:15 AM
Timer cycling correctly? JMOwens Vizard 2 12-07-2007 09:57 AM
timer question again Elittdogg Vizard 3 10-18-2007 10:29 AM
timer question Elittdogg Vizard 5 10-10-2007 02:49 PM
Timer speed Jerry Vizard 1 12-08-2006 11:01 AM


All times are GMT -7. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC