mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
fixup rebase and max waittime
This commit is contained in:
parent
d0e170c6b5
commit
38df271376
@ -34,11 +34,12 @@ class FishEvent:
|
|||||||
uid = None
|
uid = None
|
||||||
sound = False
|
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
|
reaction = 0.0
|
||||||
if (FishEvent.jitter):
|
if (FishEvent.jitter and (upper_limit_ms > lower_limit_ms)):
|
||||||
reaction = float( random.randrange(lower_limit, upper_limit) )/100.0
|
reaction = float( random.randrange(lower_limit_ms, upper_limit_ms) )/1000.0
|
||||||
time.sleep(waittime+reaction)
|
max_wait_t = waittime+reaction if (waittime+reaction <= 2.5) else 2.5
|
||||||
|
time.sleep(max_wait_t)
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
@ -82,14 +83,14 @@ def on_hook():
|
|||||||
FishEvent.fish_times.append(time_to_hook)
|
FishEvent.fish_times.append(time_to_hook)
|
||||||
logging.info("HOOOOOOOOOOOOOOOOOOOOOOOK....... " + str(FishEvent.fishCaught) + " caught " + "in " + str(
|
logging.info("HOOOOOOOOOOOOOOOOOOOOOOOK....... " + str(FishEvent.fishCaught) + " caught " + "in " + str(
|
||||||
round(time_to_hook, 2)) + " secs. " + "Total: " + str(FishEvent.totalFishCaught))
|
round(time_to_hook, 2)) + " secs. " + "Total: " + str(FishEvent.totalFishCaught))
|
||||||
_fishing_sleep(0.0)
|
|
||||||
keyboard.press_and_release(FishEvent.action_key)
|
keyboard.press_and_release(FishEvent.action_key)
|
||||||
|
|
||||||
if FishEvent.collect_allow_auto:
|
if FishEvent.collect_allow_auto:
|
||||||
_fishing_sleep(0.1)
|
_fishing_sleep(0.1)
|
||||||
keyboard.press_and_release('r')
|
keyboard.press_and_release('r')
|
||||||
_fishing_sleep(0.1)
|
_fishing_sleep(0.1)
|
||||||
_fishing_sleep(0.0, upper_limit=48)
|
_fishing_sleep(0.0)
|
||||||
|
|
||||||
|
|
||||||
def on_look():
|
def on_look():
|
||||||
|
@ -108,9 +108,9 @@ def start_semifisher_config(gui: 'GUI'):
|
|||||||
sound = Checkbutton(controls_frame, var=BooleanVar(value=config.get("sound_notification")))
|
sound = Checkbutton(controls_frame, var=BooleanVar(value=config.get("sound_notification")))
|
||||||
sound.grid(row=5, column=1)
|
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 = 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))
|
controls_frame.pack(padx=(5, 5), pady=(5, 5))
|
||||||
top.start()
|
top.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user