You can use almost any common language.
The difficulty is not in the choice of language, but in the implementation of the required functions, as they do not have ready-made solutions for image search, object recognition, text recognition.
However, there are programs specifically designed for your purposes. They have ready-made functions with which you can easily build the logic of the bot.
They can work both in the active window and in the background. The mouse and keyboard remain free.
One such program is Kibor. It has a full set of tools for creating automated actions, including bots.
In addition to the functions that almost all such programs have (search for images, keyboard and mouse operation, and so on), it has a Visual Code Editor, by which any user not familiar with programming can create bot code.
Also in Kibor there is a built-in OCR module. Recognize the text is often in the analysis of the image of the game. To write this function is not even a simple task even for an experienced programmer.
In Kibor there is a lot of special tools of the other, making it easier to create bots.