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.

Wait for an event instead of "Wait some time"

If you have a question or need help, this is the place to be.
Post Reply
woggy
Posts: 40
Joined: Sun May 02, 2010 2:06 pm

Wait for an event instead of "Wait some time"

Post by woggy »

First I like to point out I'm no programmer.

Can someone help me with a script to wait for en event:
Task.Activated.putty
And if it has vent 10 seconds without an event to end the macro.

The reason for this is that I use the same Eventghost profile on 3 computers, and all of the takes a different time to start programs.
And instead of waiting the longest time needed it would be nice to wait for the event "Task.Activated.putty" instead.

Any ideas?

This is my macro for login to my Linux server from Putty:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1462">
    <Macro Name="Putty" id="133" Expanded="True">
        <Event Name="DesktopRemote.Putty" />
        <Action>
            EventGhost.Wait(0.20000000000000001)
        </Action>
        <Action>
            System.Execute(u'C:\\Users\\Woggy\\Desktop\\putty.exe', u'', 0, False, 2, u'')
        </Action>
        <Action>
            EventGhost.Wait(0.59999999999999998)
        </Action>
        <Action>
            Window.SendKeys(u'{Tabulator}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Tabulator}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Tabulator}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Tabulator}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Down}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Down}', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Return}', False)
        </Action>
        <Action>
            EventGhost.Wait(0.59999999999999998)
        </Action>
        <Action>
            Window.SendKeys(u'Password', False)
        </Action>
        <Action>
            Window.SendKeys(u'{Return}', False)
        </Action>
    </Macro>
</EventGhost>
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Wait for an event instead of "Wait some time"

Post by Bartman »

The find window action allows to wait for a window to appear.
You could also enable another macro which then does what you want.

For the specific case the best solution would be to look into key file authentication for a complete automatic login without any keyboard emulation
Diabl0570
Posts: 30
Joined: Sun Feb 28, 2010 6:05 pm

Re: Wait for an event instead of "Wait some time"

Post by Diabl0570 »

in putty you can use parameters to login into putty:
make a shortcut somewhere and point it to putty.exe:

Code: Select all

"C:\Users\PC\Desktop\putty.exe [email protected] -pw password"
root= username
192.168.1.75 = Ip Adres
password = password
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Wait for an event instead of "Wait some time"

Post by jinxdone »

You should use SSH pre shared key authentication instead.

http://the.earth.li/~sgtatham/putty/0.5 ... pter8.html
woggy
Posts: 40
Joined: Sun May 02, 2010 2:06 pm

Re: Wait for an event instead of "Wait some time"

Post by woggy »

tnx for all the answers!
Post Reply