diff --git a/src/crouchjump.py b/src/crouchjump.py index e84fdc5..c732f1c 100644 --- a/src/crouchjump.py +++ b/src/crouchjump.py @@ -1,25 +1,12 @@ import keyboard -import sys -import time from win32gui import GetWindowText, GetForegroundWindow +print("Crouchjump.py loaded. Use shift+space to crouch jump.") -def main(): - print("{} loaded. You can crouch jump with shift+space.".format(sys.argv[0])) - - while True: - try: - if "PLAYERUNKNOWN'S BATTLEGROUNDS" in GetWindowText(GetForegroundWindow()): - if keyboard.is_pressed("shift+space"): - keyboard.press_and_release("space") - keyboard.press_and_release("c") - keyboard.press_and_release("c") - time.sleep(0.1) - except KeyboardInterrupt: - raise - except: - pass - - -if __name__ == '__main__': - main() +while True: + if "PLAYERUNKNOWN'S BATTLEGROUNDS" in GetWindowText(GetForegroundWindow()): + keyboard.wait("shift+space") + keyboard.press_and_release("space") + keyboard.press_and_release("space") + keyboard.press_and_release("c") + keyboard.press_and_release("c") \ No newline at end of file