├── .github └── workflows │ └── build.yml ├── .gitignore ├── README.md ├── img ├── image1.png ├── image2.png ├── image3.png └── image4.png ├── main.py ├── pack.bat └── requirements.txt /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v2 16 | 17 | - name: Set up Python 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: '3.11' 21 | 22 | - name: Install dependencies 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install -r requirements.txt 26 | pip install nuitka 27 | 28 | 29 | - name: Set environment variable for Nuitka 30 | run: | 31 | $env:NUITKA_ONEFILE_TEMP=true 32 | $env:NUITKA_RECURSIVE=true 33 | 34 | - name: Build with Nuitka 35 | run: | 36 | nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=ZZZ-UID.exe --windows-uac-admin .\main.py 37 | 38 | 39 | - name: Archive executable and images 40 | run: | 41 | Compress-Archive -Path .\ZZZ-UID.exe, .\img -DestinationPath ZZZ-UID.zip 42 | 43 | - name: Create release 44 | id: create_release 45 | uses: actions/create-release@v1 46 | env: 47 | GITHUB_TOKEN: ${{ secrets.PAT }} 48 | with: 49 | tag_name: ${{ github.run_id }} 50 | release_name: Release ${{ github.run_number }} - ${{ github.run_id }} 51 | draft: false 52 | prerelease: true 53 | 54 | - name: Upload release asset 55 | id: upload-release-asset 56 | uses: actions/upload-release-asset@v1 57 | env: 58 | GITHUB_TOKEN: ${{ secrets.PAT }} 59 | with: 60 | upload_url: ${{ steps.create_release.outputs.upload_url }} 61 | asset_path: ./ZZZ-UID.zip 62 | asset_name: ZZZ-UID.zip 63 | asset_content_type: application/zip 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | venv 3 | *.exe 4 | *.zip 5 | main.dist 6 | main.build 7 | main.*build -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZZZ-UID 2 | 3 | 只是一个帮我抢UID的小程序罢了;**禁止用于违法目的!!!** 4 | 5 | Telegram群组(有入群验证):https://t.me/DohnaNyan 6 | 7 | > [!CAUTION] 8 | > 9 | > **因为STAR来得太快了,在这里强调一点:禁止宣传!!!否则删库跑路!!!** 10 | 11 | > [!IMPORTANT] 12 | > 13 | > **本程序是按照崩铁那个时候的逻辑来做的,即进入游戏就分配UID,如果ZZZ要创角(即输入名字选择性别后)才分配UID的话我是无能为力的** 14 | > 15 | > 一定要采用1080p分辨率或者其他16:9分辨率(未测试,理论上可行,不行自己调点击的位置)并全屏游戏,并且需要把游戏放在前台置顶窗口 16 | > 17 | > 可以多屏,但是你的主屏幕一定要是16:9的 18 | 19 | > [!Warning] 20 | > 21 | > 一定一定一定要以管理员身份打开程序,要不然点不下去!!! 22 | > 23 | > 当你打开本程序的时候,默认你同意:①承诺合法使用本程序 ②抢的是自己的号 ③并非用于商业行为 24 | > 25 | > 使用本程序造成的一切后果自行承担,开发者不背锅 26 | 27 | ## 使用要求 28 | 29 | - 需要Python环境,版本没有什么特定的要求,我用的是`Python 3.11.9`(没有Python环境直接下载RELEASE,非必要不要用Pre-Release) 30 | - 稳定的网络环境 31 | - ZZZ客户端(要求设置为简体中文,不是简体中文有可能会识别不出来,分辨率为**1920*1080全屏**或者任意16:9分辨率,但是一定要全屏!!!**仅在1080p分辨率下通过测试,其他分辨率理论上应该可以用的**) 32 | 33 | ## 开始使用 34 | 35 | Step 1. 首先打开终端,安装我们需要的轮子 36 | 37 | ```powershell 38 | pip install -r requirements.txt 39 | ``` 40 | 41 | 然后,以**管理员身份**打开终端,运行本程序 42 | 43 | ```powershell 44 | python main.py 45 | ``` 46 | 47 | 放着就好了,经过测试,每7.5秒一循环为米忽悠设置的极限,本程序设置的为7.6秒一循环,避免压线;如果仍然触发了风控,会暂停15秒,如果需要更高的频率,请在下面这段代码自己修改 48 | 49 | ```python 50 | while True: 51 | if match_and_click(template3, coordinates['image3.png'], '风控页面', thresholds['image3.png']): 52 | # 暂停15秒 53 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 54 | print(f"{current_time} 检测到被风控!休眠15秒") 55 | time.sleep(15) 56 | 57 | match_and_click(template1, coordinates['image1.png'], '登录主页面', thresholds['image1.png']) 58 | time.sleep(1) # 等待1秒,确保点击操作完成 59 | match_and_click(template2, coordinates['image2.png'], '维护提示', thresholds['image2.png']) 60 | time.sleep(6.6) # 等待6.6秒 61 | ``` 62 | 63 | **不建议修改第一个`time.sleep(1)`,点击后需要这个时间来弹出提示窗口** 64 | 65 | -------------------------------------------------------------------------------- /img/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamerNoTitle/ZZZ-UID/3e83b49db279b696b64c067a93d105fa579c0e3b/img/image1.png -------------------------------------------------------------------------------- /img/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamerNoTitle/ZZZ-UID/3e83b49db279b696b64c067a93d105fa579c0e3b/img/image2.png -------------------------------------------------------------------------------- /img/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamerNoTitle/ZZZ-UID/3e83b49db279b696b64c067a93d105fa579c0e3b/img/image3.png -------------------------------------------------------------------------------- /img/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GamerNoTitle/ZZZ-UID/3e83b49db279b696b64c067a93d105fa579c0e3b/img/image4.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | import pyautogui 4 | import time 5 | import ctypes 6 | import sys 7 | from datetime import datetime 8 | 9 | welcome_msg = ''' 10 | _______ _______ _______ _ _ _ ___ 11 | (_____ )(_____ )(_____ ) ( ) ( )(_)( _`\ 12 | /'/' /'/' /'/'______ | | | || || | ) | 13 | /'/' /'/' /'/' (______)| | | || || | | ) 14 | /'/'___ /'/'___ /'/'___ | (_) || || |_) | 15 | (_______)(_______)(_______) (_____)(_)(____/' 16 | 17 | https://github.com/GamerNoTitle/ZZZ-UID 18 | Telegram群组(有入群验证):https://t.me/DohnaNyan 19 | ''' 20 | 21 | # 检查是否以管理员权限运行 22 | def is_admin(): 23 | try: 24 | return ctypes.windll.shell32.IsUserAnAdmin() 25 | except: 26 | return False 27 | 28 | # 以管理员权限重新运行脚本 29 | def run_as_admin(): 30 | ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1) 31 | 32 | # 如果不是管理员,则重新以管理员权限运行脚本 33 | if not is_admin(): 34 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 35 | print(f"{current_time} 正在获取管理员权限……") 36 | run_as_admin() 37 | sys.exit() 38 | 39 | # 调整模板图片大小 40 | def resize_template(template, screen_width, screen_height): 41 | base_width, base_height = 1920, 1080 42 | scale_x = screen_width / base_width 43 | scale_y = screen_height / base_height 44 | new_width = int(template.shape[1] * scale_x) 45 | new_height = int(template.shape[0] * scale_y) 46 | resized_template = cv2.resize(template, (new_width, new_height)) 47 | return resized_template 48 | 49 | # 检测屏幕分辨率 50 | screen_width, screen_height = pyautogui.size() 51 | 52 | # 加载模板图像 53 | template1 = resize_template(cv2.imread('img/image1.png', cv2.IMREAD_GRAYSCALE), screen_width, screen_height) 54 | template2 = resize_template(cv2.imread('img/image2.png', cv2.IMREAD_GRAYSCALE), screen_width, screen_height) 55 | template3 = resize_template(cv2.imread('img/image3.png', cv2.IMREAD_GRAYSCALE), screen_width, screen_height) 56 | template4 = resize_template(cv2.imread('img/image4.png', cv2.IMREAD_GRAYSCALE), screen_width, screen_height) 57 | 58 | # 获取模板图像的尺寸 59 | w1, h1 = template1.shape[::-1] 60 | w2, h2 = template2.shape[::-1] 61 | w3, h3 = template3.shape[::-1] 62 | w4, h4 = template4.shape[::-1] 63 | 64 | # 设置对应的坐标和匹配阈值 65 | coordinates = { 66 | 'image1.png': (960, 540), 67 | 'image2.png': (700, 630), 68 | 'image3.png': (960, 630), 69 | 'image4.png': (960, 630) 70 | } 71 | 72 | thresholds = { 73 | 'image1.png': 0.5, 74 | 'image2.png': 0.8, 75 | 'image3.png': 0.9, 76 | 'image4.png': 0.9 77 | } 78 | 79 | def match_and_click(template, coord, template_name, threshold): 80 | # 截屏 81 | screenshot = pyautogui.screenshot() 82 | screenshot = cv2.cvtColor(np.array(screenshot), cv2.COLOR_RGB2BGR) 83 | screenshot_gray = cv2.cvtColor(screenshot, cv2.COLOR_BGR2GRAY) 84 | 85 | # 匹配模板 86 | result = cv2.matchTemplate(screenshot_gray, template, cv2.TM_CCOEFF_NORMED) 87 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result) 88 | 89 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 90 | print(f"{current_time} 正在尝试匹配 {template_name},最大匹配相似度 = {max_val}") 91 | 92 | if max_val >= threshold: 93 | # 按比例调整坐标 94 | adjusted_coord = adjust_coordinates(coord) 95 | print(f"{current_time} 当前页面成功以最大匹配相似度 {max_val} 匹配上了 {template_name},正在点击位置 {adjusted_coord}") 96 | # 移动鼠标并点击 97 | pyautogui.moveTo(adjusted_coord[0], adjusted_coord[1]) 98 | pyautogui.click() 99 | return True 100 | else: 101 | print(f"{current_time} 当前页面看起来不像 {template_name},最大匹配相似度为 {max_val}") 102 | return False 103 | 104 | # 按比例调整坐标 105 | def adjust_coordinates(coord): 106 | base_width, base_height = 1920, 1080 107 | adjusted_x = int(coord[0] * screen_width / base_width) 108 | adjusted_y = int(coord[1] * screen_height / base_height) 109 | return (adjusted_x, adjusted_y) 110 | 111 | if __name__ == '__main__': 112 | # 欢迎信息 113 | print(welcome_msg) 114 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 115 | print(f"{current_time} 检测到屏幕分辨率: {screen_width}x{screen_height}") 116 | if screen_width/screen_height != 1920/1080: 117 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 118 | print(f'{current_time} 不支持当前分辨率:{screen_width}x{screen_height}!请使用16:9的分辨率再打开本程序!') 119 | # 主循环 120 | while True: 121 | if match_and_click(template3, coordinates['image3.png'], '风控页面', thresholds['image3.png']): 122 | # 暂停15秒 123 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 124 | print(f"{current_time} 检测到被风控!休眠15秒") 125 | time.sleep(15) 126 | 127 | match_and_click(template1, coordinates['image1.png'], '登录主页面', thresholds['image1.png']) 128 | time.sleep(1) # 等待1秒,确保点击操作完成 129 | match_and_click(template2, coordinates['image2.png'], '维护提示', thresholds['image2.png']) 130 | time.sleep(6.6) # 等待6.6秒 131 | if match_and_click(template4, coordinates['image4.png'], '网络超时提示', thresholds['image4.png']): 132 | current_time = datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") 133 | print(f"{current_time} 检测到出现网络问题,请保持网络通畅!") 134 | -------------------------------------------------------------------------------- /pack.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | nuitka --standalone --onefile --assume-yes-for-downloads --output-filename=ZZZ-UID.exe --windows-uac-admin .\main.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | opencv-python 2 | pyautogui --------------------------------------------------------------------------------