Write text to applications

Started by
1 comment, last by tron86 14 years, 2 months ago
Hello, I wasn't sure if I should post this here or the game programming section. However here is the issue. I have an application that I would like to have launch games similar to have gamespy and gameranger does. I can do simple things like open notepad and use PostMessage to send text into it, or inject a DLL into notepad to change a text value. But this problem is much more complex, I thought it would be ideal if the game accepted simple command line switches. I found this is not the case, and from what I have been reading it would have to be API hooked to "automate" the process of starting the game, and going through a few options. Here is the scenario: The game I am trying to launch is AVP Classic 2000 which is currently released on Steam. Since this game was updated, and re-released; it works great, however they removed the section in the game's menu to Direct IP Connect. Steam hosts this feature if you go into the friends list and then hit "Join Game" I am assuming to be able to Direct IP Connect with this application I would have to hook into SteamAPI? Hosting the game is kinda tricky because when you launch it, you are prompted to select a user profile, and then would have to select Multiplayer->Host A New Game->Setup your options->Start. I hope this is enough information, it is not really "Game Programming" it is mainly API hooking, and how to go about it. I would greatly appreciate the help if possible. Thanks in advance.
Advertisement
Hi,

You want to send automated input to a game in order to connect to an online game, correct?

Depending on how the game handles the keyboard input, PostMessage will probably not work. However, there's a Win32 API function called SendInput, which might work for what you want to do. IIRC, SendInput can send Keys AND Mouse input.
However, simulating clicks and key pressed on a UI is surely not an elegant nor robust way to accomplish what you want to do.

Have you looked if there's a Steam API or any command line switches?
It seems the developer removed the switches, because it is now a "steam game" so to directly connect you would use the steam friend's list to "join game". So the switches if there were any have been removed as far as I can tell. The SteamAPI is not public knowledge I think, I believe it is called SteamWorks and is developer restricted. I have found a site that exposed part of the API, but I don't think it is enough, and I am wondering if you need steam running to use it in the end. I know Mplayer supported this, and it is rather old. I just don't know how they did it.

This topic is closed to new replies.

Advertisement