Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
My First Script.
This thread has 8 replies. Displaying all posts.
Post 1 made on Tuesday October 19, 2010 at 15:58
Kenzo85
Lurking Member
Joined:
Posts:
October 2010
4
Hey guys, just started with experimenting with the Philips Pronto TSU 9600 and i have some questions:

I want to turn the Lights on my Velodyne SMS-1 Equalizer, when I'm adjusting the Subwoofer Volume. I want it to be a button based script where when i push the button it first starts lighting up the DSP and there after adjusts the volume and then turn off af 3-5 seconds after release off the button.

I made this so far. And yes I'm a noob, so go easy on me.

Var SWLightsTimer, s;
SWLightsTimer = 5;
s = page("IRCODES").widget("LIGHT"); // I'm in doubt, how can I call my IR code for the SMS-1 "it's in my on database at the moment"
s.executeActions();
if (SWLightsTimer > 0)
{
SWLightsTimer--;
if (SWLightsTimer === 0)
{
s.executeActions();
}
}

Thank You in Advance.

Loads of good stuff at home.
Post 2 made on Tuesday October 19, 2010 at 18:41
2Many
Long Time Member
Joined:
Posts:
September 2009
106
Hi Kenzo

I'm not one of the forum's ProntoScript gurus, but have a look in file area for examples and docs. It's a good place to start.

There some user made XCFs available. Some of the XCFs use PS and will hopefully give you an insight on using PS.

You'll find the XCFs at this link

www.remotecentral.com/cgi-bin/files/rcfiles.cgi


Search the forum for 'Project Boredom 2" by alpha. This demo contains a wealth of scripting ideas. Recommended, certainly worth a look.


You'll find a good DEV guide and other docs at this link -

www.remotecentral.com/cgi-bin/files/rcfiles.cgi


Good luck with your scripting.

2Many
"Home" is where my Pronto is.
Post 3 made on Tuesday October 19, 2010 at 19:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Not sure I understand "my on database" but the way to execute IR codes is using Widget.executeActions() or Widget.scheduleActions() as you are doing in your script.

See the Dev Guide for explicit examples and a search of the forum for executeActions or scheduleActions will also turn up quite a few examples.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 4 made on Wednesday October 20, 2010 at 07:20
Kenzo85
Lurking Member
Joined:
Posts:
October 2010
4
Hey Guys Thank you!

Lyndel McGee-> what I meant was that I need to execute a IR code, that i've added my self, so i dont know how to "call" the IR Code with the Widget. action.
Loads of good stuff at home.
Post 5 made on Wednesday October 20, 2010 at 13:29
b00bie
Founding Member
Joined:
Posts:
July 2001
396
You create a button on a page in an activity. Add your IR code to this button. You assign ProntoScriptNames to all 3 (activity, page, button) then you do (assuming the prontoscript names are as coded below):

CF.widget('mybutton', 'mypage', 'myactivity').executeActions();
or
CF.widget('mybutton', 'mypage', 'myactivity').scheduleActions();

You invoked the same executeActions() above in your example. The method you used to retrieve the widget was different.
OP | Post 6 made on Wednesday October 20, 2010 at 15:02
Kenzo85
Lurking Member
Joined:
Posts:
October 2010
4
Hey b00bie

I'm trying to use your examble, but have some troubles "yes I'm a NOOB I know"

My Script is as follows:
______________________________________________

Var SWLightsTimer, s;
SWLightsTimer = 5;
s = CF.widget(''SWLights', 'MyPage', 'MyActivity').executeActions();
s.executeActions();
if (SWLightsTimer > 0)
{
SWLightsTimer--;
if (SWLightsTimer === 0)
{
s.executeActions();
}
}
____________________________________________________________

My Activity is labelled with TEST, but i've name the activity pronto script name: MyActivity.
My page is labelled TEST1 and the pronto script is named MyPage "it's here i'm trying to use the script from above.
I liked it to use the Repeat every 1 sec until I've mastered the ScheduleActions function.
Loads of good stuff at home.
Post 7 made on Wednesday October 20, 2010 at 16:43
b00bie
Founding Member
Joined:
Posts:
July 2001
396
Where is the above code running? In a button or in a page?

If you are trying to use the repeat interval on a page script, you should declare the variable SWLightsTimer at the activity level and assign it a value of -1.

Then, add code to your page script to check to see if timer is equal to -1 and assign an initial value of 5.

Then do the things you want.

However, from a Page script, you should be using scheduleActions and not executeActions as there can be problems with this (The old Prontoscript FAQ on Philips site referenced this).

Also, have you worked through the examples in the Dev Guide?

P.S. This is Lyndel signed @ Boobie's in New York.
OP | Post 8 made on Thursday October 21, 2010 at 02:59
Kenzo85
Lurking Member
Joined:
Posts:
October 2010
4
Hey B00bie

The script is running in the Page "TEST1" so you recommend that I should use the ScheduleActions(); command instead?

Well I'm trying to use the examples from the dev guide, but the I find them to be not working or I'm doing something wrong. Could you fx. give me a small example in a xcf. on how I'm using a Widget.

I tried use the CF.widget command and used the parameters you showed me.

Thank you for your patience. In the meantime I've read further in the dev guide.
Loads of good stuff at home.
Post 9 made on Thursday October 21, 2010 at 09:37
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Kenzo,

It was not Boobie to whom you were speaking. It was Lyndel who did not want to disturb the login priviledges on Boobie's borrowed computer. I don't have full context of what you are trying to do at this time other than what appear to be the intentions of the script you have written.

You should NEVER use executeActions from a page script, always use scheduleActions().

I would love to accommodate your request I am out of town and don't have access to my own computer with all my tools to "whip up a script" for you.

Working through the examples in the Dev Guide should help to point you to your problem. Don't just read the dev guide, you will also want to work through the examples such as the light timer example.

The examples will likely give you a better understanding and hopefully help you find the thing you are missing.

It is not obvious to me what you are doing incorrectly other than not declaring the variable SWLightsTimer at the activity level versus at the page level. If you don't follow why this is necessary, you may want to have a look at the section of the Dev Guide on Scopes.

Also, you may want to use System.print, Diagnostics.log, and try/catch (discussed quite a few times by me as a debugging tools) to help isolate where the problem is.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse