This commit is contained in:
xyj 2024-03-09 14:47:48 +08:00
parent c50e2ab71f
commit 9cf915058b
3 changed files with 16 additions and 12 deletions

Binary file not shown.

View File

@ -1,5 +1,5 @@
black_list = { black_list = [
0: { {
"Type": 1, "Type": 1,
"Index": 0, "Index": 0,
"DataNum": 1, "DataNum": 1,
@ -24,4 +24,4 @@ black_list = {
} }
] ]
} }
} ]

24
main.py
View File

@ -14,7 +14,7 @@ def click_it(x, y):
pyautogui.click(x, y) pyautogui.click(x, y)
def is_white(black): def is_black(black):
return True return True
@ -37,17 +37,21 @@ def handle_client(client_socket):
data = client_socket.recv(1024) data = client_socket.recv(1024)
try: try:
data = data.decode("utf-8") data = data.decode("utf-8")
Point = json.loads(data)["Point"] data = json.loads(data)
x_y = Point[0] print(data)
x = x_y["x"] for v in black_list:
y = x_y["y"] if is_black(v):
click_it(x, y) print("黑名单")
except Exception as e:
# print(e)
pass
# 返还一个 ACK 在计算机网络中的意思是返回包确认,表示收到
client_socket.send(b"ACK!") client_socket.send(b"ACK!")
client_socket.close() client_socket.close()
return
Point = data["Point"]
x = Point[0]["x"]
y = Point[0]["y"]
print(x, y)
click_it(x, y)
except Exception as e:
pass
# 等待连接,这里必定进入循环 # 等待连接,这里必定进入循环