Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

System.Idle timers

If you have a question or need help, this is the place to be.
Post Reply
Sickan
Posts: 2
Joined: Mon Jan 18, 2016 3:44 pm

System.Idle timers

Post by Sickan »

Hi there EventGhosters! I'm new to EG and would like some pointers for a macro.
How would I make something like this:

Code: Select all

When I've activated the macro:
If System.Idle for 5 minutes: lower System.Volume by x%.
If System.Idle for another 2 minutes: play a sound.
If System.UnIdle within theese 7 minutes: restart macro.
If System.Idle for another 3 minutes: activate another macro. If System.UnIdle within theese 3 minutes, restart macro.
Thanks in advance!
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: System.Idle timers

Post by Pako »

There are many people who can do it. This is a pretty simple thing.
It seems that they do not have time right now, so I'll do it.
You need to add plugin Timer to your configuration.
The entire solution is as follows:
IdleMadhouse.png
IdleMadhouse.png (19.12 KiB) Viewed 2209 times
You can copy the code below and paste into your configuration tree.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1710">
    <Folder Name="IdleMadhouse" Expanded="True">
        <Macro Name="Timer: Start 4-min timer" Expanded="True">
            <Event Name="System.Idle" />
            <Action>
                Timer.TimerAction(u'Idle5min', 0, 1, 240.0, u'Idle5min', False, True, 1, u'00:00:00')
            </Action>
        </Macro>
        <Macro Name="Timer: Abort 4, 2 and 3 minute timers" Expanded="True">
            <Event Name="System.UnIdle" />
            <Action>
                Timer.TimerAction(u'Idle5min', 4, 1, 1.0, u'', False, True, 1, u'00:00:00')
            </Action>
            <Action>
                Timer.TimerAction(u'Idle2min', 4, 1, 1.0, u'', False, True, 1, u'00:00:00')
            </Action>
            <Action>
                Timer.TimerAction(u'Idle3min', 4, 1, 1.0, u'', False, True, 1, u'00:00:00')
            </Action>
        </Macro>
        <Macro Name="Change Master Volume and start 2-min timer" Expanded="True">
            <Event Name="Timer.Idle5min" />
            <Action>
                System.ChangeMasterVolumeBy(-5.0, u'Primary Sound Driver')
            </Action>
            <Action>
                Timer.TimerAction(u'Idle2min', 0, 1, 120.0, u'Idle2min', False, True, 1, u'00:00:00')
            </Action>
        </Macro>
        <Macro Name="Play Sound: " Expanded="True">
            <Event Name="Timer.Idle2min" />
            <Action>
                Timer.TimerAction(u'Idle3min', 0, 1, 180.0, u'Idle3min', False, True, 1, u'00:00:00')
            </Action>
            <Action>
                System.PlaySound(u'C:\\Windows\\Media\\Alarm02.wav', 1, False)
            </Action>
        </Macro>
        <Macro Name="Another macro" Expanded="True">
            <Event Name="Timer.Idle3min" />
            <Action>
                EventGhost.ShowOSD(u'10 minutes of calm elapsed', u'0;-64;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (237, 126, 245), (0, 0, 0), 4, (0, 0), 0, 30.0, True)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Note:
I noticed that according to your specifications, it may happen that after a few unfinished cycles, the volume can go to zero, so in fact the sound will not be heard.

Pako
You know flattr ? You can Image
Sickan
Posts: 2
Joined: Mon Jan 18, 2016 3:44 pm

Re: System.Idle timers

Post by Sickan »

Thanks a lot Pako! Works wonders!
Post Reply