1
Next, I want to start a project to create a bot for a specific android game in python, for this, I use an emulator, Nox. My idea is to be able to work with the automation part of Gui (automatic clicks, press a button on the keyboard, etc) in a background way, in case, that could leave the window minimized, and go performing other tasks.
The library I found for the Gui automation python was the Pyautogui, but you can only make the clicks on the whole window if the pixels appear currently on the screen, which will not occur if the process is minimized
Is there any way I can do this process with the window minimized?
The following is an example of a very simple code to give an example
import os
import pygetwindow
import time
import pyautogui
title = "NoxPlayer"
os.startfile(r"C:\Program Files (x86)\Nox\bin\nox.exe")
time.sleep(5)
window = pygetwindow.getWindowsWithTitle(title)[0]
window.activate()
window.resizeTo(1280,720)
window.moveTo(0,0)
time.sleep(5)
posx, posy, height, wight = pyautogui.locateOnScreen(r"Images\Icon.png")
pyautogui.moveTo(posx + 10, posy + 10, 1)
can provide a minimum replicable example?
– Lucas
edited the question with an example
– Gabriel Henrique
I don’t think I can, pyautogui automates the interface, if the window this minimized will not have graphical interface to be automated, maybe it works on a virtual machine, the script running inside it next to the application, then maybe you can minimize the window of the virtual machine
– Elton Nunes