Merge branch 'main' into feature/hotkey_fishyQR

This commit is contained in:
Adam Saudagar 2022-02-25 04:56:29 +05:30 committed by GitHub
commit a80e1ee84b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 14 deletions

View File

@ -21,7 +21,7 @@ class IEngineHandler:
def toggle_fullfisher(self): def toggle_fullfisher(self):
... ...
def check_pixel_val(self): def check_qr_val(self):
... ...
def set_update(self, version): def set_update(self, version):
@ -56,10 +56,10 @@ class EngineEventHandler(IEngineHandler):
def toggle_fullfisher(self): def toggle_fullfisher(self):
self.event.append(self.full_fisher_engine.toggle_start) self.event.append(self.full_fisher_engine.toggle_start)
def check_pixel_val(self): def check_qr_val(self):
def func(): def func():
if self.semi_fisher_engine.start: if self.semi_fisher_engine.start:
self.semi_fisher_engine.show_pixel_vals() self.semi_fisher_engine.show_qr_vals()
else: else:
logging.debug("Start the engine first before running this command") logging.debug("Start the engine first before running this command")

View File

@ -21,6 +21,7 @@ class SemiFisherEngine(IEngine):
def __init__(self, gui_ref: Optional['Callable[[], GUI]']): def __init__(self, gui_ref: Optional['Callable[[], GUI]']):
super().__init__(gui_ref) super().__init__(gui_ref)
self.window = None self.window = None
self.values = None
self.name = "SemiFisher" self.name = "SemiFisher"
def run(self): def run(self):
@ -64,9 +65,9 @@ class SemiFisherEngine(IEngine):
return return
# crop qr and get the values from it # crop qr and get the values from it
values = get_values_from_image(capture) self.values = get_values_from_image(capture)
# if fishyqr fails to get read multiple times, stop the bot # if fishyqr fails to get read multiple times, stop the bot
if not values: if not self.values:
if skip_count >= 5: if skip_count >= 5:
logging.error("Couldn't read values from FishyQR, Stopping engine...") logging.error("Couldn't read values from FishyQR, Stopping engine...")
return return
@ -75,8 +76,8 @@ class SemiFisherEngine(IEngine):
else: else:
skip_count = 0 skip_count = 0
if values: if self.values:
fishing_mode.loop(values[3]) fishing_mode.loop(self.values[3])
time.sleep(0.1) time.sleep(0.1)
def _wait_and_check(self): def _wait_and_check(self):
@ -86,16 +87,17 @@ class SemiFisherEngine(IEngine):
"Check out #faqs on our discord channel to troubleshoot the issue") "Check out #faqs on our discord channel to troubleshoot the issue")
# TODO: remove this, no longer needed # TODO: remove this, no longer needed
def show_pixel_vals(self): def show_qr_vals(self):
def show(): def show():
freq = 0.5 freq = 0.5
t = 0 t = 0
while t < 10.0: while t < 25.0:
t += freq t += freq
logging.debug(str(FishingMode.CurrentMode) + ":" + str(self.window.get_capture()[0][0])) logging.info(str(self.values))
time.sleep(freq) time.sleep(freq)
logging.info("Displaying QR values stopped")
logging.debug("Will display pixel values for 10 seconds") logging.info("Will display QR values for 25 seconds")
time.sleep(5) time.sleep(5)
Thread(target=show, args=()).start() Thread(target=show, args=()).start()

View File

@ -34,7 +34,7 @@ class FishEvent:
sound = False sound = False
def _fishing_sleep(waittime, lower_limit_ms=16, upper_limit_ms=2500): def _fishing_sleep(waittime, lower_limit_ms=16, upper_limit_ms=1375):
reaction = 0.0 reaction = 0.0
if FishEvent.jitter and upper_limit_ms > lower_limit_ms: if FishEvent.jitter and upper_limit_ms > lower_limit_ms:
reaction = float(random.randrange(lower_limit_ms, upper_limit_ms)) / 1000.0 reaction = float(random.randrange(lower_limit_ms, upper_limit_ms)) / 1000.0

View File

@ -75,8 +75,8 @@ def _create(gui: 'GUI'):
menubar.add_cascade(label="Options", menu=filemenu) menubar.add_cascade(label="Options", menu=filemenu)
debug_menu = tk.Menu(menubar, tearoff=0) debug_menu = tk.Menu(menubar, tearoff=0)
debug_menu.add_command(label="Check PixelVal", debug_menu.add_command(label="Check QR Value",
command=lambda: gui.engine.check_pixel_val()) command=lambda: gui.engine.check_qr_val())
debug_var = tk.IntVar() debug_var = tk.IntVar()
debug_var.set(int(config.get('debug', False))) debug_var.set(int(config.get('debug', False)))