Python自制自动连点器

2024-12-12 0 1,824

最近玩雷霆战机,但是金币又很少,百度搜了看可以用自动连点器刷无尽,但是我手机不可能24小时挂着,模拟器又需要把微信退出去,就找pc版的连点器吧,找了好几个都要RMB,GitHub上也少,就自己用py写一个吧,简简单单,可以定时,多点位就能满足,下面贴上代码和运行效果:

更新

1、更新了2.0版本,修改ui界面附上地址:

https://wwxv.lanzoul.com/b0foy0e9c
密码:2f5o

2、更新3.0版本,新增可删除指定位置,可增加指定位置到哪,如果指定位置已存在则替换当前指定位置,新增实时显示鼠标坐标

附上GitHub地址:https://github.com/StephenYXC/AutoClick,鼠标坐标实时位置暂时不能打包后实现,有懂的可以提示下,pynput的库

3、更新3.2版本,可保存坐标点、循环和点击时间

4、更新3.5.1,可设定时间执行点击操作,实时显示当前日期时间

Python自制自动连点器

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# -*- coding: utf8 -*-
import time,re,os,pickle
import tkinter as tk
from tkinter import messagebox,ttk
import pyautogui
import keyboard
import logging
import threading
 
# 初始化一个空列表来保存坐标点
coordinates = []
# 声明一个全局变量,用于控制循环的启动和停止
is_running = False
click_count = 0  # 循环计数器
clickNum = 0 # 标记
 
# 设置日志记录
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
 
def get_mouse_position():
    global clickNum
    x, y = pyautogui.position()
    coordinates.append((x, y))
    update_message(f"{x}, {y}n")
 
# 清空信息
def clear():
    global click_count
    #清空已获取的坐标点
    entry1.delete(0, tk.END)
    entry2.delete(0, tk.END)
    coordinates.clear()
    is_running = False
    click_count = 0  # 循环计数器
    message.config(state='normal')  # 确保Text组件是可编辑的
    message.delete('1.0', tk.END)  # 删除从第一行第一个字符到最后一个字符的所有内容
    message.config(state='disabled')  # 清空后再次设置为禁止输入状态
    # 清空并删除已保存到文件里的数据
    messagebox.showinfo("信息","所有数据已清空")
 
# 启动连点
def startClickThread():
    global is_running,click_count
    seconds1 = float(entry1.get())
    seconds2 = float(entry2.get())
    while is_running:
        try:
            # 遍历coordinates列表中的每个坐标点
            for x, y in coordinates:
                # 移动鼠标到坐标点(x, y)
                pyautogui.moveTo(x, y)
                # 模拟鼠标点击
                pyautogui.click()
                time.sleep(seconds2)
            # 一轮循环完成,增加计数器
            click_count += 1
            current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
            update_message(f"{current_time}  第 {click_count} 次循环结束n")
            # 等待-秒
            time.sleep(seconds1)
        except pyautogui.FailSafeException:
            update_message("操作取消,因为鼠标移动到了屏幕角落。n")
            is_running = False
        except Exception as e:
            logging.error(f"发生错误:{e}")
            is_running = False
 
# 启动或停止
def startOrStop():
    global is_running
    if check_empty():
        # 如果两者都为空,则不执行任何操作
        messagebox.showwarning("警告""时间和坐标列表都不能为空!n")
        return
    if not is_running:
        is_running = True
        update_message("-----启动连点,当前每 {} 秒点击一次-----n".format(entry2.get()))
        threading.Thread(target=startClickThread).start()  # 使用线程启动连点操作
    else:
        is_running = False
        update_message("-----停止连点-----n")
 
def check_empty():
    # 检查entry1,entry2是否为空
    if entry1.get().strip() == "" or entry2.get().strip() == "":
        return True
    if len(coordinates) == 0:
        return True
    return False
 
def update_message(message_text):
    def safe_update():
        message.config(state='normal')
        message.insert(tk.END, message_text)
        message.config(state='disabled')
        # 滚动到最底部
        message.yview(tk.END)
    root.after(0, safe_update)
 
# 监听F6键
keyboard.add_hotkey('f6', get_mouse_position)
# 监听F7键
keyboard.add_hotkey('f7', startOrStop)
 
# 创建主窗口
root = tk.Tk()
 
