So im working on a nitro type bot and the simplest way that I could think of was a bot powered by text recognition. The bot takes the screen shots perfectly everytime, but more than half of the itme it has trouble reading the latter half of the text.
screenshot above
The results that i get:
ignore the B at the start, i know the problem there
B new type of fiber optic cable may do just that. Fiber optic cables contain bundles of thin, flexible glass fibers Fa ivein Cane Tetea TFSI ITTF Ce TN | LAN OF CAT TELOTING Maca Tate RINS
here is the code I used:
import time
import keyboard
import pytesseract
from pytesseract import image_to_string
from PIL import Image,ImageGrab
import cv2
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
# Takes screenshot of text
img = ImageGrab.grab(bbox =(412,563,1054, 701)).save('text.png')
# Turn image into text
text = image_to_string('text.png')
# cleans the text
text = text.replace('\n',' ')
print(text)
# main bot starts typing it
time.sleep(1)
keyboard.write(text)