mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
#95 added default config for when forward_key isn't set but used
This commit is contained in:
parent
d29b801657
commit
a59909de9d
@ -120,9 +120,12 @@ class FullAuto(IEngine):
|
||||
|
||||
walking_time = dist / self.calibrator.move_factor
|
||||
logging.debug(f"walking for {walking_time}")
|
||||
kb.press(config.get("forward_key"))
|
||||
|
||||
forward_key = config.get("forward_key", 'w')
|
||||
kb.press(forward_key)
|
||||
time.sleep(walking_time)
|
||||
kb.release(config.get("forward_key"))
|
||||
kb.release(forward_key)
|
||||
|
||||
logging.debug("done")
|
||||
# todo: maybe check if it reached the destination before returning true?
|
||||
return True
|
||||
|
@ -63,9 +63,11 @@ class Calibrator(IMode):
|
||||
|
||||
x1, y1, rot1 = coords
|
||||
|
||||
kb.press(config.get("forward_key"))
|
||||
forward_key = config.get("forward_key", 'w')
|
||||
kb.press(forward_key)
|
||||
time.sleep(walking_time)
|
||||
kb.release(config.get("forward_key"))
|
||||
kb.release(forward_key)
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
coords = self.engine.get_coords()
|
||||
|
@ -145,7 +145,7 @@ def start_semifisher_config(gui: 'GUI'):
|
||||
gui._notify_check['state'] = tk.NORMAL
|
||||
gui._notify.set(is_subbed[0])
|
||||
|
||||
ttk.Label(controls_frame, text="action Key:").grid(row=1, column=0)
|
||||
ttk.Label(controls_frame, text="Action Key:").grid(row=1, column=0)
|
||||
action_key_entry = ttk.Entry(controls_frame, justify=tk.CENTER)
|
||||
action_key_entry.grid(row=1, column=1)
|
||||
action_key_entry.insert(0, config.get("action_key", "e"))
|
||||
|
Loading…
Reference in New Issue
Block a user