Author Topic: Eventghost controlling mouse and keyboard in place of an XBMC plugin for NBA TV  (Read 9031 times)

0 Members and 2 Guests are viewing this topic.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile


Just a quick demonstration of having Eventghost load a web page, mouse to the right place and logon to nba.com to play NBA live TV.  In the absence of a proper XBMC plugin for streaming NBA TV this seemed like a good idea.

Once I'd sussed out that Eventghost hates long strings of requests this was actually a very straight forward thing to do.

There are probably slicker ways of doing this, and if anyone can make one happen then I'm all ears :)

Cheers,

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
hi Paul

Nice Demo.
Quote
There are probably slicker ways of doing this, and if anyone can make one happen then I'm all ears

i would have approached it a different way.

1. Use VoxCommando to open the webPage url and fill in the user details and press login using mouse keyboard actions (Only a theory).
2. Use AutoIt to accomplish the same (more difficult) and get VoxCommando to execute the compiled AutoIt  exe.

Some of my thoughts.
Neural Net Based Artificial Intelligence.

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Did you have a look at the RoboBrowser plugin? Unfortunately i still could not find enough time for taking a closer look to it, but i think James developed it for cases like this.
But nevertheless: nice work!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
RoboBrowser would be ideal for this in theory, but I don't know if it would be able to handle the fullscreen video aspect or not.  I'd have to try it.

If I understand correctly Mr. Wolf, you've basically done everything in eventGhost and are simply triggering the event from VC?  Could you upload your EG code?  You can just copy your macro in eventghost using ctrl-c and then paste it into the forum using the
Code: [Select]
code tags.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Good day gents,

Mij, if you could give me instructions if you think your way would be more efficient then as always I would be in your debt. 

Not seen Robobrowser plugin, but it sounds like something I would like!

James, I did everything in Eventghost.  As with previous things it's only because I'm more familiar with it.  I've found VOX is a far more stable application and if I knew quickly how to get VOX to do it then I most certainly would have done.  Assuming I've done this right, below is the Eventghost stuff...


Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1582">
    <Folder Name="Watch basketball">
        <Macro Name="Open login panel" Expanded="True">
            <Event Name="Broadcast.Watch basketball" />
            <Action>
                System.Execute(u'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe', u'', 2, False, 4, u'', False)
            </Action>
            <Action>
                EventGhost.Wait(3.0)
            </Action>
            <Action>
                Mouse.MoveAbsolute(990, 135, None, False)
            </Action>
            <Action>
                EventGhost.Wait(1.0)
            </Action>
            <Action>
                Mouse.LeftButton()
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'Main.Cick in password screen', 0.0)
            </Action>
        </Macro>
        <Macro Name="Click in password screen" Expanded="True">
            <Event Name="Main.Cick in password screen" />
            <Action>
                EventGhost.Wait(3.0)
            </Action>
            <Action>
                Mouse.MoveAbsolute(750, 250, None, False)
            </Action>
            <Action>
                EventGhost.Wait(1.0)
            </Action>
            <Action>
                Mouse.LeftButton()
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'Enter password', 0.0)
            </Action>
        </Macro>
        <Macro Name="enter password" Expanded="True">
            <Event Name="Enter password" />
            <Action>
                Window.SendKeys(u'********', False)
            </Action>
            <Action>
                EventGhost.Wait(1.0)
            </Action>
            <Action>
                Window.SendKeys(u'{Return}', False)
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'Maximise screen', 0.0)
            </Action>
        </Macro>
        <Macro Name="Move the mouse pointer to:  x: 1040,  y: 700" Expanded="True">
            <Event Name="Maximise screen" />
            <Action>
                EventGhost.Wait(2.0)
            </Action>
            <Action>
                Mouse.MoveAbsolute(1040, 700, None, False)
            </Action>
            <Action>
                EventGhost.Wait(3.0)
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'left click', 0.0)
            </Action>
        </Macro>
        <Macro Name="Left mouse button" Expanded="True">
            <Event Name="left click" />
            <Action>
                Mouse.LeftButton()
            </Action>
        </Macro>
    </Folder>
</EventGhost>

Think I may need to increase one of the wait times, as the expanding of the window is a bit hit and miss.

Cheers gents,
« Last Edit: August 23, 2012, 06:05:53 AM by MrWolf »
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
@MrWolf
Quote
Mij, if you could give me instructions if you think your way would be more efficient then as always I would be in your debt

I'm not too sure if my way is efficient, but one thing for sure it's less stressful.

Method 1 using VoxCommando

The  old url http://www.nba.tv/nbatv/live.

New url  found by inspecting element of login window using firebug for firefox.
https://www.nba.tv/nbatv/secure/loginform?parent=http%3A%2F%2Fwww.nba.tv%2Fnbatv%2Flive

Logical Command Builder.
[attachment=1]

VoxCommando xml file.
[attachment=2]

You will need to edit the username and password in command builder.

I cant say for sure if it works 100%, that's because i don't have an account at nba live tv :(


« Last Edit: August 30, 2012, 11:22:17 AM by xtermin8r »
Neural Net Based Artificial Intelligence.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
nice.  works great.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Thanks Mij,

This makes a huge difference.  The window loads so much faster because of the URL and Vox commando controlling the mouse and keyboard feels far more clean.

This is ace buddy.

Once I've finished finally putting my phone back together following the disastrous "upgrade" to a Jellybean ROM that was pushed on me by the perfectly working ICS ROM I shall be looking at putting that firmware you sent me on to the HALX.

Thanks again mate.  Speak soon.

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Thanks Mij,

This makes a huge difference.  The window loads so much faster because of the URL and Vox commando controlling the mouse and keyboard feels far more clean.

This is ace buddy.

Once I've finished finally putting my phone back together following the disastrous "upgrade" to a Jellybean ROM that was pushed on me by the perfectly working ICS ROM I shall be looking at putting that firmware you sent me on to the HALX.

Thanks again mate.  Speak soon.

-P

Great news, Your'e welcome.
Neural Net Based Artificial Intelligence.