Skip to content

Commit

Permalink
🎹 KeyboardInterrupt Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
b0kch01 committed Feb 9, 2020
1 parent 9cf1a14 commit adf6277
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions racerbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import keyboard # Fast keyboard emulating
import time # Loop control, delays

colorama.init()
colorama.init() # Legacy console fix for color
print("Successfuly imported!\n")
except:
print("Error: Could not import modules")
print("Please check to:")
print("\t1) Tesseract installed with correct PATH")
print("\t2) Other modules are installed with pip")
exit()
exit(0)


def titlescreen():
Expand Down Expand Up @@ -85,13 +85,14 @@ def start_bot():
print("Oh No! Something went terribly wrong!")
print("Create an issue on GitHub and I'll try to fix it :)")

cprint("\nRaced to the finish line!", "green")


def prompt_continue():
f = Figlet(font="doom")
print(f.renderText("Zoom!"))
return input("Would you like to continue? >").lower() in "yes!yea!ya!"
print(f.renderText("\nExit?"))
try:
return input("Would you like to continue? >").lower() in "yes!yea!ya!"
except KeyboardInterrupt:
return prompt_continue()


if __name__ == "__main__":
Expand All @@ -101,3 +102,4 @@ def prompt_continue():
if not prompt_continue():
break
print("Bye!")
sleep(2)

0 comments on commit adf6277

Please sign in to comment.