Reopen mp on idle ::: 1.1.2 ::: 14-11-2010 (1 Viewer)

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Hey all,

I kinda wanted some functionality to reopen MP (minimized to tray) after some amount of user inactivity (if it was not already open ofcourse). Tried to accomplish something like this with task scheduler and a batch but couldn't get it right.
So I decided to give it a go with AutoIt instead and now I have a working solution. You can run the attached file on system start (or use something like firedeamon to create a service out of it). It will check every configurable amount of time for the following 3 conditions;

- Is MP open?
- Has there been user activity over the last period (configurable)
- Is another app running fullscreen?

if mp isn't open, there's no user activity and no app running fullscreen the script will launch MediaPortal.exe making mediaportal open full screen again. Came in handy for me, some of you might like it as well so I thought I'd share.

You can edit the provided ini file to adjust 3 settings;
pollInterval: The interval in which the script will check for the conditions, in milliseconds
idleTimerInterval: The idle time amount that triggers this script, in miliseconds
mpExe: The absolute path to the mediaportal executable

p.s.
The source is included in the zip, just a few autoit lines of code.
 

Attachments

  • Reopen_mp_1.1.2.zip
    548.7 KB

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: Small restart mp script on idle

---UPDATE---

Version 1.1 includes check for full screen app running, so this adds another condition and won't run MP if fullscreen.
The way this is handled is by retrieving the screen res and checking if the active window is the same size.

---UPDATE2---

Added comments and small speed optimizations in 1.1.1.
 

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: Reopen mp script on idle

I've done another AutoIt script to automate my NAS.
It will check for bandwidth usage between timeintervals (configurable with variable) and when the bandwidth (either upload or download or both, configurable with a variable) drops below a threshold it will call a shutdown command. The script also logs it's actions.
It's not bug free yet but will post when it is all done, probably a new thread.
 

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: Reopen mp script on idle

Update 1.1.2 is attached to the fipo.
The only new thing in this release is that the settings are now hold inside a ini file so people do not need to recompile if they want to change the settings of this script.

p.s.
When you want to compile this script yourself you will need the AssocArray.au3
 

Users who are viewing this thread

Top Bottom