Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:35 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Scripting = Chinese language
PostPosted: June 9th, 2013, 4:20 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Hello All…

I’m trying to adjust a script to work for me. I created a recipe book program and I need a timer for it. I found a timer script on here and it’s almost perfect. It was written by Sandlyn (Sandy). It is a timer and will work for what I need but there are a couple of things I need to add to it, but I have worked on this for two days with very little if any progress. When the script gets to the end, or I should say, when the clock is through running and gets to zero, I need for it to trigger another button which will play a sound and write something on the screen like Time’s Up, or Your bird is cooked. However, I have obviously tried everything but the correct thing.

There is a "START" button and the script is in two parts. The first part is…
--------------------------
On Left Mouse Click -
<script>
myClock.Stop()
clock_var=0
myClock.Start()
-------------------------------

below that there is a Ticker set to 0.01s -
<script>
Mins=String.number((clock_var.toString()).charAt(4))
Tens=String.number((clock_var.toString()).charAt(6))
Secs=String.number((clock_var.toString()).charAt(7))
Hun=String.number((clock_var.toString()).charAt(10))
Tenths=String.number((clock_var.toString()).charAt(9))

ClockSecs=(Mins*60)+Secs+(Tenths/10)+(Hun/100)
TimeLeft=Countdown-ClockSecs
if(TimeLeft<=0)
{
myClock.Stop()
}
----------------------------

What I am trying to accomplish is after the clock has stopped to trigger this…
hiddenbutton.Show()

