SmartBot How do I cheat? Reputation: 0
Joined: 15 May 2017 Posts: 1
|
Posted: Mon May 15, 2017 6:32 am Post subject: Sending input to games |
|
|
Alright, I'm using C++ and my end goal is a bot that can make some decisions. Currently, I'm having a couple a couple issues with sending inputs to other programs, including games. I've been using SendInput() to send a letter or two to notepad, but an issue I'm having with that is I can't hold down a key. Another issue with SendInput is I can't send an input at all to Terraria, while I can to Notepad. I'm assuming it's because Terraria's input handling that ignores SendInput, and if not, I'm under the impression that I'll eventually run in to that issue regardless if I try to port my bot to another game.
Sooo, I'm looking for help with simulating holding a key down, various other keyboard events, and mouse events and making it indistinguishable from the physical action itself. Thanks for your time.
Edit : I've tried using DIK key codes from dinput.h, but they don't work either. I even print out the return value and it always says it was sent. I'm going to try elevating user permissions on my program as soon as I figure out how and I'll report on how that goes. --Edit2: Ok, I elevated permissions (via Properties - Security) and it still don't work.
Edit3: I've done a little bit more reading on it and I think the best solution is going to be developing or utilizing a pre-existing Virtual Driver to handle keyboard and mouse events from my program. Anywhere I should start with looking in to that?
|
|