# 获取屏幕宽度和高度
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
# 获取窗口的宽度和高度
win_width = 650  # 假设窗口宽度为650像素
win_height = 400  # 假设窗口高度为400像素
# 计算窗口在屏幕上的位置
= (screen_width / 2- (win_width / 2)
= (screen_height / 2- (win_height / 2)
# 设置窗口的位置
root.geometry(f'{win_width}x{win_height}+{int(x)}+{int(y)}')
 
# 获取当前脚本的绝对路径
script_dir = os.path.dirname(os.path.abspath(__file__))
 
# 构建图标文件的绝对路径
icon_path = os.path.join(script_dir, 'config''click.png')
win_image = tk.PhotoImage(file='.\config\click.png')
root.iconphoto(False, win_image)
root.title("自动连点器")
root.geometry("650x400")
# 创建标签
label = tk.Label(root, text="按下F6获取当前鼠标坐标")
label.pack(pady=10)
 
# 下一个大循环
frame1 = tk.Frame(root)
frame1.pack(fill=tk.X, expand=True)
label1 = tk.Label(frame1, text="距离下一个循环点击时间:")
label1.pack(side=tk.LEFT, fill=tk.X, padx=(2010))
entry1 = tk.Entry(frame1, width=10)
entry1.pack(side=tk.LEFT, fill=tk.X, expand=True)
label2 = tk.Label(frame1, text="s/秒")
label2.pack(side=tk.LEFT, fill=tk.X, padx=(2010))
 
# 下一次点击
frame2 = tk.Frame(root)
frame2.pack(fill=tk.X, expand=True)
label3 = tk.Label(frame2, text="距离下一个点击时间:")
label3.pack(side=tk.LEFT, fill=tk.X, padx=(2010))
entry2 = tk.Entry(frame2, width=10)
entry2.pack(side=tk.LEFT, fill=tk.X, expand=True)
label4 = tk.Label(frame2, text="s/秒")
label4.pack(side=tk.LEFT, fill=tk.X, padx=(2010))
 
 
# 创建按钮
frame5 = tk.Frame(root)
frame5.pack(fill=tk.X, expand=True)
button1 = tk.Button(frame5, text="清空", command=clear)
button1.pack(side=tk.LEFT, fill=tk.X, expand=True)
button2 = tk.Button(frame5, text="启动/停止(F7)", command=startOrStop)
button2.pack(side=tk.LEFT, fill=tk.X, expand=True)
 
# 创建一个Label用于显示信息
message = tk.Text(root, state='disabled')
message.pack(fill=tk.BOTH, expand=True,padx=5, pady=5)
 
# 运行主循环
root.mainloop()
keyboard.wait()
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

注:在使用本系统时,使用方必须在国家相关法律法规范围内并经过国家相关部门的授权许可,禁止用于一切非法行为。使用用途仅限于测试、实验、研究为目的,禁止用于一切商业运营,本团队不承担使用者在使用过程中的任何违法行为负责。

83源码 技术教程 Python自制自动连点器 https://www.83ym.com/181.html

认准唯一TG:@ym830

常见问题
  • 站内所有资源,针对不同等级VIP会员可直接下载,特殊资源商品会注明是否免费,指会员所享有根据选择购买的会员选项所享有的特殊服务,具体以本站公布的服务内容为准。
查看详情
  • 按照我国的法律规定,运营网络棋牌首先需要成立一个注册正规备案的公司,然后申请网站备案、文网文、ICP等等,这些证件缺一不可。 一.注册公司 在当地工商进行注册,公司名称以“XX科技有限公司”为名,如:富裕棋牌经营范围填写“计算机软硬件、网络设备的设计开发与购销”。 二.域名及网站备案 在国内从事网站经营活动就必须经过相关部门的备案,因此棋牌运营商在购买了域名后,就要到当地网监局办理网站备案,或者请服务器提供商代为备案。 三.申请文网文 文网文全称为网络文化经营许可证,是从事经营性互联网文化活动所必需的资质。一般是需要到当地省一级(省、直辖市、自治区)的文化行政部门提出申请,并经由当地的文化行政部门合法批准。次资质要求申请公司注册资金必需达到1000万,并提供游戏版权证明文件。 四.申请ICP ICP又称为增值电信业务许可证,所有网络游戏运营商均需要办理ICP许可证,此证件要求公司注册资金1000万,需到当地市级通讯管理局办理。 五.申请文网游——游戏备案 根据《网络游戏管理暂行办法》(文化部第49号)的规定,国产网络游戏在上网运营之日起30日内应当按规定向国务院文化行政部门履行备案手续。 以上就是网络棋牌游戏正规运营所必需的资质证明。一般作为正规有实力的棋牌游戏开发公司,不光要具备所有的正规资质,而且会对投资者、代理商等合作伙伴给予相关指导和协助,与合作伙伴携手共赢!
查看详情

相关文章

猜你喜欢
官方客服团队

为您解决烦忧 - 24小时在线 专业服务