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