There are various ways to record the actions in the game client. In cases where we automate many distinct activities, we use software tools to automate the recording.
But setting up these tools would be overkill when you only want to automate a mouse click.
Since there is only a single type of activity in that case, there is no risk of confusing different ones, and therefore no use for a systematic recording process. You can type the input directly using your keyboard, right into the program code. For example, here:
You can run that problem linked above and see how it clicks on the coordinates you entered.
Often we want that click to hit a specific object on the screen.
In such a case, we take a crop of the object we want to click from a screenshot. If that object varies in its appearance in the game client, we might collect several examples.
This (set of) image crop(s) then becomes the training data to generate the part of the bot program code that finds instances of that object in new, previously unseen environments/screenshots.