Skip to content

Instantly share code, notes, and snippets.

@adistomar
Last active April 12, 2021 00:02
Show Gist options
  • Save adistomar/04956cc5635d13d090b9cca20360a7df to your computer and use it in GitHub Desktop.
Save adistomar/04956cc5635d13d090b9cca20360a7df to your computer and use it in GitHub Desktop.
A program that allows for extremely high typing speeds on typeracer.com

typeracer-cheat

A program that allows one to achieve extremely high speeds on typeracer.com. This works only for the online races and the practice races - not for the race your friend mode.

How to setup:

  • First, make sure you have Selenium installed
    • To install Selenium, go to your command line and run pip install selenium
  • Then, make sure to have Chromedriver installed
    • To install Chromedriver, follow this video
  • Locate and copy the path to the location where you downloaded Chromedriver
  • Open the typeracer.py file and replace the path in the string: PATH = "YOUR_PATH_TO_CHROMEDRIVER"

How to run:

  • either run it direclty from your IDE
  • or open command line and run python3 typeracer.py or python typeracer.py depending on your OS and python version

Changing typing speed

  • to change the typing speed, locate this line in typeracer.py:
time.sleep(.01)
  • change the value inside the parentheses - .01 means that the typing speed is 1 character every .01 seconds, or 1 character every one-hundredth of a second

Note that this program only works for the online races and the practice races - it doesn't work for the race your friends mode.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
PATH = "YOUR_PATH_TO_CHROMEDRIVER"
driver = webdriver.Chrome(PATH)
driver.get("https://play.typeracer.com/")
try:
main = WebDriverWait(driver, 60).until(
EC.presence_of_element_located((By.CLASS_NAME, "gameView"))
)
text = main.text
text = text.split("\n")[-3] # getting the actual text content
race_status = main.find_element_by_class_name("gameStatusLabel").text
while "Go" not in race_status and "The race is on" not in race_status:
race_status = main.find_element_by_class_name("gameStatusLabel").text
text_box = main.find_element_by_class_name("txtInput")
for i in text:
text_box.send_keys(i)
time.sleep(.01) # 1 char every 0.01 seconds
except:
print("game was not started in time")
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment