Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 2nd, 2024, 5:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Why is this timer going 1 minute longer than it should/
PostPosted: July 17th, 2012, 8:27 pm 
Offline

Joined: January 6th, 2005, 8:56 pm
Posts: 330
Location: Houston, Republic of Texas
Opus: 8
OS: W7 Pro
System: Dell Precision T5500, 8 core Dual Xeon 2.13 GHz, 24 GB RAM, All SSD drives
Perhaps this should be "advanced" but I feel anything but "advanced."

I cannot figure out why this script is running one minute longer than it's set for. If I enter "2" in the "cd" variable, it runs for 3 minutes. Gotta be simply but it is eluding me... My guess is that the wait(60) is going one too many times, but since it should be controlled by the "cd" variable it just doesn't make sense to me.

cd=2
cdsec=58
Take_seats.Hide()
MinCount.Show()
break_time.Show()
frame_arrow.Rotate(360, 120, false)

while (cd>1 && cd_stop==0)
{
wait(60)
cd--
}

if (cd==1)
{
minutes.Hide()
MinCount.Hide()
break_time.Hide()
Take_seats.Show()
SecCount.Show()
}

while (cdsec>0 && cd_stop==0)
{
wait(1)
cdsec--
}

if (cdsec==0)
{
var kalimba = OpenSound("kalimba")
wait(1)
kalimba.Play(1,100,true)
wait(2)
kalimba.Play(1,100,true)
wait(5)
Breaktimer.Hide()

_________________
An objective is a description of a performance you want your learners to be able to exhibit before you consider them competent.
Dr. Robert F. Mager, 1962

"If you can't measure it, it's crap."
David A. Mallette, 1980


For this message Mallette has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Why is this timer going 1 minute longer than it should/
PostPosted: July 18th, 2012, 6:21 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Hi Mallette

Disclaimer: I don't understand the script

Just a quick thought occurred to me - you've probably already tried this but just in case you haven't

Can you change the wait variable to say 21 seconds or something silly?

Then you can test to see if the one minute longer holds true.

If the minute longer remains unchanged then it is hard to see the wait variable causing this problem.

Good luck

Graham

_________________
Too much coffee can result in frequent toilet breaks!


For this message Graham Baglin has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Why is this timer going 1 minute longer than it should/
PostPosted: July 18th, 2012, 6:34 pm 
Offline

Joined: January 6th, 2005, 8:56 pm
Posts: 330
Location: Houston, Republic of Texas
Opus: 8
OS: W7 Pro
System: Dell Precision T5500, 8 core Dual Xeon 2.13 GHz, 24 GB RAM, All SSD drives
Okies, Graham and all.

I was about to upload the pub and I suddenly figured it out. Indeed, it was as simple as I am...

I was failing to reset the "cd" variable when it hit "1" to 0, resulting in an extra minute when added to the "cdsec" decrement of 58 seconds duration.

Dave

_________________
An objective is a description of a performance you want your learners to be able to exhibit before you consider them competent.
Dr. Robert F. Mager, 1962

"If you can't measure it, it's crap."
David A. Mallette, 1980


For this message Mallette has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group