If you are reading this post, it is probably because you are asking a gaming related question on the IRC.
- Don't bot because game producers don't want you to.
- Tweak your SendMode and SetKeyDelay.
- Check your CoordMode for commands you define coordinates for.
Slightly longer explanation
- The primary reason is that many games (especially multiplayer games) employ methods such as Valve Anti-Cheat, PunkBuster, or other mechanisms to prevent automation for fairness among players. Many other games do not employ anti-cheat software, but be aware that they will explicitly specify that automation is a violation of their terms of service (eg. World of Warcraft, section 2A, use cheats, automation software (bots), hacks, mods or any other unauthorized third-party software designed to modify the World of Warcraft experience).
- The second most common reason for key remap/spam/send is the type of SendMode you are using, and delay and duration (SetKeyDelay) in which the keys are pressed. Only thing you can do is experiment around with the different modes and timings.
- The last reason applies for scripts that involves ImageSearch, PixelGetColor, or PixelSearch. Be aware that by default, the coordinates that you define are relative to the active window, and not to the screen. This can however be changed with CoordMode.
Ways to bypass anti-cheat mechanisms
- Play the game like you're supposed to!
- Hire a monkey to play for you.
- Code a mouse/keyboard driver to send the keys?
It may be ironic that AutoHotkey was originally created with the intention for automation and creating macros, and yet it fails to do the same for games. But I don't think it was intended for games, just normal desktop applications...