-
Notifications
You must be signed in to change notification settings - Fork 0
/
spam_class.py
185 lines (171 loc) · 5.84 KB
/
spam_class.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
from tkinter import *
import pyautogui
import pyperclip
import time
class Spam():
def __init__(self):
pass
def keyboardSpam(self):
def button():
global times_num
sentence = self.inputEntry.get()
waittime = int(self.secondBox.get())
times_num = int(self.numberBox.get())
pyperclip.copy(sentence)
time.sleep(waittime)
while times_num > 0:
pyautogui.hotkey('ctrl', 'v')
pyautogui.press("enter")
times_num -= 1
global spamSpamming, sentence
self.InputLabel = Label(text = "Write the sentence that you want to spam it!")
self.inputEntry = Entry()
self.numberBoxLabel = Label(text = "How many times do you want to paste it")
self.numberBox = Spinbox(from_=1, to=100000)
self.secondBoxLabel = Label(text = "How many seconds do you want to wait until paste it")
self.secondBox = Spinbox(from_=0, to=100000)
self.spaceLabel = Label(text="")
self.button = Button(command=button, text = "Spam")
#Keyboard Packs
self.InputLabel.pack()
self.inputEntry.pack()
self.numberBoxLabel.pack()
self.numberBox.pack()
self.secondBoxLabel.pack()
self.secondBox.pack()
self.spaceLabel.pack()
self.button.pack()
self.spamSpamming = False
try:
self.refreshTimesLabel.pack_forget()
self.refreshTimes.pack_forget()
self.waitTimeRefreshLabel.pack_forget()
self.waitTimeRefresh.pack_forget()
self.timeBetweenRefreshLabel.pack_forget()
self.timeBetweenRefresh.pack_forget()
self.refreshButton.pack_forget()
except:
pass
try:
self.clickNumLabel.pack_forget()
self.clickNum.pack_forget()
self.waitTimeClickLabel.pack_forget()
self.waitTimeClick.pack_forget()
self.betweenClickLabel.pack_forget()
self.betweenClick.pack_forget()
self.left.pack_forget()
self.middle.pack_forget()
self.right.pack_forget()
except:
pass
def clickSpam(self):
def preparing():
global clicknum, waittime, betweenclick
clicknum = int(self.clickNum.get())
waittime = int(self.waitTimeClick.get())
betweenclick = float(self.betweenClick.get())
def left():
preparing()
waittime = int(self.waitTimeClick.get())
time.sleep(waittime)
pyautogui.click(button='left', clicks=clicknum, interval=betweenclick)
def middle():
preparing()
waittime = int(self.waitTimeClick.get())
time.sleep(waittime)
pyautogui.click(button='middle', clicks=clicknum, interval=betweenclick)
def right():
preparing()
waittime = int(self.waitTimeClick.get())
time.sleep(waittime)
pyautogui.click(button='right', clicks=clicknum, interval=betweenclick)
#Deleting Widgets
try:
self.refreshTimesLabel.pack_forget()
self.refreshTimes.pack_forget()
self.waitTimeRefreshLabel.pack_forget()
self.waitTimeRefresh.pack_forget()
self.timeBetweenRefreshLabel.pack_forget()
self.timeBetweenRefresh.pack_forget()
self.refreshButton.pack_forget()
except:
pass
try:
self.InputLabel.pack_forget()
self.inputEntry.pack_forget()
self.numberBoxLabel.pack_forget()
self.numberBox.pack_forget()
self.secondBoxLabel.pack_forget()
self.secondBox.pack_forget()
self.spaceLabel.pack_forget()
self.button.pack_forget()
except:
pass
#Click Widgets
self.clickNumLabel = Label(text="How many times do you want to do click spam?")
self.clickNum = Spinbox(from_=0, to=100000)
self.waitTimeClickLabel = Label(text = "How many seconds do you want to wait until spam it?")
self.waitTimeClick = Spinbox(from_=0, to=100000)
self.betweenClickLabel = Label(text="How many second will pass between clicks?")
self.betweenClick = Entry()
self.left = Button(text="Left Click Spam", command = left)
self.middle = Button(text="Middle Click Spam", command = middle)
self.right = Button(text="Right Click Spam", command = right)
#Packing Them
self.clickNumLabel.pack()
self.clickNum.pack()
self.waitTimeClickLabel.pack()
self.waitTimeClick.pack()
self.betweenClickLabel.pack()
self.betweenClick.pack()
self.left.pack(side=LEFT)
self.middle.pack(side=LEFT)
self.right.pack(side=LEFT)
def refreshSpam(self):
def refreshDef():
waitTimeRefreshValue = int(self.waitTimeRefresh.get())
refreshTimesValue = int(self.refreshTimes.get())
betweenRefresh = int(self.timeBetweenRefresh.get())
time.sleep(waitTimeRefreshValue)
while refreshTimesValue > 0:
time.sleep(betweenRefresh)
pyautogui.press('f5')
refreshTimesValue -= 1
try:
self.clickNumLabel.pack_forget()
self.clickNum.pack_forget()
self.waitTimeClickLabel.pack_forget()
self.waitTimeClick.pack_forget()
self.betweenClickLabel.pack_forget()
self.betweenClick.pack_forget()
self.left.pack_forget()
self.middle.pack_forget()
self.right.pack_forget()
except:
pass
try:
self.InputLabel.pack_forget()
self.inputEntry.pack_forget()
self.numberBoxLabel.pack_forget()
self.numberBox.pack_forget()
self.secondBoxLabel.pack_forget()
self.secondBox.pack_forget()
self.spaceLabel.pack_forget()
self.button.pack_forget()
except:
pass
self.refreshTimesLabel = Label(text="How many times do you want to refresh the page?")
self.refreshTimes = Spinbox(from_=1, to=100000)
self.waitTimeRefreshLabel = Label(text="How many seconds do you want to wait until spam it?")
self.timeBetweenRefreshLabel = Label(text = "How much do you want to wait between refreshes?")
self.timeBetweenRefresh = Spinbox(from_=0, to=100000)
self.waitTimeRefresh = Spinbox(from_=0, to=100000)
self.refreshButton = Button(command = refreshDef, text="Refresh Spam")
#Packing
self.refreshTimesLabel.pack()
self.refreshTimes.pack()
self.waitTimeRefreshLabel.pack()
self.waitTimeRefresh.pack()
self.timeBetweenRefreshLabel.pack()
self.timeBetweenRefresh.pack()
self.refreshButton.pack()