Last active
December 16, 2018 14:14
-
-
Save sdushantha/7242c4c2fc0fe05a7ff20d02b8b94bce to your computer and use it in GitHub Desktop.
Script to cheat on TypingPal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from pyautogui import press | |
import re | |
import sys | |
def cleanhtml(raw_html): | |
cleanr = re.compile('<.*?>') | |
cleantext = re.sub(cleanr, '', raw_html) | |
return cleantext | |
fname = input("File name: ") | |
f = open(fname) | |
print("Reading file...") | |
ex1 = cleanhtml(f.read()) | |
ex1 = ex1.replace(" ", " ") | |
if ";" in ex1: | |
print("Sorry, this script cant do exercises with semicolons") | |
sys.exit() | |
print("Cleaned the html") | |
sleep(5) | |
for letters in ex1: | |
press(letters) | |
print(letters) | |
print("--COMPLETED--") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment