WorldViz User Forum stopping a sequence
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

#1
04-14-2009, 11:34 AM
 durf Member Join Date: Feb 2009 Posts: 61
stopping a sequence

HI,

This is the code Im running:

Code:
```def moveFlowers():

x,y,z = ball1.getPosition()

if  x <= -12 and x >= -10:

goto1 = vizact.sequence(vizact.goto(-11,10,-10,5),vizact.waittime(2),vizact.goto(-11,5,-10,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(-11,15,-10,5),vizact.waittime(2),vizact.goto(-11,6,-10,6),vizact.waittime(2))
middle1.runAction(goto1)
top1.runAction(goto2)

elif x <= -11 and x >= -13:

goto1 = vizact.sequence(vizact.goto(-12,10,25,5),vizact.waittime(3.5),vizact.goto(-12,5,25,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(-12,15,25,5),vizact.waittime(2),vizact.goto(-12,6,25,6),vizact.waittime(2))

elif x <= -10 and x >= -8:

goto1 = vizact.sequence(vizact.goto(-9,10,22,5),vizact.waittime(3.5),vizact.goto(-9,5,22,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(-9,15,22,5),vizact.waittime(2),vizact.goto(-9,6,22,6),vizact.waittime(2))

elif x <= 1 and x >= -1:

goto1 = vizact.sequence(vizact.goto(0,10,28,5),vizact.waittime(3.5),vizact.goto(0,5,28,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(0,15,28,5),vizact.waittime(2),vizact.goto(0,6,28,6),vizact.waittime(2))

elif x <= 8 and x >= 6:

goto1 = vizact.sequence(vizact.goto(7,10,25,5),vizact.waittime(3.5),vizact.goto(7,5,25,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(7,15,25,5),vizact.waittime(2),vizact.goto(7,6,25,6),vizact.waittime(2))

elif x <= 13 and x >= 11:

goto1 = vizact.sequence(vizact.goto(12,10,29,5),vizact.waittime(3.5),vizact.goto(12,5,29,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(12,15,29,5),vizact.waittime(2),vizact.goto(12,6,29,6),vizact.waittime(2))

elif x <= 17 and x >= 15:

goto1 = vizact.sequence(vizact.goto(16,10,-10,5),vizact.waittime(3.5),vizact.goto(16,5,-10,6),vizact.waittime(2))
goto2 = vizact.sequence(vizact.goto(16,15,-10,5),vizact.waittime(2),vizact.goto(16,6,-10,6),vizact.waittime(2))

timer5 = vizact.ontimer2(0,viz.FOREVER,moveFlowers)
timer5.setEnabled(viz.OFF) # I enable it from else where```
When the ppt sensors x position is true to one of the if statements the sequence runs. When I move the ppt sensor away from that x position, which would then make that if statement false, the sequence continues to run. I even tried putting 0 repeats at the end of the sequence but it keeps running like its in a loop. how do I get this so it runs once everytime the x position is true with the if statement and not in a loop.

 Thread Tools Display Modes Rate This Thread Threaded Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post jaclyn.bill Vizard 3 10-18-2007 08:19 AM vsully Vizard 1 01-24-2006 01:43 PM pkhoosh Vizard 2 01-23-2006 08:03 AM vsully Vizard 1 01-12-2005 09:02 AM shai Vizard 1 10-27-2004 10:09 AM

All times are GMT -7. The time now is 08:20 AM.

 Contact Us - WorldViz Home - Archive - Top