This commit is contained in:
xyj 2024-03-09 14:36:35 +08:00
parent feca453f99
commit c50e2ab71f
5 changed files with 45 additions and 44 deletions

27
black.py Normal file
View File

@ -0,0 +1,27 @@
black_list = {
0: {
"Type": 1,
"Index": 0,
"DataNum": 1,
"PointNum": 4,
"Check": 38,
"Point": [
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
}
]
}
}

View File

@ -1,36 +0,0 @@
import pyautogui
a = {
"Type": 1,
"Index": 0,
"DataNum": 1,
"PointNum": 4,
"Check": 38,
"Point": [
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
},
{
"x": 100,
"y": 100
}
]
}
def click_it(x, y):
pyautogui.moveTo(x, y)
pyautogui.click(x, y)
if __name__ == '__main__':
click_it(100, 100)

10
click_test.py Normal file
View File

@ -0,0 +1,10 @@
import pyautogui
def click_it(x, y):
pyautogui.moveTo(x, y)
pyautogui.click(x, y)
if __name__ == '__main__':
click_it(100, 100)

16
main.py
View File

@ -6,12 +6,18 @@ import pyautogui
import socket import socket
import threading import threading
from black import black_list
def click_it(x, y): def click_it(x, y):
pyautogui.moveTo(x, y) pyautogui.moveTo(x, y)
pyautogui.click(x, y) pyautogui.click(x, y)
def is_white(black):
return True
bind_ip = "127.0.0.1" # 监听的IP 地址 bind_ip = "127.0.0.1" # 监听的IP 地址
bind_port = 9999 # 监听的端口 bind_port = 9999 # 监听的端口
@ -24,8 +30,6 @@ server.bind((bind_ip, bind_port))
# 启动监听并设置连接数为5 # 启动监听并设置连接数为5
server.listen(5) server.listen(5)
print("[*] Listening on %s:%d" % (bind_ip, bind_port))
# 这是客户处理线程,也是一个回调函数,创建一个新的进程对象,将客户端套接字对象作为一个句柄传递给它。 # 这是客户处理线程,也是一个回调函数,创建一个新的进程对象,将客户端套接字对象作为一个句柄传递给它。
def handle_client(client_socket): def handle_client(client_socket):
@ -39,7 +43,8 @@ def handle_client(client_socket):
y = x_y["y"] y = x_y["y"]
click_it(x, y) click_it(x, y)
except Exception as e: except Exception as e:
print(e) # print(e)
pass
# 返还一个 ACK 在计算机网络中的意思是返回包确认,表示收到 # 返还一个 ACK 在计算机网络中的意思是返回包确认,表示收到
client_socket.send(b"ACK!") client_socket.send(b"ACK!")
client_socket.close() client_socket.close()
@ -52,11 +57,6 @@ while True:
# 运行到下面就被当作套接字传递给上面自定义的 handle_client 函数 # 运行到下面就被当作套接字传递给上面自定义的 handle_client 函数
client, addr = server.accept() client, addr = server.accept()
# 打印结果 在('127.0.0.1', 62549)中addr[0] -> 127.0.0.1addr[1] -> 62549
print("[*] Accepted connection from: %s:%d" % (addr[0], addr[1]))
# 挂起客户端线程,处理传入的数据。
# Thread是一个类创建一个新的线程对象target指定调用的函数args指定调用函数的参数是一个元组后面要加一个,
# 当调用start函数时就回去执行这个函数 # 当调用start函数时就回去执行这个函数
client_handler = threading.Thread(target=handle_client, args=(client,)) client_handler = threading.Thread(target=handle_client, args=(client,))

View File