# Discord Automation and Monitoring Bot
This repository contains a powerful Discord bot designed to automate repetitive tasks, monitor on-screen data, and execute user-defined commands. The bot integrates screen capturing, optical character recognition (OCR), and keyboard/mouse automation for versatile use cases.
---
## Features
### 🚀 Core Functionalities
#### 🔄 Automation Control
- **`!run`**: Starts a pre-defined automation routine that simulates mouse and keyboard actions and captures screen data.
- **`!stop`**: Stops the ongoing automation process gracefully.
#### 📊 Monitoring and OCR
- Extract numeric data (e.g., gold and elixir values) from specific screen regions using Tesseract OCR.
#### 🖥️ Remote Control Commands
- **`!check`**: Capture and share screenshots of gold and elixir regions.
- **`!screenshot`**: Capture and share a full-screen screenshot.
- **`!lock`**: Lock the workstation remotely.
- **`!type <text>`**: Type the specified text into the active window.
- **`!hotkey <key1> <key2> ...`**: Simulate pressing a sequence of hotkeys.
- **`!press <key1> <key2> ...`**: Simulate pressing individual keys in sequence.
---
## Setup Instructions
### 1️⃣ Clone the Repository
```bash
git clone https://github.com/username/discord-automation-bot.git
cd discord-automation-botpip install discord pyautogui pytesseract pillow- Download and install Tesseract from Tesseract OCR.
- Update the
pytesseract.pytesseract.tesseract_cmdpath in the script to your Tesseract installation directory.
- Replace
TOKENwith your bot's token. - Replace
CHANNEL_IDwith the ID of your Discord channel.
python bot.py!run: Start the automation process.!stop: Stop the ongoing automation process.
!check: Share the latest screenshots of gold and elixir regions.!screenshot: Capture and share a full-screen screenshot.
!lock: Lock the workstation.!type <text>: Type the specified text in the active window.!hotkey <key1> <key2> ...: Simulate pressing a sequence of hotkeys.!press <key1> <key2> ...: Simulate pressing individual keys in sequence.
- Ensure your screen resolution matches the defined regions for OCR and automation.
- Modify
gold_regionandelixir_regionvariables to suit your setup. - Use responsibly; some actions (e.g.,
Alt+F4) may interfere with active tasks.
- Python 3.x
- Discord.py: For bot integration.
- PyAutoGUI: For mouse and keyboard automation.
- Tesseract OCR: For text recognition.
- Pillow: For image processing.
- Add dynamic region detection to support varying screen resolutions.
- Implement role-based access control for bot commands.
- Add logging for automation actions and screenshot history.
This bot is intended for educational purposes and personal use only. Use it responsibly to avoid unintended consequences.