Quote:
import pydirectinput
import pyautogui
from scapy.all import *
import time
def click_space(count):
for _ in range(count):
pydirectinput.press('space')
print(f"Kliknięto spację {count} razy.")
def count_click_space(packet):
global searching_packet, click_count
if TCP in packet and Raw in packet:
raw_data = packet[Raw].load.decode('utf-8', 'ignore') #
if "Kliknij" in raw_data:
split_data = raw_data.split("Kliknij", 1)
if len(split_data) > 1:
after_click = split_data[1]
razy_index = after_click.find(" razy")
if razy_index != -1:
x_str = ""
for i in range(razy_index - 1, -1, -1):
if not after_click[i].isdigit():
break
x_str = after_click[i] + x_str
x = int(x_str)
if x > 0:
click_space(x)
searching_packet = False
click_count = 0
time.sleep(4)
else:
print("Nie znaleziono frazy 'x razy' po 'Kliknij spację' w pakiecie.")
else:
print("Nie znaleziono 'Kliknij spację' w pakiecie.")
searching_packet = True
click_count = 0
# Przechwyć pakiety TCP na porcie 20401
while True:
if searching_packet:
sniff(filter="(tcp src port 20601) and (tcp dst port 64089)", prn=count_click_space, count=1, store=0)
click_count += 1
else:
time.sleep(1)
click_count += 1
if click_count >= 3:
searching_packet = True
click_count = 0
time.sleep(random.randint(3, 5))
pydirectinput.press('2')
time.sleep(1)
pydirectinput.press('space')
time.sleep(random.randint(3, 5))
I managed to write a code that downloads from a package in wireshark how many times it has to click spaces. Fishing involves randomly clicking the space bar in the game, from 1 to 5. Is there any way to make this program work on several eyes at the same time? because now it only works on the active window. Is anyone able to change or suggest how to make this program work on pygame or something else with a .dll injector?