0.2.5 fixed path joining error for shortcut and addon

- added a warning for addon not visible
- added requests and bs4 in requirements
This commit is contained in:
DESKTOP-JVKHS7I\Adam 2020-04-20 18:33:44 +05:30
parent 6a708e55e6
commit 7361cc46ee
7 changed files with 20 additions and 9 deletions

View File

@ -1,2 +1,2 @@
from fishy.__main__ import main
__version__ = "0.2.3"
__version__ = "0.2.5"

View File

@ -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 = []

View File

@ -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

View File

@ -16,7 +16,6 @@ class FishingMode:
PrevLabel = -1
CurrentMode = None
PrevMode = None
FishingStarted = False
Modes = []

View File

@ -5,3 +5,4 @@ class G:
fishCaught = 0
totalFishCaught = 0
stickInitTime = 0
FishingStarted = False

View File

@ -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")

View File

@ -5,4 +5,5 @@ Pillow
pypiwin32
ttkthemes
pyautogui
requests
requests
beautifulsoup4