【原创】florr.io 挂机脚本

· · 个人记录

如果 florr.io 上有 8 个不同颜色的 "I'm here" 按钮,且每个按钮的颜色不同,你需要为每种颜色创建不同的截图,并在代码中检查这些截图。这份 Python 代码会检测并点击所有 8 种颜色的按钮。

Python 示例:

  1. 准备截图

    • 首先,截取 8 个不同颜色的 "I'm here" 按钮的图像,并将它们保存为不同的文件(例如 button_color1.png, button_color2.png, ...)。
  2. 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.pngbutton_color8.png。确保每个截图与实际按钮匹配。

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

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

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

解释: