Sorry for the double post but I have made a little bit of progress. I still have the same question as before but I have at least a start now. here is my script so far
- Code: Select all
void On_HK_4( DWORD dw1, DWORD dw2 )
{
HWND hWnd = FindWindow("Helicopter Game - Free Arcade & Classic Game from AddictingGames - Mozilla Firefox");
if(hWnd)
PrintF("Window Found");
ShowWindowAsync( hWnd, SW_RESTORE );
while ( GetForegroundWindow() != hWnd )
{
SetForegroundWindow( hWnd ); Sleep( 10 );
}
for(int i =0; i < 100; i++)
{
MouseEvent( MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN, 0, 0, 0 );
MouseEvent( MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTUP, 0, 0, 0 );
}
}
The things I still don't understand:
1. I need to find the position of the window of the game
2. I need to move my mouse so it is at least inside the window to be able to have the click actually move the helicopter.
3. I need to find the position of the helicopter
4. And I also still need to find out what is a wall and what is space
So far the clicks are just random and the helicopter goes in a straight line untill it runs into something but it is still a start
. I'm very excited to here how I can solve these problems. Thank you
-Max