-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
59 lines (55 loc) · 1.9 KB
/
utils.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import sys
import pyautogui
#start program
def program():
os.startfile(r"game\visualboyadvance-m.exe")
pyautogui.sleep(2)
coordinate = pyautogui.locateOnScreen(r"source\argomenti advanced.PNG")
pyautogui.sleep(1)
pyautogui.moveTo(coordinate)
pyautogui.sleep(1)
pyautogui.leftClick(coordinate)
pyautogui.sleep(1)
coordinate = pyautogui.locateOnScreen(r"source\Open.PNG")
pyautogui.sleep(1)
pyautogui.moveTo(coordinate)
pyautogui.sleep(1)
pyautogui.leftClick(coordinate)
pyautogui.sleep(1)
try:
coordinate = pyautogui.locateOnScreen(r"source\gbaLightmode.PNG")
except pyautogui.ImageNotFoundException:
coordinate = pyautogui.locateOnScreen(r"source\gbaDarkmod.PNG")
pyautogui.moveTo(coordinate)
pyautogui.click(clicks=2, button='left')
pyautogui.sleep(1)
pyautogui.keyDown("f1")
pyautogui.keyUp("f1")
#save
def save():
pyautogui.leftClick()
try:
coordinate = pyautogui.locateOnScreen(r"source\consoleDarkmode.PNG")
except pyautogui.ImageNotFoundException:
coordinate = pyautogui.locateOnScreen(r"source\consoleLightmod.PNG")
pyautogui.moveTo(coordinate)
coordinate = pyautogui.locateOnScreen(r"source\argomenti advanced.PNG")
pyautogui.sleep(1)
pyautogui.moveTo(coordinate)
pyautogui.sleep(1)
pyautogui.leftClick(coordinate)
coordinate = pyautogui.locateOnScreen(r"source\save.PNG")
pyautogui.sleep(1)
pyautogui.moveTo(coordinate)
pyautogui.leftClick(coordinate)
coordinate = pyautogui.locateOnScreen(r"source\f1slotsave.PNG")
pyautogui.moveTo(coordinate)
pyautogui.leftClick(coordinate)
pyautogui.sleep(1)
def close():
pyautogui.leftClick()
coordinate = pyautogui.locateOnScreen(r"source\close.PNG")
pyautogui.moveTo(coordinate)
pyautogui.leftClick(coordinate)
sys.exit()