Runescape Bot Development: A Conceptual Guide
There are a variety of techniques one can use to bot an application. These techniques range from making a mouse macro to designing a program that sends requests directly to a server simulating human interaction. The document below discusses a very powerful type of bot usually referred to as a Bytecode Bot.
What can you do with a Bytecode Bot?
You can examine the client at runtime and evaluate where things such as trees, NPC's, etc are currently on the field. Things such as combat HP (This used to be possible but it's now a 1:30 ratio) can also be revealed. All of this alone (without botting) gives you extreme advantages over other players. You can respond to events that you may not visibly be aware of yet. It enables deadly accurate mouse clicks as you have the exact coordinates of everything. You can respond to players chatting, random events, and so much more. It's all up to your imagination.
Bytecode bots are a type of bot that have the power to remain undetectable, while still providing a powerful AI backend to simulate human action. The basic idea behind them for Runescape is as follows:
1.) Examine a decompiled version of Runescape, whether it be deobfuscated (meaning it's barely readable) or a bytecode interpretation using javap -c -private from the command line.
2.) Find a field and/or method of interest and trace the code to see how it works in relation to the client.
3.) Find a powerful pattern in the code that allows you to provide a meaningful link into the client for you and your Bot to use later on. This is important, and will be discussed a little later.
4.) Take the patterns that you find and make "hooks" for them directly into the Runescape client using the BCEL API (Or an API with similar features such as ASM.)
5.) Design a loader that loads up the Runescape Client and tricks it into thinking that it's running as an Applet (If that is not the case.) so that you are in the same JVM as the Runescape Client.
6.) Test out your "hooks" by printing them to standard output, painting to the screen, or using them in a scriptable environment.
Using a Bytecode Bot, it is possible to simulate Mouse Events without ever having to use an actual mouse. This is accomplished by dispatching events directly to Runescape's Mouse Event Handlers. The exact same is true for Key Events. By working on the level of code, it's possible to come up with an algorithm that simulates human action virtually flawlessly. This is an important aspect of Bytecode Bots.
More on Step 3 -
The Runescape client is obfuscated using a custom form of ZKM, therefore various names within the client are scrambled beyond human recognition. Class names such as Player or NPC are, for example, converted to zz and ab. This becomes extremely problematic in the fact that Runescape updates these randomly scrambled names (among other things) each major update. But, where there's a will there's a way. By finding certain things that are unlikely to change between updates, it is possible to have "hooks" survive the update without human intervention. This is usually accomplished via what is called an "Updater." The Updater finds landmark patterns within the client and will try to automatically "hook" them for access later on.
This is a rough guide/tutorial that probably won't help anyone but I have nothing else to do at the moment and thought it wouldn't hurt to do some writing. I hope you enjoyed it, and who knows? Maybe you will have found a use for it. I'm in the process of writing a book that details the entire process from start to finish (quite a task) Hopefully you'll hear about it in the future. In the meantime, I may post some more things about the subject, but other than that you'll just have to wait. If you made it this far, then Thank you for your Time. =)