Use AutoIt.
Idk if you can use AutoIt with Python tho but Ive been using it on VB.
Code:
Imports AutoItX3Lib
Dim a As New AutoItX3
a.IsAdmin()
a.WinWaitActive(txtWinTitle.Text)
a.Sleep(3000)
a.Send("{ESC}")
a.Sleep(3000)
a.Send("{LCTRL}")
a.Sleep(3000)
a.MouseClick(Left, numWorkX.Value, numWorkY.Value)
a.Sleep(3000)
a.MouseClick(Left, numRecoverX.Value, numRecoverY.Value)
a.Sleep(3000)
a.MouseClick(Left, numBeerX.Value, numBeerY.Value)
a.Sleep(3000)
a.MouseClick(Left, numConfirmX.Value, numConfirmY.Value)
a.Sleep(3000)
a.MouseClick(Left, numRepeatX.Value, numRepeatY.Value)
a.Sleep(3000)
a.Send("{ESC}")
a.Sleep(3000)
So, this opens the menu / settings by pressing ESC, then clicks on the Worker Icon with the coordinates you provided and so on...
For some reason, there's something that is blocking other sendinputs to game client as I cannot make it work with mouse_events.
Code:
Cursor.Position = New Point(numWorkX.Value, numWorkY.Value)
Thread.Sleep(500)
Call mouse_event(MOUSE_LEFTDOWN, numWorkX.Value, numWorkY.Value, 0, 0)
The above code does not work with BDO, IDK why.