跳到正文

剪贴板

剪贴板 vi6g99mu

原文
剪贴板信息

剪贴板信息

收录
更新

Mini Auto Click AFKCheck

题目背景

限时彩蛋:通过本题者可获得(内测版)Florr.io Super Client Version0.9(预计未来以7.9刀出售)/仅限1份,先到先得

鉴于已有脚本下载链接失效,写了个新的

欢迎改进,但请注明原作者(

可以前往题目附件下载

常见Q&A

Q:为什么不给截图?

A:受不同电脑分辨率、颜色等影响,不同电脑需要重新截图

Q:我号封了怎么办?

A:自己担着,而且大概率也封不了,这就好比是药品肯定有副作用但是能帮您减少的已经减少了,不想用别用。

Q:没有Python怎么办?

A:自己下,下好了终端pip install pyautogui

Q:Python要钱怎么办?

A:官网不用

题目描述

  1. 准备截图:

    • 首先,截取 8 个不同颜色的 “I’m here” 按钮的图像,并将它们保存为不同的文件(例如 button_color1.png, button_color2.png, …)。
  2. Python 代码示例:

    Python
    import pyautogui
    import time
    
    # 所有不同颜色的 "I'm here" 按钮截图文件名
    button_images = [
        'button_color1.png',
        'button_color2.png',
        'button_color3.png',
        'button_color4.png',
        'button_color5.png',
        'button_color6.png',
        'button_color7.png',
        'button_color8.png'
    ]
    
    def find_and_click_button(images):
        for image_path in images:
            location = pyautogui.locateCenterOnScreen(image_path, confidence=0.8)
            if location:
                print(f"Found button with image {image_path} at {location}")
                pyautogui.click(location)
                return True
        return False
    
    def main():
        # 设置点击的间隔时间(单位:秒)
        interval = 60  # 每60秒检查一次
    
        print("自动点击已开始,按 Ctrl+C 结束程序。")
    
        while True:
            if find_and_click_button(button_images):
                print("Clicked one of the buttons.")
            else:
                print("No buttons found, retrying...")
    
            time.sleep(interval)
    
    if __name__ == "__main__":
        main()

使用说明:

  1. 准备截图:截取 8 种不同颜色的 “I’m here” 按钮图像,并保存为 button_color1.png 到 button_color8.png。确保每个截图与实际按钮匹配。

  2. 脚本位置:将上述代码保存为 .py 文件,并确保所有截图文件与脚本文件在同一目录下。

  3. 运行脚本:运行 Python 脚本,它将定期检查屏幕上是否出现任何一种颜色的按钮并自动点击。

  4. 点击间隔:根据需要调整 interval 变量的值来设置检查的时间间隔。

解释:

  • find_and_click_button(images):该函数遍历所有提供的截图文件,并检查屏幕上是否有匹配的按钮。如果找到匹配的按钮,它会点击该按钮并返回 True。
  • pyautogui.locateCenterOnScreen():用于在屏幕上查找按钮的中心位置。confidence 参数设置了图像匹配的置信度,可以调整以提高匹配精度。
  • pyautogui.click():模拟鼠标点击操作。
  • time.sleep():设置检查的时间间隔。

输入格式

输出格式

提示

更新日志

VersionDateUpdate
【远古】0.0.122/7/?合卡模拟器
………
【正式】1.0.024/8/30AutoClick AFKCheck1.0