From 10cbd899f81404bb68d6d536954010e5199a0c01 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Tue, 13 Apr 2021 20:22:55 +0530 Subject: [PATCH 1/8] removed ocr things, using blob detection to find qr code, using qr code to get data from eso --- fishy/engine/fullautofisher/calibrate.py | 14 +----- fishy/engine/fullautofisher/controls.py | 2 +- fishy/engine/fullautofisher/engine.py | 28 +++++------ fishy/engine/fullautofisher/qr_detection.py | 51 +++++++++++++++++++++ fishy/engine/fullautofisher/tesseract.py | 50 -------------------- fishy/helper/downloader.py | 31 ------------- requirements.txt | 1 - 7 files changed, 64 insertions(+), 113 deletions(-) create mode 100644 fishy/engine/fullautofisher/qr_detection.py delete mode 100644 fishy/engine/fullautofisher/tesseract.py delete mode 100644 fishy/helper/downloader.py diff --git a/fishy/engine/fullautofisher/calibrate.py b/fishy/engine/fullautofisher/calibrate.py index f9e6b0b..de01b3b 100644 --- a/fishy/engine/fullautofisher/calibrate.py +++ b/fishy/engine/fullautofisher/calibrate.py @@ -52,11 +52,6 @@ class Calibrate: self._callibrate_state = -1 self.engine = engine - # region getters - @property - def crop(self): - return _get_factor("crop") - @property def move_factor(self): return _get_factor("move_factor") @@ -72,18 +67,11 @@ class Calibrate: # endregion def all_callibrated(self): - return self.crop is not None and self.move_factor is not None and self.rot_factor is not None + return self.move_factor is not None and self.rot_factor is not None def toggle_show(self): self.engine.show_crop = not self.engine.show_crop - def update_crop(self, enable_crop=True): - if enable_crop: - self.engine.show_crop = True - crop = get_crop_coods(self.engine.window) - _update_factor("crop", crop) - self.engine.window.crop = crop - def walk_calibrate(self): walking_time = 3 diff --git a/fishy/engine/fullautofisher/controls.py b/fishy/engine/fullautofisher/controls.py index 7708a4b..1ee275d 100644 --- a/fishy/engine/fullautofisher/controls.py +++ b/fishy/engine/fullautofisher/controls.py @@ -17,7 +17,7 @@ def get_controls(engine: FullAuto): Key.DOWN: (Recorder(engine).toggle_recording, "start/stop record"), }), ("CALIBRATE", { - Key.RIGHT: (engine.calibrate.update_crop, "cropping"), + Key.RIGHT: (None, ""), Key.UP: (engine.calibrate.walk_calibrate, "walking"), Key.LEFT: (engine.calibrate.rotate_calibrate, "rotation"), Key.DOWN: (engine.calibrate.time_to_reach_bottom_callibrate, "look up down") diff --git a/fishy/engine/fullautofisher/engine.py b/fishy/engine/fullautofisher/engine.py index 0c9dcfa..a775266 100644 --- a/fishy/engine/fullautofisher/engine.py +++ b/fishy/engine/fullautofisher/engine.py @@ -14,8 +14,7 @@ import time import numpy as np import pytesseract -from fishy.engine.fullautofisher.tesseract import is_tesseract_installed, downlaoad_and_extract_tesseract, \ - get_values_from_image +from fishy.engine.fullautofisher.qr_detection import get_values_from_image, get_qr_location from fishy.engine.semifisher.fishing_mode import FishingMode from fishy.engine import SemiFisherEngine @@ -27,7 +26,6 @@ from pynput import keyboard, mouse from fishy.helper import hotkey, helper from fishy.helper.config import config -from fishy.helper.downloader import download_file_from_google_drive from fishy.helper.helper import sign from fishy.helper.hotkey import Key @@ -36,12 +34,11 @@ kb = keyboard.Controller() def image_pre_process(img): - scale_percent = 200 # percent of original size + scale_percent = 100 # percent of original size width = int(img.shape[1] * scale_percent / 100) height = int(img.shape[0] * scale_percent / 100) dim = (width, height) img = cv2.resize(img, dim, interpolation=cv2.INTER_AREA) - img = cv2.bitwise_not(img) return img @@ -73,7 +70,6 @@ class FullAuto(IEngine): self.show_crop = False def run(self): - self.show_crop = False FullAuto.state = State.NONE self.gui.bot_started(True) @@ -83,21 +79,19 @@ class FullAuto(IEngine): self.window = WindowClient(color=cv2.COLOR_RGB2GRAY, show_name="Full auto debug") try: - if self.calibrate.crop is None: - self.calibrate.update_crop(enable_crop=False) - self.window.crop = self.calibrate.crop - - if not is_tesseract_installed(): - logging.info("tesseract not found") - downlaoad_and_extract_tesseract() + self.window.crop = get_qr_location(self.window.get_capture()) + if self.window.crop is None: + print("FishyQR not found") + self.start = False if not self.calibrate.all_callibrated(): logging.error("you need to callibrate first") self.controls.initialize() while self.start and WindowClient.running(): - self.window.show(self.show_crop, func=image_pre_process) - if not self.show_crop: + if self.show_crop: + self.window.show(self.show_crop, func=image_pre_process) + else: time.sleep(0.1) except: traceback.print_exc() @@ -173,11 +167,11 @@ class FullAuto(IEngine): def look_for_hole(self): self._hole_found_flag = False - if FishingMode.CurrentMode == fishing_mode.State.LOOK: + if FishingMode.CurrentMode == fishing_mode.State.LOOKING: return True def found_hole(e): - if e == fishing_mode.State.LOOK: + if e == fishing_mode.State.LOOKING: self._hole_found_flag = True fishing_mode.subscribers.append(found_hole) diff --git a/fishy/engine/fullautofisher/qr_detection.py b/fishy/engine/fullautofisher/qr_detection.py new file mode 100644 index 0000000..8dedac5 --- /dev/null +++ b/fishy/engine/fullautofisher/qr_detection.py @@ -0,0 +1,51 @@ +import logging +import os +from datetime import datetime + +import cv2 + +from fishy.helper.helper import get_documents + +import numpy as np +from pyzbar.pyzbar import decode + + +def get_qr_location(og_img): + """ + code from https://stackoverflow.com/a/45770227/4512396 + """ + gray = cv2.bilateralFilter(og_img, 11, 17, 17) + kernel = np.ones((5, 5), np.uint8) + erosion = cv2.erode(gray, kernel, iterations=2) + kernel = np.ones((4, 4), np.uint8) + img = cv2.dilate(erosion, kernel, iterations=2) + + cnt, h = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + + valid_crops = [] + for i in range(len(cnt)): + area = cv2.contourArea(cnt[i]) + if 500 < area < 100000: + mask = np.zeros_like(img) + cv2.drawContours(mask, cnt, i, 255, -1) + x, y, w, h = cv2.boundingRect(cnt[i]) + qr_result = decode(og_img[y:h + y, x:w + x]) + if qr_result: + valid_crops.append(((x, y, x + w, y + h), area)) + + return min(valid_crops, key=lambda c: c[1])[0] if valid_crops else None + + +# noinspection PyBroadException +def get_values_from_image(img): + try: + for qr in decode(img): + vals = qr.data.decode('utf-8').split(",") + return float(vals[0]), float(vals[1]), float(vals[2]) + + logging.error("FishyQR not found, try restarting the engine") + return None + except Exception: + logging.error("Couldn't read coods, make sure 'crop' calibration is correct") + cv2.imwrite(os.path.join(get_documents(), "fishy_failed_reads", f"{datetime.now()}.jpg"), img) + return None diff --git a/fishy/engine/fullautofisher/tesseract.py b/fishy/engine/fullautofisher/tesseract.py deleted file mode 100644 index 8576387..0000000 --- a/fishy/engine/fullautofisher/tesseract.py +++ /dev/null @@ -1,50 +0,0 @@ -import logging -import os -import tempfile -import uuid -from datetime import datetime -from zipfile import ZipFile - -import cv2 - -import pytesseract - -from fishy.helper.downloader import download_file_from_google_drive -from fishy.helper.helper import get_documents - -directory = os.path.join(os.environ["APPDATA"], "Tesseract-OCR") - - -def downlaoad_and_extract_tesseract(): - logging.info("Tesseract-OCR downlaoding, Please wait...") - - f = tempfile.NamedTemporaryFile(delete=False) - download_file_from_google_drive("16llzcBlaCsG9fm-rY2dD4Gvopnhm3XoE", f) - f.close() - - logging.info("Tesseract-OCR downloaded, now installing") - - with ZipFile(f.name, 'r') as z: - z.extractall(path=directory) - - logging.info("Tesseract-OCR installed") - - -def is_tesseract_installed(): - return os.path.exists(os.path.join(os.environ["APPDATA"], "Tesseract-OCR")) - - -# noinspection PyBroadException -def get_values_from_image(img): - try: - pytesseract.pytesseract.tesseract_cmd = directory + '/tesseract.exe' - tessdata_dir_config = f'--tessdata-dir "{directory}" -c tessedit_char_whitelist=0123456789.' - - text = pytesseract.image_to_string(img, lang="eng", config=tessdata_dir_config) - text = text.replace(" ", "") - vals = text.split(":") - return float(vals[0]), float(vals[1]), float(vals[2]) - except Exception: - logging.error("Couldn't read coods, make sure 'crop' calibration is correct") - cv2.imwrite(os.path.join(get_documents(), "fishy_failed_reads", f"{datetime.now()}.jpg"), img) - return None diff --git a/fishy/helper/downloader.py b/fishy/helper/downloader.py deleted file mode 100644 index 5c08fb7..0000000 --- a/fishy/helper/downloader.py +++ /dev/null @@ -1,31 +0,0 @@ -import requests - - -def download_file_from_google_drive(id, file): - URL = "https://docs.google.com/uc?export=download" - - session = requests.Session() - - response = session.get(URL, params={'id': id}, stream=True) - token = get_confirm_token(response) - - if token: - params = {'id': id, 'confirm': token} - response = session.get(URL, params=params, stream=True) - - save_response_content(response, file) - - -def get_confirm_token(response): - for key, value in response.cookies.items(): - if key.startswith('download_warning'): - return value - - return None - - -def save_response_content(response, f): - CHUNK_SIZE = 32768 - for chunk in response.iter_content(CHUNK_SIZE): - if chunk: # filter out keep-alive new chunks - f.write(chunk) diff --git a/requirements.txt b/requirements.txt index 59394a0..c88d6c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,6 @@ requests beautifulsoup4 whatsmyip pynput -pytesseract keyboard playsound event-scheduler \ No newline at end of file From 96db413f61291a679beaa7a79898308b7153597a Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:01:19 +0530 Subject: [PATCH 2/8] renamed calibrate class to calibrator, removed updown calibration process, changed controls accordingly --- .../{calibrate.py => calibrator.py} | 34 ++++--------------- fishy/engine/fullautofisher/controls.py | 12 ++----- fishy/engine/fullautofisher/engine.py | 30 ++++++++-------- 3 files changed, 25 insertions(+), 51 deletions(-) rename fishy/engine/fullautofisher/{calibrate.py => calibrator.py} (75%) diff --git a/fishy/engine/fullautofisher/calibrate.py b/fishy/engine/fullautofisher/calibrator.py similarity index 75% rename from fishy/engine/fullautofisher/calibrate.py rename to fishy/engine/fullautofisher/calibrator.py index de01b3b..237751a 100644 --- a/fishy/engine/fullautofisher/calibrate.py +++ b/fishy/engine/fullautofisher/calibrator.py @@ -47,7 +47,7 @@ def _get_factor(key): return config.get("full_auto_factors", {}).get(key) -class Calibrate: +class Calibrator: def __init__(self, engine: FullAuto): self._callibrate_state = -1 self.engine = engine @@ -60,10 +60,6 @@ class Calibrate: def rot_factor(self): return _get_factor("rot_factor") - @property - def time_to_reach_bottom(self): - return _get_factor("time_to_reach_bottom") - # endregion def all_callibrated(self): @@ -72,7 +68,7 @@ class Calibrate: def toggle_show(self): self.engine.show_crop = not self.engine.show_crop - def walk_calibrate(self): + def _walk_calibrate(self): walking_time = 3 coods = self.engine.get_coods() @@ -95,7 +91,7 @@ class Calibrate: _update_factor("move_factor", move_factor) logging.info("done") - def rotate_calibrate(self): + def _rotate_calibrate(self): rotate_times = 50 coods = self.engine.get_coods() @@ -119,25 +115,7 @@ class Calibrate: _update_factor("rot_factor", rot_factor) logging.info("done") - def time_to_reach_bottom_callibrate(self): - self._callibrate_state = 0 + def calibrate(self): + self._walk_calibrate() + self._rotate_calibrate() - def _f8_pressed(): - self._callibrate_state += 1 - - logging.info("look straight up and press f8") - hotkey.set_hotkey(Key.F8, _f8_pressed) - - wait_until(lambda: self._callibrate_state == 1) - - logging.info("as soon as you look on the floor, press f8 again") - - y_cal_start_time = time.time() - while self._callibrate_state == 1: - mse.move(0, FullAuto.rotate_by) - time.sleep(0.05) - hotkey.free_key(Key.F8) - - time_to_reach_bottom = time.time() - y_cal_start_time - _update_factor("time_to_reach_bottom", time_to_reach_bottom) - logging.info("done") diff --git a/fishy/engine/fullautofisher/controls.py b/fishy/engine/fullautofisher/controls.py index 1ee275d..979ddc7 100644 --- a/fishy/engine/fullautofisher/controls.py +++ b/fishy/engine/fullautofisher/controls.py @@ -11,16 +11,10 @@ def get_controls(engine: FullAuto): from fishy.engine.fullautofisher.player import Player controls = [ ("MODE_SELECT", { - Key.RIGHT: (lambda: engine.controls.select_mode("CALIBRATE"), "calibrate mode"), - Key.UP: (lambda: engine.controls.select_mode("TEST1"), "test mode"), + Key.RIGHT: (Recorder(engine).toggle_recording, "start/stop record"), + Key.UP: (engine.calibrator.calibrate, "calibrate mode"), Key.LEFT: (Player(engine).toggle_move, "start/stop play"), - Key.DOWN: (Recorder(engine).toggle_recording, "start/stop record"), - }), - ("CALIBRATE", { - Key.RIGHT: (None, ""), - Key.UP: (engine.calibrate.walk_calibrate, "walking"), - Key.LEFT: (engine.calibrate.rotate_calibrate, "rotation"), - Key.DOWN: (engine.calibrate.time_to_reach_bottom_callibrate, "look up down") + Key.DOWN: (lambda: engine.controls.select_mode("TEST1"), "test mode"), }), ("TEST1", { Key.RIGHT: (engine.test.print_coods, "print coordinates"), diff --git a/fishy/engine/fullautofisher/engine.py b/fishy/engine/fullautofisher/engine.py index a775266..c929bbc 100644 --- a/fishy/engine/fullautofisher/engine.py +++ b/fishy/engine/fullautofisher/engine.py @@ -14,6 +14,7 @@ import time import numpy as np import pytesseract +from fishy.constants import libgps, fishyqr, lam2 from fishy.engine.fullautofisher.qr_detection import get_values_from_image, get_qr_location from fishy.engine.semifisher.fishing_mode import FishingMode @@ -24,9 +25,9 @@ from fishy.engine.semifisher import fishing_mode, fishing_event from fishy.engine.common.IEngine import IEngine from pynput import keyboard, mouse -from fishy.helper import hotkey, helper +from fishy.helper import hotkey, helper, hotkey_process from fishy.helper.config import config -from fishy.helper.helper import sign +from fishy.helper.helper import sign, addon_exists from fishy.helper.hotkey import Key mse = mouse.Controller() @@ -56,7 +57,7 @@ class FullAuto(IEngine): def __init__(self, gui_ref): from fishy.engine.fullautofisher.controls import Controls from fishy.engine.fullautofisher import controls - from fishy.engine.fullautofisher.calibrate import Calibrate + from fishy.engine.fullautofisher.calibrator import Calibrator from fishy.engine.fullautofisher.test import Test super().__init__(gui_ref) @@ -64,7 +65,7 @@ class FullAuto(IEngine): self._curr_rotate_y = 0 self.fisher = SemiFisherEngine(None) - self.calibrate = Calibrate(self) + self.calibrator = Calibrator(self) self.test = Test(self) self.controls = Controls(controls.get_controls(self)) self.show_crop = False @@ -73,19 +74,20 @@ class FullAuto(IEngine): FullAuto.state = State.NONE self.gui.bot_started(True) - fishing_event.unsubscribe() - self.fisher.toggle_start() - self.window = WindowClient(color=cv2.COLOR_RGB2GRAY, show_name="Full auto debug") try: self.window.crop = get_qr_location(self.window.get_capture()) if self.window.crop is None: - print("FishyQR not found") + logging.warning("FishyQR not found") self.start = False + raise Exception("FishyQR not found") - if not self.calibrate.all_callibrated(): - logging.error("you need to callibrate first") + if not self.calibrator.all_callibrated(): + logging.error("you need to calibrate first") + + self.fisher.toggle_start() + fishing_event.unsubscribe() self.controls.initialize() while self.start and WindowClient.running(): @@ -115,7 +117,7 @@ class FullAuto(IEngine): logging.error("set target first") return - if not self.calibrate.all_callibrated(): + if not self.calibrator.all_callibrated(): logging.error("you need to callibrate first") return @@ -134,7 +136,7 @@ class FullAuto(IEngine): self.rotate_to(target_angle, from_angle) - walking_time = dist / self.calibrate.move_factor + walking_time = dist / self.calibrator.move_factor print(f"walking for {walking_time}") kb.press('w') time.sleep(walking_time) @@ -156,7 +158,7 @@ class FullAuto(IEngine): if abs(angle_diff) > 180: angle_diff = (360 - abs(angle_diff)) * sign(angle_diff) * -1 - rotate_times = int(angle_diff / self.calibrate.rot_factor) * -1 + rotate_times = int(angle_diff / self.calibrator.rot_factor) * -1 print(f"rotate_times: {rotate_times}") @@ -177,7 +179,7 @@ class FullAuto(IEngine): fishing_mode.subscribers.append(found_hole) t = 0 - while not self._hole_found_flag and t <= self.calibrate.time_to_reach_bottom / 3: + while not self._hole_found_flag and t <= 4.47: mse.move(0, FullAuto.rotate_by) time.sleep(0.05) t += 0.05 From babcdd262abc4c208c27cbe036ee33e9a420543b Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:02:20 +0530 Subject: [PATCH 3/8] created multiprocess solution for mouse click callback for recording --- fishy/engine/fullautofisher/recorder.py | 7 ++-- fishy/helper/hotkey_process.py | 46 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 fishy/helper/hotkey_process.py diff --git a/fishy/engine/fullautofisher/recorder.py b/fishy/engine/fullautofisher/recorder.py index 9355817..279f69b 100644 --- a/fishy/engine/fullautofisher/recorder.py +++ b/fishy/engine/fullautofisher/recorder.py @@ -6,8 +6,8 @@ from tkinter.filedialog import asksaveasfile from fishy.engine.fullautofisher.engine import FullAuto, State -from fishy.helper import hotkey from fishy.helper.hotkey import Key +from fishy.helper.hotkey_process import HotKey class Recorder: @@ -35,7 +35,8 @@ class Recorder: def _start_recording(self): FullAuto.state = State.RECORDING logging.info("starting, press f8 to mark hole") - hotkey.set_hotkey(Recorder.mark_hole_key, self._mark_hole) + hk = HotKey() + hk.start_process(self._mark_hole) self.timeline = [] @@ -52,7 +53,7 @@ class Recorder: else: logging.warning("Took too much time to record") - hotkey.free_key(Recorder.mark_hole_key) + hk.stop() def func(): _file = None diff --git a/fishy/helper/hotkey_process.py b/fishy/helper/hotkey_process.py new file mode 100644 index 0000000..ad8313b --- /dev/null +++ b/fishy/helper/hotkey_process.py @@ -0,0 +1,46 @@ +import time +from threading import Thread + +import mouse +from multiprocessing import Process, Queue + + +def event_triggered(queue, e): + if not (type(e) == mouse.ButtonEvent and e.event_type == "up" and e.button == "left"): + return + + # call the parent function here + queue.put("left click") + + +def run(inq, outq): + mouse.hook(lambda e: event_triggered(outq, e)) + + stop = False + while not stop: + time.sleep(1) + if inq.get() == "stop": + stop = True + + +class HotKey: + def __init__(self): + self.inq = Queue() + self.outq = Queue() + + self.process = Process(target=run, args=(self.inq, self.outq)) + + def event_loop(self, func): + while True: + msg = self.outq.get() + if msg == "left click": + func() + + def start_process(self, func): + self.process.start() + Thread(target=self.event_loop, args=(func,)).start() + + def stop(self): + self.inq.put("stop") + self.process.join() + print("hotkey process ended") From 2dfaa19adc677f72decd2b272dca7643111b37fa Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:02:44 +0530 Subject: [PATCH 4/8] added pyzbar and mouse modules to requirement --- requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c88d6c4..a9b939c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,6 @@ whatsmyip pynput keyboard playsound -event-scheduler \ No newline at end of file +event-scheduler +pyzbar +mouse From ce1bc0391b26f1c219ceb490e96f2ca66cf6c165 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:03:27 +0530 Subject: [PATCH 5/8] added fishyqr and libgps addons download in constants --- fishy/constants.py | 3 +++ fishy/engine/fullautofisher/engine.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/fishy/constants.py b/fishy/constants.py index 78c59ae..7f48ab7 100644 --- a/fishy/constants.py +++ b/fishy/constants.py @@ -1,3 +1,6 @@ apiversion = 2 chalutier = ("Chalutier", "https://github.com/fishyboteso/Chalutier/raw/619b4ab0b8ff91746afda855542e886d27b7a794/Chalutier_1.1.2.zip", 112) lam2 = ("LibAddonMenu-2.0", "https://www.esoui.com/downloads/dl7/LibAddonMenu-2.0r32.zip", 32) + +fishyqr = ("FishyQR", "https://github.com/fishyboteso/FishyQR/files/6329586/FishyQR.zip", 1) +libgps = ("LibAddonMenu-2.0", "https://cdn.esoui.com/downloads/file601/LibGPS_3_0_3.zip", 1) diff --git a/fishy/engine/fullautofisher/engine.py b/fishy/engine/fullautofisher/engine.py index c929bbc..787139e 100644 --- a/fishy/engine/fullautofisher/engine.py +++ b/fishy/engine/fullautofisher/engine.py @@ -71,6 +71,12 @@ class FullAuto(IEngine): self.show_crop = False def run(self): + + addons_req = [libgps, lam2, fishyqr] + for addon in addons_req: + if not helper.addon_exists(*addon): + helper.install_addon(*addon) + FullAuto.state = State.NONE self.gui.bot_started(True) From c05355fb7737d255c5b3ff4e43687ac0d44b40e0 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:04:10 +0530 Subject: [PATCH 6/8] don't warn about fishing not started if it's not attached to gui (to avoid it showing in fullauto) --- fishy/engine/semifisher/engine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fishy/engine/semifisher/engine.py b/fishy/engine/semifisher/engine.py index 0113083..cf7e8c5 100644 --- a/fishy/engine/semifisher/engine.py +++ b/fishy/engine/semifisher/engine.py @@ -38,7 +38,8 @@ class SemiFisherEngine(IEngine): if self.get_gui: logging.info("Starting the bot engine, look at the fishing hole to start fishing") - Thread(target=self._wait_and_check).start() + Thread(target=self._wait_and_check).start() + while self.start and WindowClient.running(): capture = self.fishPixWindow.get_capture() @@ -59,7 +60,7 @@ class SemiFisherEngine(IEngine): def _wait_and_check(self): time.sleep(10) if not FishEvent.FishingStarted and self.start: - logging.warn("Doesn't look like fishing has started \nCheck out #read-me-first on our discord channel to troubleshoot the issue") + logging.warning("Doesn't look like fishing has started \nCheck out #read-me-first on our discord channel to troubleshoot the issue") def show_pixel_vals(self): def show(): From 1b30bc3c820b0793eb655253497efdf8b88147e9 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sat, 17 Apr 2021 22:54:12 +0530 Subject: [PATCH 7/8] changed look up down timing, added log message for when player starts --- fishy/engine/fullautofisher/engine.py | 2 +- fishy/engine/fullautofisher/player.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fishy/engine/fullautofisher/engine.py b/fishy/engine/fullautofisher/engine.py index 787139e..8316bd1 100644 --- a/fishy/engine/fullautofisher/engine.py +++ b/fishy/engine/fullautofisher/engine.py @@ -185,7 +185,7 @@ class FullAuto(IEngine): fishing_mode.subscribers.append(found_hole) t = 0 - while not self._hole_found_flag and t <= 4.47: + while not self._hole_found_flag and t <= 1.25: mse.move(0, FullAuto.rotate_by) time.sleep(0.05) t += 0.05 diff --git a/fishy/engine/fullautofisher/player.py b/fishy/engine/fullautofisher/player.py index be00b28..402ebb8 100644 --- a/fishy/engine/fullautofisher/player.py +++ b/fishy/engine/fullautofisher/player.py @@ -49,11 +49,14 @@ class Player: self.hole_complete_flag = True def _start_route(self): - FullAuto.state = State.PLAYING timeline = _get_rec_file() if not timeline: + logging.log("data not found, can't start") return + FullAuto.state = State.PLAYING + logging.info("starting to move") + forward = True i = 0 while self.start_moving_flag: From 54406cf12000a574c5bead4d07a1470100aa0286 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Sun, 18 Apr 2021 11:59:41 +0530 Subject: [PATCH 8/8] corrected addons versions --- fishy/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fishy/constants.py b/fishy/constants.py index 7f48ab7..20ae28b 100644 --- a/fishy/constants.py +++ b/fishy/constants.py @@ -2,5 +2,5 @@ apiversion = 2 chalutier = ("Chalutier", "https://github.com/fishyboteso/Chalutier/raw/619b4ab0b8ff91746afda855542e886d27b7a794/Chalutier_1.1.2.zip", 112) lam2 = ("LibAddonMenu-2.0", "https://www.esoui.com/downloads/dl7/LibAddonMenu-2.0r32.zip", 32) -fishyqr = ("FishyQR", "https://github.com/fishyboteso/FishyQR/files/6329586/FishyQR.zip", 1) -libgps = ("LibAddonMenu-2.0", "https://cdn.esoui.com/downloads/file601/LibGPS_3_0_3.zip", 1) +fishyqr = ("FishyQR", "https://github.com/fishyboteso/FishyQR/files/6329586/FishyQR.zip", 100) +libgps = ("LibGPS", "https://cdn.esoui.com/downloads/file601/LibGPS_3_0_3.zip", 30)