-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspambot_image.py
More file actions
58 lines (49 loc) · 1.41 KB
/
spambot_image.py
File metadata and controls
58 lines (49 loc) · 1.41 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#encoding: utf-8
import pyautogui, sys, keyboard, time
def textboxCoordinates():
"""
Function that returns textbox coordinates.
Returns
-----
text - Textbox coordinates.
"""
print("Go to chat textbox")
time.sleep(3)
text = pyautogui.position()
print("Chat position acquired: {}".format(text))
return text
def buttonCooordinates():
"""
Function that returns send button coordinates.
Returns
-----
button - Send button coordinates.
"""
print("Go to send button")
time.sleep(3)
button = pyautogui.position()
print("Send button position acquired: {}".format(button))
return button
def run(text, button):
"""
Function that does the image spam.
Parameters
-----
text - Textbox position.
button - Send button position.
"""
n = 1
while not keyboard.is_pressed('esc'): #Ends when esc is pressed
pyautogui.click(text)
pyautogui.hotkey('ctrl', 'v')
pyautogui.click(button)
print("Image number:{}".format(n))
n += 1
#########################################################
# #
# MAIN #
# #
#########################################################
text = textboxCoordinates()
button = buttonCooordinates()
run(text, button)