fixup rebase and max waittime

This commit is contained in:
Semjon Kerner 2020-12-13 20:13:15 +01:00
parent d0e170c6b5
commit 38df271376
2 changed files with 9 additions and 8 deletions

View File

@ -34,11 +34,12 @@ class FishEvent:
uid = None
sound = False
def _fishing_sleep(waittime, lower_limit = 16, upper_limit = 58):
def _fishing_sleep(waittime, lower_limit_ms = 16, upper_limit_ms = 2500):
reaction = 0.0
if (FishEvent.jitter):
reaction = float( random.randrange(lower_limit, upper_limit) )/100.0
time.sleep(waittime+reaction)
if (FishEvent.jitter and (upper_limit_ms > lower_limit_ms)):
reaction = float( random.randrange(lower_limit_ms, upper_limit_ms) )/1000.0
max_wait_t = waittime+reaction if (waittime+reaction <= 2.5) else 2.5
time.sleep(max_wait_t)
def init():
@ -82,14 +83,14 @@ def on_hook():
FishEvent.fish_times.append(time_to_hook)
logging.info("HOOOOOOOOOOOOOOOOOOOOOOOK....... " + str(FishEvent.fishCaught) + " caught " + "in " + str(
round(time_to_hook, 2)) + " secs. " + "Total: " + str(FishEvent.totalFishCaught))
_fishing_sleep(0.0)
keyboard.press_and_release(FishEvent.action_key)
if FishEvent.collect_allow_auto:
_fishing_sleep(0.1)
keyboard.press_and_release('r')
_fishing_sleep(0.1)
_fishing_sleep(0.0, upper_limit=48)
_fishing_sleep(0.0)
def on_look():

View File

@ -108,9 +108,9 @@ def start_semifisher_config(gui: 'GUI'):
sound = Checkbutton(controls_frame, var=BooleanVar(value=config.get("sound_notification")))
sound.grid(row=5, column=1)
Label(controls_frame, text="Human-Like Delay: ").grid(row=4, column=0, pady=(5, 5))
Label(controls_frame, text="Human-Like Delay: ").grid(row=6, column=0, pady=(5, 5))
jitter = Checkbutton(controls_frame, var=BooleanVar(value=config.get("jitter")))
jitter.grid(row=4, column=1)
jitter.grid(row=6, column=1)
controls_frame.pack(padx=(5, 5), pady=(5, 5))
top.start()