-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoconference.py
More file actions
36 lines (30 loc) · 1.11 KB
/
autoconference.py
File metadata and controls
36 lines (30 loc) · 1.11 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
36
from configparser import ConfigParser
import pyautogui
from time import sleep
# from ac_cec import *
config = ConfigParser()
config.read("config.ini")
conference_url = config.get('HANGOUTS', 'conference_url', fallback='https://hangouts.google.com')
def turn_on_tv():
pass
def init_conference():
turn_on_tv()
# sleep(2)
pyautogui.hotkey('f11') # full screen
sleep(1)
screenWidth, screenHeight = pyautogui.size()
# currentMouseX, currentMouseY = pyautogui.position()
# print(f"{screenWidth} {screenHeight} {currentMouseX} {currentMouseY}")
# pyautogui.moveTo(100, 150)
# pyautogui.click()
# pyautogui.screenshot('temp.png') # save screenshot to crop the button image from here
start_conf_but = pyautogui.locateOnScreen('boton_iniciar.png', grayscale=True, region=(100,50, 900, 400))
print(f"button found at {start_conf_but}")
# pyautogui.alert('Ready!')
if start_conf_but:
buttonx, buttony = pyautogui.center(start_conf_but)
pyautogui.click(buttonx, buttony)
else:
pyautogui.click(716, 207)
if __name__ == '__main__':
init_conference()