I am a newbie with Python and I've been lookin around for answers but could not find anything to solve my problem.
I am trying to make a bot type of script that is going through different rooms until It finds the right one but each time the number of the room should go up by 1. I am thinking of using pyautogui's locateonscreen function in order to make the script stop and put a password to the room once it finds the right one.
With the knowledge I have at the moment and to explain it as simple as possible it should look something like this:
pyautogui.write("/room dog") #write this in the console
pyautogui.press('Enter') #enter the room
time.sleep(10)
if pyautogui.locateOnScreen("exampleimage.png") or ("exampleimage2.png"): #If the script finds the right one
pyautogui.write ("/pw 123")
else:
continue #else it should just continue searching by adding one number to the room name
For Example:
pyautogui.write("/room dog1"),
pyautogui.write("/room dog2"),
pyautogui.write("/room dog3"),
up until 20, then continue with a different name for example "/room cat" and once again up until "/room cat20", then a third name etc.
Any links/videos that would help me figure out how to write the script myself will be highly appreciated as well, you don't have to do it for me. Tips on what to look for and read is also welcome! :)
I will be able to configure the LocateOnScreen with the images, the whole structure however is something that I am unable to figure out. Mainly how to make it write room names and just add a number to it each time until it finds the right one.