One of the many things I’ve tried is this…
If(myClock.Stop()
{
hiddenbutton.Show()
}

But all that does is make the hidden button show immediately. If someone has a moment, please let me know what I’m doing wrong (or) even better, show me what to do right.

Once I get that fixed, I’m going to try and get it where instead of seconds, the user will be able to add hours and minutes instead. Most cooking is done in hours and minutes and not seconds.

If anyone is willing to share their profound knowledge of scripting it will certainly be most appreciated. I’m 65 now and estimate that I will be efficient in scripting when I’m about 90.

Dennis Pitts

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 9th, 2013, 8:49 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Have you tried:
Code:
TimeLeft=Countdown-ClockSecs
if(TimeLeft<=0)
{
myClock.Stop()

wait(0.1)
hiddenbutton.Show()
}

Quote:
I need for it to trigger another button which will play a sound and write something on the screen like Time’s Up, or Your bird is cooked.
For this I would try a OnShow Trigger (in standard actions for example)... or in scripting
Code:
if ( hiddenbutton.IsShowing() == true )
{
//place your play sound actions here
}

If you are going to use that multiple times, then you need to Hide that button again and repeat for next timer. Of course, you could make the routine be contained in a scripted function, and then just call it when needed. If you have the User click to acknowledge the timer's end, then that could hide the button.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 9th, 2013, 9:24 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Thanks for answering Lar...

That is one of the variations I had tried... but using it this way causes the hidden button to show before the clock has finished running or I should say reaches zero.

--------------------------------------
TimeLeft=Countdown-ClockSecs
if(TimeLeft<=0)
{
myClock.Stop()

wait(0.1)
hiddenbutton.Show()
}
--------------------------------------

What seems to be happening is that it waits 0.1 seconds and then shows the hidden button.

I have a button called hiddenbutton which is set to be initially hidden. Once shown it will play a tune and print text on the screen. It works well, but that problem is, as soon as I launch start the clock the hidden button shows and plays the sound and shows the text. I was somewhat surprised to see that this did not work, but I am not a scripting person.

Bottom line is that I need for the clock to finish before the hidden button is shown…

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 10th, 2013, 9:35 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
but that problem is, as soon as I launch start the clock the hidden button shows and plays the sound and shows the text. ...Bottom line is that I need for the clock to finish before the hidden button is shown…
Sounds like a control problem -- something in the logic that is not controlling the subsequent actions. ???? You could set up something to monitor the state of the alarm audio (or User intervention).

One alternative is to go to next Page or open a separate Opus Window when the Clock runs out... and control things from there. (what I am thinking is that Opus has some nuances around the clock function... about leaving the Page and returning -- so that could help as a way of resetting the clock issue)

Quote:
below that there is a Ticker set to 0.01s -
I doubt you need that much timer resolution. But how is that implemented in script?

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 10th, 2013, 10:14 pm 
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
I'm wondering if something else is triggering the hidden button show action.

Is your script the only thing that triggers it? Are there other show scripts operating on your page?

I would recheck the hidden button properties to make sure it is hidden and check to make sure the various mouse actions do not inadvertantly have a show action.

Good luck with this

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: Scripting = Chinese language
PostPosted: June 14th, 2013, 7:28 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Lar and Graham. Thank you both for taking the time to answer my post. I just spent 30 minutes answering every question or comment, but when I click on "Preview" it took me to a page that said... "Internet explorer cannot display this page." When I clicked to go back it had wiped out everything I had written. I have a trouble ticket into DigitalWork now.

I have edited what I wrote earlier so I could add the text below...

How about a little help guys… I need a very simple countdown counter, no count up, just countdown only. Show me how and I promise I’ll learn from it. This is what I am trying to accomplish.

A script for… (This is a countdown timer for cooking)

(1) a text box (variable) to put in how many Hours the clock should run.
(2) a text box (variable) to put in how many Minutes the clock should run.
(3) I would like to have seconds show on the screen, but just to let the user know at a glance that it’s running, but not have a field to put seconds into like the hrs. & min.
(4) Make a button show. (I’ll have a hidden button which will play a tune and show a hidden text field.
(5) Make sure that the hiddenbutton.Show() does not show until the clock reaches (0 hours) and (0 minutes) and (0 seconds)

That’s it very simple yet I have not been able to make it work…

It is very nice of people who can write script, take the time to show others how to do things, but in my case you’re showing me 3rd year algebra when I’m still learning 9th grade math. As a result I haven’t been able to pick out the something simple to use because it does more than I need for it to, and doesn’t do what I do need.

Lar, I downloaded your Countdown Timer this after noon. It was the perfect case in point. I have worked on this for a week now with very little progress. I can never get everything working right. If you write this very simple script for me and place it in the tutorials people will understand how… better. Maybe it’s me. You guys are teaching seniors in college and I’m still in high school… (that was a metaphor, I really did finished college)

Thank you both for taking the time to try and help me. It is most appreciated!

It will look like this...

MAIN SCREEN WITH TIMER ICON (icon would be available in several locations)
Image

TIMER SCREEN 1
Image

Once the start button is pushed then the first screen will be replaced with the second timer screen.

TIMER SCREEN 2
Image

Thanks again guys. Once I get the countdown timer to working I feel it will greatly enhance the program...
Dennis Pitts…

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 15th, 2013, 1:02 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
guys… I need a very simple countdown counter
Denn, it's late here now... I'll get back to this hopefully later in the weekend.

My experience with timer scripts is that they are relatively simple by the time you get to the result you want. Getting there is another thing :wink:
Some of it is figuring out 59 minutes or 60 minutes in relation to the seconds. Other things to fiddle with are the display and formatting.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 15th, 2013, 5:12 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Thank you Lar... I wish there was some way I could show you my appreciation. If I had money I would pay you, but I don't. I'm retired and my social security check is barely enough to pay the bills every month. Do you have a website that I can link to within the recipe book? I would certainly like to give you credit.

Also please note that when I said all I need is a simple countdown timer, I did not mean that it would be simple to write. Trust me, I have spent days working on it without success. What I meant was that I didn't need the bells and whistles that all of the other counters seem to have.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 15th, 2013, 5:52 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
A rough and ready countdown.

Mack


You do not have the required permissions to view the files attached to this post.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : jmateus


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 15th, 2013, 9:21 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
mackavi wrote:
A rough and ready countdown.

Mack



PERFECT As usual.

Thank you very much Mack. I have already inserted it into my program and it couldn't be any better... Thanks also for showing me exactly where to put my hiddenbutton to show.

If you would like to see what I did with your script you can download it here...
http://planetdenn.com/pd-RecipeBook/pd-RecipeBookTimer.exe
I still have a help screen / credit screen to add, but it is fully functional like it is... Thanks again Mack...

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 17th, 2013, 10:36 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Denn,
Glad you got it working... definitely Mack is the go-to guy.

Now all you have to do is give the user multiple cooking and prep timers, progress bars, and synch that all to correlate display with a real time clock. :)

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : Denn, mackavi


Top
 Profile  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 19th, 2013, 8:07 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Denn,

Glad it works. Just one suggestion - why not use a more realistic digital clock font -

http://www.1001fonts.com/digital+clock-fonts.html

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: June 21st, 2013, 12:37 am 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Mack,

I had not finished the Timer when I first posted it, and then my site was down for a couple of days. My intentions were to use the digital font I had used on the screenshots above. Also at that point I had not inserted a help page, though I do have a help page for the Timer within my pd-RecipeBook program. If you download the updated version, or just click on run after clicking the link...
http://planetdenn.com/pd-RecipeBook/pd-RecipeBookTimer.exeYou can see the changes. This is of course ver 1, and I'm sure I'll add to it later. Thanks again for your help. (help screen access is a ? mark in the lower right hand corner of both screens. The help will show even if the clock is running...

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Scripting = Chinese language
PostPosted: November 13th, 2013, 9:31 pm 
Offline

Joined: May 31st, 2011, 11:20 pm
Posts: 37
Opus: Pro 09
OS: XP Pro
System: Various systems
Disregard


For this message jmateus has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 24 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group