Closed Veudip closed 3 years ago
this worked
from pathlib import Path
from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con
while keyboard.is_pressed('up + down + right + left') == False:
if pyautogui.locateOnScreen('Ohitamainos.jpg', region=(0,0,1917,1039), grayscale=True, confidence=0.8) != None:
x, y = pyautogui.locateCenterOnScreen('Ohitamainos.jpg', grayscale=True, confidence=0.8)
pyautogui.click(x, y, clicks=1)
time.sleep(1)
elif pyautogui.locateOnScreen('Ohitamainokset.jpg', region=(0,0,1917,1039), grayscale=True, confidence=0.8) != None:
x, y = pyautogui.locateCenterOnScreen('Ohitamainokset.jpg', grayscale=True, confidence=0.8)
pyautogui.click(x, y, clicks=1)
time.sleep(1)
else:
#print("no skips")
time.sleep(0.2)
so i modified your stickman code to skip youtube ads automatically but when i try to run it from cmd or IDLE (i use vs code to code everything) it raises this error: raise IOError("Failed to read %s because file is missing, " OSError: Failed to read Ohitamainos.png because file is missing, has improper permissions, or is an unsupported or invalid format
i tired if its cause path but it didnt fix it but when i made the pictures again with your regionscreenshotsaver i tworked once and then it didnt work anymore do you know why this happens?
python3