Skip to content

maple-underscore/arrastools

Repository files navigation

License: CC BY-NC-SA 4.0

arrastools

Desktop automation toolkit for Arras.io game automation โ€” screen capture, input synthesis, pixel detection, AI agents (PPO/DQN), and cross-platform macro scripts.

Warning

This tool automates keyboard and mouse input. Use responsibly and in accordance with game terms of service.


Features

Feature Script Description
๐ŸŽฎ Hotkey Macros arrastools.py Keyboard-driven game automation with pynput
๐Ÿ‘๏ธ State Watchdog arrasbot.py Pixel-based disconnect/death/ban detection with logging
๐Ÿ“ Copypasta arrascopypasta.py Auto-types text from copypastas/ directory
๐Ÿ” OCR Detection arrastext_detector.py Screen text extraction via pytesseract
๐Ÿ Snake AI asnake.py DQN-trained Snake game with configurable training
๐ŸŽจ Rendering renderer/ OpenGL + Tkinter rendering with shader support

Quick Start

Important

Python 3.10+ required. Python 3.14 recommended for best performance.

1. Clone & Setup

git clone https://github.com/maple-underscore/arrastools.git
cd arrastools

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate  # Linux/macOS
# .venv\Scripts\activate   # Windows

# Install dependencies
pip install -r requirements.txt

2. Install System Dependencies

Linux (Debian/Ubuntu)
sudo apt install tesseract-ocr python3-tk
macOS
brew install tesseract

[!NOTE] Grant Accessibility and Screen Recording permissions in System Settings โ†’ Privacy & Security.

Windows
  1. Download Tesseract OCR
  2. Add to system PATH
  3. Run Terminal as Administrator if input automation fails

Project Structure

arrastools/
โ”œโ”€โ”€ ยซยซยซยซยซ CORE ยปยปยปยปยป/           # Main automation scripts
โ”‚   โ”œโ”€โ”€ arrastools.py           # Hotkey-driven macro system
โ”‚   โ”œโ”€โ”€ arrasbot.py             # Game state watchdog
โ”‚   โ”œโ”€โ”€ arrascopypasta.py       # Auto-typing copypastas
โ”‚   โ”œโ”€โ”€ arrastext_detector.py   # OCR text detection
โ”‚   โ”œโ”€โ”€ arrasbp.py              # Blueprint processing
โ”‚   โ”œโ”€โ”€ keylogger.py            # Keypress logger โ†’ logsk/
โ”‚   โ”œโ”€โ”€ rollbot.py              # Automated game mechanics
โ”‚   โ”œโ”€โ”€ macrorecorder.py        # Macro recording utility
โ”‚   โ”œโ”€โ”€ window_detector.py      # Window detection utility
โ”‚   โ”œโ”€โ”€ rg.py                   # Utility script
โ”‚   โ”œโ”€โ”€ bitmap.txt              # Bitmap font data
โ”‚   โ”œโ”€โ”€ bps/                    # Blueprint data files
โ”‚   โ””โ”€โ”€ renderer/               # OpenGL/Tkinter rendering
โ”‚       โ”œโ”€โ”€ base_renderer.py
โ”‚       โ”œโ”€โ”€ opengl_renderer.py
โ”‚       โ”œโ”€โ”€ tkinter_renderer.py
โ”‚       โ”œโ”€โ”€ sprite_pool.py
โ”‚       โ””โ”€โ”€ shaders/            # GLSL shaders
โ”‚
โ”œโ”€โ”€ random/                     # Experimental scripts
โ”‚   โ”œโ”€โ”€ asnake.py               # DQN Snake AI
โ”‚   โ”œโ”€โ”€ arrasantiafk.py         # Anti-AFK mouse wiggler
โ”‚   โ”œโ”€โ”€ drawacircle.py          # Circle drawing tool
โ”‚   โ”œโ”€โ”€ minesweeper.py          # Terminal Minesweeper
โ”‚   โ”œโ”€โ”€ nodebuster.py           # Node automation
โ”‚   โ”œโ”€โ”€ ping.py                 # Network ping utility
โ”‚   โ””โ”€โ”€ snake_config.json       # Snake AI configuration
โ”‚
โ”œโ”€โ”€ tools/                      # Standalone utilities
โ”‚   โ”œโ”€โ”€ arraspixel.py           # Click-to-inspect pixel color
โ”‚   โ””โ”€โ”€ unicode_chunker.py      # Unicode text processing
โ”‚
โ”œโ”€โ”€ copypastas/                 # 25+ text files for auto-typing
โ”œโ”€โ”€ typings/                    # Type stubs for dependencies
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ copilot-instructions.md

