From 3d20c3b5a9a9e01e1c848ee46766d29027e5a239 Mon Sep 17 00:00:00 2001 From: Filip Date: Thu, 19 Jun 2025 23:06:36 +0200 Subject: [PATCH] Created add_keybind function. --- full_abyssal_beasts.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/full_abyssal_beasts.py b/full_abyssal_beasts.py index 48ac49a..2be9177 100644 --- a/full_abyssal_beasts.py +++ b/full_abyssal_beasts.py @@ -1,3 +1,4 @@ +from typing import Callable import pynput.keyboard as keyboard import pynput.mouse as mouse from secrets import randbelow @@ -79,6 +80,18 @@ def full_setup(): random_sleep_between(1_800, 2_200) k.tap('1') +def add_keybind(keybind: str | Key, action: Callable): + def on_release(key): + try: + if key == keybind: + action() + else: + if key.char == keybind: + action() + except: + pass -random_sleep_between(2_000, 3_000) -full_setup() \ No newline at end of file + keyboard.Listener(on_release=on_release).start() + +while True: + time.sleep(1000) \ No newline at end of file