topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday October 31, 2024, 7:08 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Timer to run app at random time within a given period each day  (Read 24630 times)

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Hi,

This is the first time I've used this forum (recommended by a Lockergnome forum user), so here goes.....

I'm looking for a way to run a program at a random time within a given period each day. I've searched the web but I can't find anything suitable

The user would supply the time of the start of the period, the time of the end of the period and the path/name of the program to rum.
So for example, if the start time was 1am and the end time was 5am, the "timer" software would run the given programme once a day, at some random time between 1 and 5am, with the time that the program runs being different each day

It doesn't need a fancy interface - just a functional program which isn't user hostile.

Also, the definition of "random" is fairly loose. I gather that Excel uses a formula like
random_number=fractional part of (9821 * r + 0.211327),
where r = the previous random number
The results of this are random enough for most everyday purposes.

Any programmers feel like taking up the idea?

Thanks in advance

Tony
« Last Edit: March 31, 2006, 08:24 AM by brotherS »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
i really like this idea - hopefully skrommel will see it and come up with something.

PhilKC

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 117
    • View Profile
    • BlueScreenOfDeath.co.uk
    • Donate to Member
Ok, done the app, just need to make a GUI that can actually be used :)
It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Thanks PhilKC,
I'll look forward to seeing the result
Cheers
-Tony

PhilKC

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 117
    • View Profile
    • BlueScreenOfDeath.co.uk
    • Donate to Member
Done!
http://tanyvska.co.uk/DC  ('Till I get my space here sorted out smiley)
Yours is the 'RRunner.exe and .jpg'
Bugs? Suggestions? Shout them out :)
You will need the latest .NET 2 framework (Use windows update if you don't already)
It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
by the way here is the download for MS .NET2 runtimes:
http://www.microsoft...5&DisplayLang=en

these could be useful for other programs so definitely worth installing.

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Thanks Mouser,
Microsoft don't exactly make it easy to find.

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Hi PhilKC,

I've installed the program and tried it briefly with a short time period. It seems to work very well so far. I'll try it over the next few days and let you know how things go.

I have a few questions and observations:

I can run more than one copy of the timer simultaneously, to run different programs or the same program more than once, but are there likely to be any problems or conflicts if I do this?

I've set up my computer to switch itself on using the BIOS timer and switch itself off using a shutdown utility. Inbetween it runs various calculation, download and housekeeping tasks under timer control. I'd like to get RRunner to load from the startup group minimised to the system tray, ready to run it's program at some random time. However, RRunner doesn't seem to save the details of the time period and application.
Could the program be made to read a configuration file containg the time period and application path-name (ideally plain text) by using a switch after the program name. That way I could get RRunner to load and run completely automatically or get two instances of RRunner to run different programs at random times automatically.
Also if I set the program to run minimised it minimises to the task bar as well as the system tray. Could the program be set up to (optionally) run already minimised to the system tray?

Does leaving the programme running use up many system resources?

Cheers

Tony

PhilKC

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 117
    • View Profile
    • BlueScreenOfDeath.co.uk
    • Donate to Member
I can run more than one copy of the timer simultaneously, to run different programs or the same program more than once, but are there likely to be any problems or conflicts if I do this?

Nope :)

I've set up my computer to switch itself on using the BIOS timer and switch itself off using a shutdown utility. Inbetween it runs various calculation, download and housekeeping tasks under timer control. I'd like to get RRunner to load from the startup group minimised to the system tray, ready to run it's program at some random time. However, RRunner doesn't seem to save the details of the time period and application.
Could the program be made to read a configuration file containg the time period and application path-name (ideally plain text) by using a switch after the program name. That way I could get RRunner to load and run completely automatically or get two instances of RRunner to run different programs at random times automatically.
Also if I set the program to run minimised it minimises to the task bar as well as the system tray. Could the program be set up to (optionally) run already minimised to the system tray?

I'll work that in soon, something like:    RRunner /m -sh:12 -sm:30 -eh:13 -em:45 -ap:C:\Program Files\Azureus\Azureus.exe
Would: Start minimised, the start range would be 12:30 - 13:45 and the program, Azureus :)

Does leaving the programme running use up many system resources?

Minimal, It's Visual C++ .NET, it may appear to use chunks of memory, but, this is due to the way .NET handles memory :)

Glad you're happy with it so far :D

PhilKC
It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Hi PhilKC,

Your suggestion for start up settings would be fine - I'll look forward to seeing version 1.1

Cheers

Tony

PhilKC

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 117
    • View Profile
    • BlueScreenOfDeath.co.uk
    • Donate to Member
Done! Complicated syntax, but, that's what the GUI is for, right?


RRunner 1 12 30 13 45 C:\hello.exe

Means:
1 == Start silently (0 for normal)
12 == Start Hour
30 == Start Minute
13 == End Hour
45 == End Minute
C:\hello.exe == Application Path

If you use one, you need to use them all :)

Have fun, go grab 1.1 from http://tanyvska.co.uk/DC

PhilKC
It's not a bug, it's an undocumented and unexplainable feature.
Stick it on your site:

jovejupiter

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 27
    • View Profile
    • Donate to Member
Thanks,

I'll try it out over the next few days with a macro that saves a file as part of the process. That way I can use the timestamps to see what times it runs the program.

Cheers

Tony