Single player games UI automation

A section for all general discussions related to any topic subject.


Post Reply
User avatar
mece
Table Maker
Table Maker
Apprentice Hacker
Apprentice Hacker
Posts: 61
Joined: Sat Jul 23, 2022 9:21 am
Answers: 0
x 68
Contact:

Single player games UI automation

Post by mece »

Let's talk about game UI automation, making hotkeys and macros for single player games.

  1. Do you use UI automation?

  2. What tools are you using?

  3. What do you think about posting open source automation scripts or bots for single player games at OCT (opencheattables.org)?

Relevant links (thanks to commenters for providing links):

DescriptionLinkCategory
AutoHotkey is a free, open-source scripting language for Windowshttps://www.autohotkey.comTool
AutoIt v3 is a freeware BASIC-like scripting language for Windowshttps://www.autoitscript.comTool
SikuliX automates anything you see on the screen of your desktop computer running Windows, Mac or some Linux/Unix. It uses image recognition powered by OpenCV to identify GUI components.http://sikulix.com/Tool
Dabble App transforms your Smartphone into a virtual I/O device and lets you control hardware using Bluetooth, communicate with it, access sensors like accelerometer, GPS, proximity and otherhttps://thestempedia.com/docs/dabble/ge ... th-dabble/Tool
SCAR Divi is described as 'powerful macroing environment that allows users to write scripts with the goal of automating repetitive tasks on a windows based machine'https://scar-divi.com/Tool
AHK scripts for gameshttps://www.autohotkey.com/boards/viewforum.php?f=19Script repository

Example of auto attack macro for Genshin Impact written in AHK:

Code: Select all

;; 🔥 Auto-execute Section
#SingleInstance Force ; Restarting the script replace it's old instance automatically.
if not A_IsAdmin
  Run *RunAs "%A_ScriptFullPath%" ; restart script with admin rights if it has not them already
#Persistent ; keeps a script permanently running until the user closes it
#NoEnv ; improve script performance
SendMode, Event
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetControlDelay, -1
SetWinDelay,-1
SetBatchLines -1
Process, Priority,, High

;; 🌐 Global Variables
game := "ahk_exe GenshinImpact.exe"

;; ✔️ Init

;; 🎹 [Global Hotkeys]

#If
  Pause:: ExitApp ; hotkey for emergency script termination
Return

;; ✨ Main
#IfWinActive ahk_exe GenshinImpact.exe
  *x::SpamForward("x", "LButton")
Return

SpamForward(trigger, key)
{
  While GetKeyState(trigger,"P")
  {
    PressForward(key, 20)
  }
}

PressForward(key, delay=35)
{
  send {w Down}
  psleep(delay)
  press(key,delay,delay)
  send {w Up}
  psleep(delay)
}

press(key="",duration=35,cd=35)
{
  send {%key% Down}
  psleep(duration)
  send {%key% Up}
  psleep(cd)
}

psleep(ms=1)
{
  if ms<=0
    return
  DllCall("Sleep", "UInt", ms)
}

Post Reply