mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge pull request #107 from fishyboteso/feature/menu_show_qr_value
This commit is contained in:
commit
3761ad813d
@ -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")
|
||||||
|
|
||||||
|
@ -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):
|
||||||
@ -63,9 +64,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:
|
||||||
skip_count += 1
|
skip_count += 1
|
||||||
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...")
|
||||||
@ -73,8 +74,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):
|
||||||
@ -84,16 +85,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()
|
||||||
|
|
||||||
|
@ -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)))
|
||||||
|
Loading…
Reference in New Issue
Block a user