Skip to Content
It is currently October 23rd, 2019, 11:19 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 3rd, 2014, 5:46 pm 
Offline
New User
New User

Joined: October 28th, 2006, 6:55 am
Posts: 4
hi im looking for a script that will start my encoder on the hour then stop it 5 minutes after .. I have had a quick search and found one that doesn't seem to work. I could try event scheduler but would take forever to do a 7 day a week every hour
Code:
//
// This will start and stop encoders 1 & 3 at times below
//  NOTE: Encoders are offset by 1 - So endoder #1 is really 0
//
//  by CWDJ - 11/20/10
//

Pal.WaitforTime ('08:00:00');

encoders[0].stop;
encoders[2].stop;

Pal.WaitforTime ('12:00:00');

encoders[0].start;
encoders[2].start;

that's the one I can find but doesn't work


Last edited by Mastacheata on July 3rd, 2014, 8:00 pm, edited 1 time in total.
Added CODE tags for better readability. Please use these yourself next time!


Top
 Profile  
Reply with quote  
PostPosted: July 3rd, 2014, 8:06 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7878
Location: Aachen (Germany)
This script is obviously doing the opposite of what you want to achieve.
It also runs only once and at exact times. It does not repeat.

Code:
PAL.Loop := True;

PAL.WaitForTime('XX:59:59'); // Waiting for XX:00:00 will inevitably trigger the action the moment you start the script
Encoders[0].Start;

PAL.WaitForTime('+00:05:00');
Encoders[0].Stop;

Adjust the encoder number to suit your needs or copy and adjust the line if you need more encoders to start/stop.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: July 6th, 2014, 11:49 pm 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4732
Location: Los Angeles - A Little West Of Nashville
Be advised that there is an offset of 1. So encoder[0] is encoder #1 and encoder[1] is encoder #2, etc.

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: October 9th, 2019, 1:06 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 102
Mastacheata wrote:
This script is obviously doing the opposite of what you want to achieve.
It also runs only once and at exact times. It does not repeat.

Code:
PAL.Loop := True;

PAL.WaitForTime('XX:59:59'); // Waiting for XX:00:00 will inevitably trigger the action the moment you start the script
Encoders[0].Start;

PAL.WaitForTime('+00:05:00');
Encoders[0].Stop;

Adjust the encoder number to suit your needs or copy and adjust the line if you need more encoders to start/stop.


I wrote this script based on your

Code:
PAL.Loop := True;

PAL.WaitForTime('05:59:59');
Encoders[5].Start;

PAL.WaitForTime('23:59:59');
Encoders[5].Stop;



But it loops without stopping at all
I had to modify it in the following way, to be able to use it as I wanted

Code:
PAL.Loop := True;

PAL.WaitForTime('05:59:59');
Encoders[5].Start;

PAL.WaitForTime('+18:00:00');
Encoders[5].Stop;


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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® Forum Software © phpBB Group