diff --git a/fishy/__init__.py b/fishy/__init__.py index b7de9cf..a11ce4f 100644 --- a/fishy/__init__.py +++ b/fishy/__init__.py @@ -1,2 +1,2 @@ from fishy.__main__ import main -__version__ = "0.2.3" +__version__ = "0.2.5" diff --git a/fishy/__main__.py b/fishy/__main__.py index cc00c03..e8ad7dd 100644 --- a/fishy/__main__.py +++ b/fishy/__main__.py @@ -51,6 +51,7 @@ class Fishy: # check for game window and stuff self.gui.call(GUIFunction.STARTED, (True,)) + Thread(target=wait_and_check).start() while self.start: # Services to be ran in the start of the main loop Window.Loop() @@ -120,6 +121,13 @@ def initialize(c: Config, gui): rootLogger.addHandler(new_console) +def wait_and_check(): + time.sleep(10) + if not G.FishingStarted: + logging.info("\nDoesn't look like fishing has started\n" + "Make sure ProvisionsChalutier addon is visible on top left corner of the screen") + + def main(): c = Config() events_buffer = [] diff --git a/fishy/systems/fishing_event.py b/fishy/systems/fishing_event.py index 7ecb0c3..7bce3b2 100644 --- a/fishy/systems/fishing_event.py +++ b/fishy/systems/fishing_event.py @@ -110,6 +110,7 @@ class StickEvent(FishEvent): :param previousMode: previous mode in the state machine """ G.stickInitTime = time.time() + G.FishingStarted = True def onExitCallback(self, currentMode): pass diff --git a/fishy/systems/fishing_mode.py b/fishy/systems/fishing_mode.py index 48d43e6..cf966c3 100644 --- a/fishy/systems/fishing_mode.py +++ b/fishy/systems/fishing_mode.py @@ -16,7 +16,6 @@ class FishingMode: PrevLabel = -1 CurrentMode = None PrevMode = None - FishingStarted = False Modes = [] diff --git a/fishy/systems/globals.py b/fishy/systems/globals.py index f5a0937..634aec8 100644 --- a/fishy/systems/globals.py +++ b/fishy/systems/globals.py @@ -5,3 +5,4 @@ class G: fishCaught = 0 totalFishCaught = 0 stickInitTime = 0 + FishingStarted = False diff --git a/fishy/systems/helper.py b/fishy/systems/helper.py index 78e686c..c16e8cd 100644 --- a/fishy/systems/helper.py +++ b/fishy/systems/helper.py @@ -118,16 +118,17 @@ def get_data_file_path(rel_path): def create_shortcut(): - desktop = os.path.expanduser(r"~/Desktop/") - shutil.copy(get_data_file_path('FishybotESO.lnk'), os.path.join(desktop, "Fishybot ESO.lnk")) + user = os.path.expanduser("~") + shutil.copy(get_data_file_path('FishybotESO.lnk'), os.path.join(user, "Desktop", "Fishybot ESO.lnk")) logging.info("Shortcut created") def check_addon(): - addon_dir = os.path.expanduser(r"~/Documents/Elder Scrolls Online/live/Addons") - folder_path = os.path.join(addon_dir, 'ProvisionsChalutier') - if not os.path.exists(folder_path): + user = os.path.expanduser("~") + addon_dir = os.path.join(user, "Documents", "Elder Scrolls Online", "live", "Addons") + if not os.path.exists(os.path.join(addon_dir, 'ProvisionsChalutier')): logging.info("Addon not found, installing it...") with ZipFile(get_data_file_path("ProvisionsChalutier.zip"), 'r') as zip: zip.extractall(path=addon_dir) - logging.info("Please make sure you enable \"Allow outdated addons\" in-game") + logging.info("Please make sure you enable \"Allow outdated addons\" in-game\n" + "Also, make sure the addon is visible clearly on top left corner of the game window") diff --git a/requirements.txt b/requirements.txt index e82d9d5..57dc77e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ Pillow pypiwin32 ttkthemes pyautogui -requests \ No newline at end of file +requests +beautifulsoup4