I am trying to make a program that can control the mouse to perform actions in an instance of bluestacks (for those who aren't familiar with bluestacks, an instance of bluestacks is basically a second open bluestacks that can run as the same time as another bluestacks instance). I managed to get the script working with PyAutoGUI but I am forced to use the MoveTo command that moves the mouse to an X,Y position. My issue is that when trying to run multiple instances & scripts at once, if a click from different scripts at the same time within a short range of time, one of the clicks "bugs out" or simply doesn't happen, which stalls one of the instance scripts until I manually restart it. Does anyone have a suggestion on how I can make the script "click" in a position of the screen without the mouse actually moving?
EDIT: I am aware of PyAutoIt but do not believe it would work since I am running multiple instances of the same program and not different programs
The best approach is to install Android debug bridge (ADB) on your system then enable ADB debugging for each Bluestacks instance. Now you can use ADB to send commands directly to the exact emulator of your choice and you can do it in parallel because all commands are guaranteed to run on the specified device via the device ID.
adb -s <deivce_id> shell input tap x y
where x & y are the coordinates on the screen.
You can, also, do the same thing with Appium but it will still require ADB and will be more involved - however, if you are looking to build something more than just a simple script you should really be looking at Appium.
There is a whole lot more you can do with ADB - I have a comprehensive ADB tutorial as well if you wonder what sort of stuff you can do with it other then clicking in on x, y cords.
I also have very comprehensive tutorial playlists for Appium from beginner to advanced framework design.