semvec/pypi-packages huggingface dataset:
qx-game-bot 0.1.4
Add your description here
Requires Python: >=3.11

# qx-game-bot

Mac, Linux, Windows 跨平台桌面端游戏脚本框架

## 功能

- 键鼠模拟 ✅
- 键鼠录制 ✅
  - sqlite 内存存储 ✅
  - sqlite 数据库文件存储 ✅
  - json 文件存储
  - pickle 文件存储
- 键鼠播放 ✅
- 屏幕录制 ✅
- 图色匹配 ✅
- 文字 OCR 识别 ✅
  - 屏幕 OCR ✅
  - 图片 OCR ✅
- 怪物检测
- 目标跟踪
- 多线程任务
- 基于 web 的 GUI、中控

(先画饼， 慢慢实现...)

## 使用

```py
from qx_game_bot import QxGameBotFramework

bot = QxGameBotFramework()

# 按键模拟
bot.delay(100).keyTap("enter").keyType("# Hello World")
bot.keyPress("cmd").keyPress("shift").keyPress("left")
bot.keyRelease("cmd").keyRelease("shift").keyRelease("left")
bot.keyTapAll("cmd", "c")
bot.keyTapAll("cmd", "enter")
bot.keyTapAll("cmd", "v")
bot.delay(1500)

# 鼠标模拟
# 双击左键 (100, 100)
bot.mouseClick('left', x=100, y=100, count=2)
# 移动到
bot.mouseMoveTo(500, 500)
# 滚动 y：500
bot.mouseScrollBy(0, dy=500)

# 录制键鼠
bot = QxGameBotFramework('data.db')
stopRecording = bot.recordTask("task1")
sleep(3)
stopRecording()

# 播放键鼠
bot = QxGameBotFramework('data.db')
bot.playRecordTask("task1")

# 图色匹配
res = bot.matchAllScreen("e2e/apple.png")

res = bot.matchScreenColorPoint("#FFFFFF", 26, 13)

colorPoints = [("CA6179", 1431, 147), ("#FFFFFF", 26, 13)]
res = bot.matchScreenMultiColorPoints(colorPoints, condition="oneOfTrue")

# 屏幕OCR
res = bot.screenOcr(det_limit_side_len=3440)

# 图像OCR
res = bot.imgOcr("e2e/ocr/image.png")
```
aoc-colab-template 0.1.9
A template generator for Advent of Code solutions in Google Colab
Requires Python: >=3.7

# Advent of Code Colab Template Generator

A simple template generator for Advent of Code solutions in Google Colab. This package provides an easy way to set up your Advent of Code environment in Colab notebooks with just a few commands.

## Features
- One-command template generation for AOC solutions
- Automatic AOC session management
- Easy data fetching for any day/year
- Colab-specific optimizations

## Installation
```bash
pip install aoc-colab-template
```

## Quick Start
```python
from aoc_colab_template import create_template
create_template()  # Creates template with all necessary imports and setup
```

## Usage Guide

### Setting Up Your Environment
The template generator creates a cell with all necessary imports and setup:
```python
# This code is automatically generated by create_template()
from google.colab import userdata
import os
from aocd import get_data

# Sets up your AOC session automatically
AOC_SESSION = userdata.get('AOC_SESSION')
os.environ['AOC_SESSION'] = AOC_SESSION
```

### Getting Puzzle Input

#### Basic Usage
```python
# Get data for current day (defaults to day=1, year=2023)
data = get_aocd_data()

# Get data for specific day
day5_data = get_aocd_data(day=5)

# Get data from previous year
old_data = get_aocd_data(day=1, year=2022)
```

#### Working with Input Data
```python
# Print first few lines
print(data.split('\n')[:5])

# Common data processing patterns
lines = data.splitlines()  # Split into lines
numbers = [int(x) for x in lines]  # Convert to integers
grid = [list(line) for line in lines]  # Create 2D grid
```

### Best Practices
1. **Session Management**
   - Store your AOC session token in Colab's userdata
   - The template handles the environment setup automatically

2. **Data Fetching**
   - Use `get_aocd_data()` instead of copy-pasting inputs
   - Specify day and year explicitly for clarity
   - Cache data when working on solutions

3. **Template Usage**
   - Run `create_template()` at the start of each new solution notebook
   - The template includes commonly needed imports
   - Form interface makes it easy to control package installation

## Error Handling

### Common Issues
1. "AOC_SESSION not found":
   - Make sure you've stored your session token in Colab's userdata
   - Check that the template setup ran successfully

2. "Not running in Colab":
   - This package only works in Google Colab environment
   - Check you're not running in a regular Jupyter notebook

### Troubleshooting
If you encounter issues:
1. Verify you're in a Colab environment
2. Check your AOC session token is valid
3. Ensure you have internet connectivity
4. Try rerunning the template generation

## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.

## License
MIT License - feel free to use this in your AOC solutions!

## About Advent of Code
[Advent of Code](https://adventofcode.com/) is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.