hotfix: data not being send, when fishing is interupted

This commit is contained in:
Adam Saudagar 2021-04-21 21:50:28 +05:30
parent 01a8c50769
commit c86e86b901
2 changed files with 15 additions and 10 deletions

View File

@ -1,2 +1,2 @@
from fishy.__main__ import main
__version__ = "0.4.7"
__version__ = "0.4.9"

View File

@ -53,6 +53,15 @@ def if_eso_is_focused(func):
return wrapper
def _sound_and_send_fishy_data():
if FishEvent.fishCaught > 0:
web.send_hole_deplete(FishEvent.fishCaught, time.time() - FishEvent.hole_start_time, FishEvent.fish_times)
FishEvent.fishCaught = 0
if FishEvent.sound:
playsound(helper.manifest_file("sound.mp3"), False)
def init():
subscribe()
FishEvent.jitter = config.get("jitter", False)
@ -99,9 +108,12 @@ def fisher_callback(event: State):
def on_idle():
if FishEvent.previousState in (State.FISHING, State.REELIN):
logging.info("FISHING INTERRUPTED")
_sound_and_send_fishy_data()
if FishEvent.sound:
playsound(helper.manifest_file("sound.mp3"), False)
def on_depleted():
logging.info("HOLE DEPLETED")
_sound_and_send_fishy_data()
def on_lookaway():
@ -117,13 +129,6 @@ def on_looking():
keyboard.press_and_release(FishEvent.action_key)
def on_depleted():
logging.info("HOLE DEPLETED")
if FishEvent.fishCaught > 0:
web.send_hole_deplete(FishEvent.fishCaught, time.time() - FishEvent.hole_start_time, FishEvent.fish_times)
FishEvent.fishCaught = 0
def on_nobait():
msg = "No bait equipped!"
logging.info(msg)