Usage

arrastools.py โ€” Hotkey Macros

Tip

Hold Ctrl for most hotkeys. Use Esc to stop any running macro.

Hotkey Action
Ctrl+1 (1/2/3ร—) Arena size automation
Ctrl+y Controlled Nuke (click 2 points)
Ctrl+6 (2ร— in 5s) Ball crash
Ctrl+9 Nuke
Ctrl+m Ball spam benchmark
Alt+Arrow 1px mouse nudge
Esc Stop current activity
Ctrl+Esc Immediate exit

arrasbot.py โ€” State Watchdog

Run in terminal and use these commands:

Command Description
stop Stop monitoring
dbgmon List all monitors
probe Sample pixel at cursor
screenshot Capture screen
status Show current state
setscale <1|2> Set display scaling
setmon <index> Change monitor

Note

Logs โ†’ logs/abss_*.log
Screenshots โ†’ ~/Desktop/abss/<session>/

asnake.py โ€” DQN Snake AI

cd random
python asnake.py
  • Configure via snake_config.json
  • Models saved to snake_models/
  • Press Esc to quit

Configuration

Important

Coordinates are hardcoded for specific resolutions. You'll need to calibrate for your display.

Display Scaling

Set SCALE in arrasbot.py:

  • Retina/HiDPI (macOS): SCALE = 2
  • Standard displays: SCALE = 1

Calibrating Coordinates

  1. Run arrasbot.py
  2. Use dbgmon to list monitor properties
  3. Use probe to sample pixel colors at cursor position
  4. Update coordinates in scripts as needed

Platform Support

Platform Status Notes
๐Ÿง Linux โœ… Primary X11 recommended; Wayland has pynput limitations
๐ŸŽ macOS โœ… Tested Requires Accessibility + Screen Recording permissions
๐ŸชŸ Windows โœ… Tested May need Administrator for input automation

Caution

Wayland users: pynput works best on X11. Consider switching sessions or using XWayland.


Troubleshooting

Permission Issues

macOS: System Settings โ†’ Privacy & Security โ†’ Enable Accessibility + Screen Recording

Linux: Ensure X11 session; check pynput docs for your DE

Windows: Run Terminal as Administrator

Coordinate/Scaling Issues
  1. Run arrasbot.py โ†’ dbgmon to check monitors
  2. Use probe command to verify pixel positions
  3. Adjust SCALE (2 for HiDPI, 1 for standard)
  4. Re-map hardcoded coordinates for your resolution
ModuleNotFoundError
# Ensure venv is activated
source .venv/bin/activate

# Reinstall dependencies
pip install -r requirements.txt
Tesseract Not Found

Ensure Tesseract OCR is installed and in PATH:

tesseract --version

Development

Note

See .github/copilot-instructions.md for detailed conventions and architecture patterns.

Key Patterns

  • Threading: Daemon threads with global boolean flags
  • Input: Single KeyboardController/MouseController per module
  • Color Detection: Use color_close(rgb1, rgb2, tol=6) for tolerance
  • File Paths: Always use pathlib.Path

Contributing

  1. Test on your target platform
  2. Use pathlib for cross-platform paths
  3. Follow existing code patterns
  4. Add platform detection for new scripts
  5. Include type annotations

License

CC BY-NC-SA 4.0 โ€” Non-commercial use only. See LICENSE and NOTICE for details.


Warning

Disclaimer: This tool is for educational purposes only. The authors are not responsible for any consequences of misuse.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •