An automated typing bot specifically designed for the 10FastFinger typing test website. It captures text from the screen using OCR technology, automatically types it with configurable speed, and can achieve exceptional typing speeds with high accuracy.
The 10FastFinger Bot is a specialized automation tool designed to interact with the popular 10FastFinger typing test website. Using optical character recognition (OCR) technology, it captures text from the screen and automatically types it at configurable speeds.
The bot is triggered by keyboard shortcuts and can achieve impressive typing speeds while maintaining high accuracy. This project demonstrates practical applications of screen scraping, text recognition, and keyboard simulation techniques within a specific web context.
The bot is implemented in Python and leverages several key libraries for its functionality:
import pytesseract
from PIL import ImageGrab
from pynput import keyboard
import time
x = 40
y = 590
width = 880
height = 100
enter_pressed = False
def extract_text_from_screen(x, y, width, height):
screenshot = ImageGrab.grab(bbox=(x, y, x + width, y + height))
screenshot = screenshot.convert("L")
extracted_text = pytesseract.image_to_string(screenshot)
return extracted_text
def replace_enter_with_space(text):
return text.replace("\n", " ")
def type_text(text):
for char in text:
keyboard.Controller().type(char)
time.sleep(0.06) # Delay of 0.06 seconds (60ms)
def on_press(key):
global enter_pressed
if key == keyboard.Key.space:
enter_pressed = False
extracted_text = extract_text_from_screen(x, y, width, height)
modified_text = replace_enter_with_space(extracted_text)
type_text(modified_text)
elif key == keyboard.Key.enter:
enter_pressed = True
return False
def on_release(key):
pass
def listen_for_input():
with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
listener.join()
listen_for_input()
The development process involved these key steps:
The 10FastFinger Bot consistently achieves impressive typing speeds, often exceeding 150 words per minute with near-perfect accuracy. This performance demonstrates the effectiveness of OCR-based automation in web interfaces.
Beyond the immediate application, this project showcases the integration of several technologies (screen capture, OCR, keyboard simulation) to create a cohesive automation solution. It serves as a practical example of how Python can be used to automate web-based tasks, even when direct API access isn't available.