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.

Re: dialog box prompt on host pc

If you have a question or need help, this is the place to be.
Post Reply
darkflare
Posts: 1
Joined: Mon May 31, 2010 9:04 pm

Re: dialog box prompt on host pc

Post by darkflare »

Hi

Is there an action that will prompt the user on the computer to enter a value, or a yes or no answer to a question? I am trying to create an action that will sleep the computer if its not being used at a set time. If it is actively being used then the user should type in yes. if not the computer will go to sleep and stop wasting power.

The reason is I use the pc as an alarm clock and want it to shut down at 9 if I forget to turn it off manually. Im unsure if the inactive "goto sleep" will take into account music being played.

Darkflare
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: dialog box prompt on host pc

Post by topix »

One way could be to add the desktop remote plugin and use these macros (copy&paste to your configuration after adding desktop remote plugin):

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1397">
    <Folder Name="Sleep-Timer" Expanded="True">
        <Macro Name="Req" Expanded="True">
            <Event Name="sleep-time-reached-event" />
            <Action>
                DesktopRemote.CreateNew(100, 40, 10, 10, 20, (108, 108, 108), (255, 255, 255), (78, 78, 78), u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial', u'Sleep-Timer', 0, True, True, True)
            </Action>
            <Action>
                DesktopRemote.AddButton({'width': 210, 'event': u'', 'label': u'Shutdown?'})
            </Action>
            <Action>
                DesktopRemote.StartNewLine(0)
            </Action>
            <Action>
                DesktopRemote.AddButton({'backgroundColour': (176, 0, 0), 'event': u'yes', 'label': u'yes'})
            </Action>
            <Action>
                DesktopRemote.AddButton({'event': u'no', 'label': u'no'})
            </Action>
            <Action>
                DesktopRemote.Show(50, 50, True)
            </Action>
        </Macro>
        <Macro Name="Shutdown" Expanded="True">
            <Event Name="DesktopRemote.yes" />
            <Action Name="Shutdown">
                EventGhost.Comment()
            </Action>
            <Action>
                DesktopRemote.Close()
            </Action>
        </Macro>
        <Macro Name="Don't Shutdown" Expanded="True">
            <Event Name="DesktopRemote.no" />
            <Action Name="Don't Shutdown">
                EventGhost.Comment()
            </Action>
            <Action>
                DesktopRemote.Close()
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Post Reply