If I understand the code correctly, currently the code runs in a loop as fast as it can to do OCR during battles and other states. There can be a controlled timing based on the states and the text just read. For example:
- When resetting the game, wait a long time before reading, so that it doesn't read texts on the game title screen.
- During battle, if it detects the pokemon uses a move (xxx used yyy!), wait several more miliseconds before the next iteration because a move call usually lasts longer than other battle texts.
This can be tricky because different hardware may have different latency. So either the user can set a delay value in the config, or (with more complexity) have the program to detect this latency by itself and adjust it accordingly.