-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
61 lines (45 loc) · 1.21 KB
/
main.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
60
61
"""
Author: Deeshan Sharma
Date Created: December 27, 2020
Purpose: This is a bot which will join the Zoom meetings on your behalf automatically and mark your attendance.
"""
import json
from datetime import datetime as dt
import subprocess
import time
import pyautogui as gui
import link
import getpass
username = getpass.getuser()
def getTime():
with open('timetable.json', 'r') as f:
timetable = json.load(f)
return timetable
def checkClass(timetable):
day = dt.now().strftime("%A").lower()
schedule = timetable[day]
while True:
cTime = dt.now().strftime("%I:%M")
if cTime in schedule:
openZoom()
time.sleep(240)
def openZoom():
subprocess.Popen(fr"C:\Users\{username}\AppData\Roaming\Zoom\bin\Zoom.exe") # Change app location here
time.sleep(15)
joinClass()
def buttonClick(image):
btn = gui.locateCenterOnScreen(image)
gui.moveTo(btn)
gui.click()
time.sleep(2)
def buttonWrite(text):
gui.write(text)
time.sleep(1)
gui.press('enter')
def joinClass():
buttonClick('images/main-join-btn.png')
buttonWrite(link.ID)
time.sleep(6)
buttonWrite(link.PASS)
timetable = getTime()
checkClass(timetable)