Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaacky committed Sep 23, 2017
1 parent 2182f4f commit 71f4891
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions src/crouchjump.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 71f4891

Please sign in to comment.