-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextLesson.py
More file actions
35 lines (29 loc) · 1.02 KB
/
nextLesson.py
File metadata and controls
35 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pyautogui
import logging
import time
import constants
def hasEndingFeedback() -> bool:
endOfLine = pyautogui.locateOnScreen('endOfLine.png', grayscale=True, confidence=0.9)
if endOfLine:
logging.info("Found feedback end of lesson")
logging.info("Apparently missed ending arrow")
return True
else:
return False
def hasEnding() -> bool:
nextLesson = pyautogui.locateOnScreen('nextLesson.png', grayscale=True, confidence=0.9)
if nextLesson:
logging.info("Found ending of lesson")
return True
else:
return False
def endLesson():
nextLesson = pyautogui.locateOnScreen('nextLesson.png', grayscale=True, confidence=0.9)
if not nextLesson:
logging.warning("lesson end has disappeared, skipping")
return
pyautogui.click(x=nextLesson.left + 20, y=nextLesson.top + 7)
def waitForNewLesson():
prevLesson = None
while prevLesson is None:
prevLesson = pyautogui.locateOnScreen('prevLesson.png', grayscale=True, confidence=0.9)