So I've got a basic question I want to pose to y'all. What is the best method for submitting input to WoW? I want to do things like set targets, cast spells, and move.
The options I see are as follows:
- Simulated input
This is injecting keystrokes and/or mouse input; it's the method my bot is using right now. The upside of this method is that it's the most "life like" of all the methods (short of actually playing the game). It looks to the client like the user is actually playing the game. So my suspicion is that for non-public bots, it's the least likely to get you banned.
The downside is that it's not super reliable. All sorts of timing issues can screw up keystroke injection. Additionally, it creates one more layer of verification -- I have to make sure that my injection of CTRL-ALT-F3 (or whatever) really did trigger "Greater Heal" (or whatever). In other words, there's no direct connection between your simulated input and the desired behavior. There's only an implied connection, assuming your bindings are right, assuming the input buffer accepted your input, etc.
- Packet injection
This is the method I'm currently contemplating. It also seems low on the detectability scale (with one big caveat; since I'd essentially have to man-in-the-middle all traffic, would the Warden traffic get screwed up?). Also, there's no need to verify that client action caused the correct messages to be sent to the server, since you initiate those messages directly.
The downside is mostly synchronization. Since the client cooperates with the server in a number of different ways (movement, and IIRC an initial check for things like ranges, mana, etc.), it's quite possible to send packets that cause your client to get out-of-sync with the server. With this method you start to run into the complexities of a clientless bot (which is more involved than I want to go).
- LUA injection
This seems to be the route that most of the folks on the forum are using. One benefit of calling dostring is that, in theory, I'd have all of the power of LUA at my disposal (meaning I could do more than just cast spells, etc.).
The downside of LUA calls, to me, are detectability (you're running code in-process again), the need to maintain more offsets (right now I only need to keep track of the SRP key and the CTM offsets), and the need to do lots and lots of injections (or do resident code with an EndScene hook).
So, these are my thoughts on the pros/cons of the various ways of "getting input into WoW." I'd like to hear y'all's opinion, because I'm becoming less and less enamored of my current method (simulated keystrokes).