-
Notifications
You must be signed in to change notification settings - Fork 0
/
Farmer.py
72 lines (53 loc) · 1.11 KB
/
Farmer.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
62
63
64
65
66
67
68
import pyautogui
import time
import sys
INPUT_BOX = (525, 755)
EMOJI = (1043, 662)
SELECT_EMOJI = (704, 478)
VOTE_EMOJI = (490, 684)
COMMANDS = {"prep": "course", "ready": "$ready", "start": "$start"}
def write(cmd):
"""
write command in the channel
:param cmd:
:return:
"""
print(f"writing {cmd}")
pyautogui.moveTo(*INPUT_BOX)
pyautogui.click()
pyautogui.write(COMMANDS[cmd])
pyautogui.press(['enter'])
def selectEmoji():
print("selecting emoji")
pyautogui.moveTo(*EMOJI)
pyautogui.click()
pyautogui.moveTo(*SELECT_EMOJI)
pyautogui.click()
def vote():
"""
vote for the first emoji
:return:
"""
print("voting")
pyautogui.moveTo(*VOTE_EMOJI)
pyautogui.click()
def farm():
"""
farm 50 tc-dollar
:return:
"""
write("prep")
selectEmoji()
time.sleep(3)
write("ready")
vote()
time.sleep(3)
write("start")
if __name__ == '__main__':
if len(sys.argv) == 2:
times = sys.argv[1]
for _ in range(times):
farm()
time.sleep(5)
else:
farm()