DeadOrAutohotkey - a fighting game bot
Posted: 18 Sep 2015, 09:08
by WAZAAAAA
This thread will no longer be updated, it has moved here: https://autohotkey.com/boards/viewtopic ... 19&t=24155
outdated message:
outdated message:
Spoiler
I have written a bot for a video game, a fighting game called Dead or Alive 5 Last Round that beats the game automatically.
It uses RHCP's fantastic classMemory.ahk library to read memory addresses from a running process.
DOWNLOAD: http://www.freestepdodge.com/threads/de ... a5lr.5982/
VIDEO PREVIEW: https://www.youtube.com/watch?v=_QypmRf5Yzo
You can use it as a practical example or framework to create your own bots/trainers that read memory from a process. I tried to keep the code as simple and as documented as possible. Here are some approaches I took which may be interesting to some:
- contains various optimizations (inside settings.ahk) aimed to make the script's timing faster and more precise, the methods are explained in this other thread: http://ahkscript.org/boards/viewtopic.php?f=6&t=6413
- almost every Send command uses scan codes instead of sending "regular" keys. This ensures universal compatibility with all keyboard language layouts, pretty important if you want other people to use your tools. Just one example: a French keyboard has AZERTY, English has QWERTY, but the scan codes for A/Q are the same for both (send {SC010 down}), here's a simple script used to check them: http://www.autohotkey.com/board/topic/2 ... -of-a-key/
- constantly checks memory addresses every millisecond with a loop
- the launcher detects and notifies the user if the script is running with administrator rights or not with this msgbox:- it also detects if the process is running or not
- a dead simple GUI used to launch other AHK scripts
It uses RHCP's fantastic classMemory.ahk library to read memory addresses from a running process.
DOWNLOAD: http://www.freestepdodge.com/threads/de ... a5lr.5982/
VIDEO PREVIEW: https://www.youtube.com/watch?v=_QypmRf5Yzo
You can use it as a practical example or framework to create your own bots/trainers that read memory from a process. I tried to keep the code as simple and as documented as possible. Here are some approaches I took which may be interesting to some:
- contains various optimizations (inside settings.ahk) aimed to make the script's timing faster and more precise, the methods are explained in this other thread: http://ahkscript.org/boards/viewtopic.php?f=6&t=6413
- almost every Send command uses scan codes instead of sending "regular" keys. This ensures universal compatibility with all keyboard language layouts, pretty important if you want other people to use your tools. Just one example: a French keyboard has AZERTY, English has QWERTY, but the scan codes for A/Q are the same for both (send {SC010 down}), here's a simple script used to check them: http://www.autohotkey.com/board/topic/2 ... -of-a-key/
- constantly checks memory addresses every millisecond with a loop
- the launcher detects and notifies the user if the script is running with administrator rights or not with this msgbox:
Code: Select all
if not A_IsAdmin
{
msgbox, You are running this script with no administrator rights. Please close this script and make sure your AutoHotkey executables run with administrator rights before reopening it.`n`nDefault installation folder path is usually: C:\Program Files\AutoHotkey`n`nRight click -> Properties -> Compatibility -> "Run this program as an administrator" to grant an EXE admin privileges.
}
Code: Select all
Process, Exist, game.exe
{
If not errorLevel
{
msgbox, No game detected. Please, press one of the buttons only if the game is RUNNING.
}
}