-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpamUGui.py
179 lines (150 loc) · 8.14 KB
/
SpamUGui.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
from tkinter import ttk, END, PhotoImage
import customtkinter
import time
import os
import keyboard
os.system("xhost +") # needs to be done before importing pyautogui
from Spammer import Spammer
customtkinter.set_appearance_mode("Dark") # Modes: "System" (standard), "Dark", "Light"
customtkinter.set_default_color_theme("green") # Themes: "blue" (standard), "green", "dark-blue"
win = customtkinter.CTk()
win.geometry("620x550")
win.title("SpamU")
photo = PhotoImage(file="swaggy-trollface-man.png")
win.iconphoto(False, photo)
# main frame
frame_1 = customtkinter.CTkFrame(master=win)
frame_1.pack(pady=15, padx=60, fill="both", expand=True)
# Text to spam text box
spamTextBox = customtkinter.CTkTextbox(master=frame_1, width=200, height=70)
spamTextBox.place(x=80, y=50)
spamTextBox.insert("0.0", "Your Text Comes Here!")
# Text to spam text box label
spamTextBoxLabel = customtkinter.CTkLabel(master=frame_1, text="Text to Spam:",
font=customtkinter.CTkFont(size=14, weight="bold"),
justify=customtkinter.CENTER)
spamTextBoxLabel.place(x=80, y=20)
# Status Text Box
statusTextBox = customtkinter.CTkTextbox(master=frame_1, width=300, height=30)
statusTextBox.place(x=80, y=460)
statusTextBox.insert("0.0", "Operation status comes here\n")
# Status label
statusLabel = customtkinter.CTkLabel(master=frame_1, text="Status:",
font=customtkinter.CTkFont(size=14, weight="bold"),
justify=customtkinter.CENTER)
statusLabel.place(x=80, y=430)
# spam parameters
# Wait till start entry box
waitTimeTillStartingSpamEntryBox = customtkinter.CTkEntry(master=frame_1, width=100, placeholder_text="(Seconds)")
waitTimeTillStartingSpamEntryBox.place(x=170, y=140)
# Wait till start entry box label
waitTimeTillStartingSpamEntryBoxLabel = customtkinter.CTkLabel(master=frame_1, text="Delay before\nStart:",
font=customtkinter.CTkFont(size=13, weight="normal"),
justify=customtkinter.LEFT)
waitTimeTillStartingSpamEntryBoxLabel.place(x=80, y=140)
# number of texts to spam entry box
numberOfTextsToSendEntryBox = customtkinter.CTkEntry(master=frame_1, width=100, placeholder_text="(number)")
numberOfTextsToSendEntryBox.place(x=170, y=180)
# number of texts to spam entry box label
numberOfTextsToSendEntryBoxLabel = customtkinter.CTkLabel(master=frame_1, text="Number of\ntexts to spam:",
font=customtkinter.CTkFont(size=13, weight="normal"),
justify=customtkinter.LEFT)
numberOfTextsToSendEntryBoxLabel.place(x=80, y=180)
# delay time between each text sent entry box
delayTimeBetweenEachTextSentEntryBox = customtkinter.CTkEntry(master=frame_1, width=100, placeholder_text="(Seconds)")
delayTimeBetweenEachTextSentEntryBox.place(x=170, y=220)
# delay time between each text sent entry box label
delayTimeBetweenEachTextSentEntryBoxLabel = customtkinter.CTkLabel(master=frame_1, text="Delay between\neach text:",
font=customtkinter.CTkFont(size=13, weight="normal"),
justify=customtkinter.LEFT)
delayTimeBetweenEachTextSentEntryBoxLabel.place(x=80, y=220)
# hint
# delay time between each text sent entry box hint label
delayTimeBetweenEachTextSentEntryBoxLabel = customtkinter.CTkLabel(master=frame_1,
text="🔰 Delay between each\ntext can be in decimal",
font=customtkinter.CTkFont(size=10, weight="normal"),
justify=customtkinter.CENTER)
delayTimeBetweenEachTextSentEntryBoxLabel.place(x=170, y=250)
# spam progress bar
spamProgressBar = customtkinter.CTkProgressBar(master=frame_1, width=180)
spamProgressBar.place(x=80, y=400)
spamProgressBar.set(0)
# spam progress bar label
spamProgressBarLabel = customtkinter.CTkLabel(master=frame_1, text="Progress:",
font=customtkinter.CTkFont(size=12, weight="bold"),
justify=customtkinter.LEFT)
spamProgressBarLabel.place(x=80, y=370)
##########################
# safe mode check box
safeModeCheckBox = customtkinter.CTkCheckBox(master=frame_1, checkbox_height=20,
text="Safe Mode",
font=customtkinter.CTkFont(size=16, weight="normal"))
safeModeCheckBox.place(x=120, y=300)
safeModeCheckBox.select()
# start spamming button callback
def startSpammingButton_callback():
waitTimeTillStartingSpamTime = waitTimeTillStartingSpamEntryBox.get()
numberOfTextsToSendNumber = numberOfTextsToSendEntryBox.get()
delayTimeBetweenEachTextSentTime = delayTimeBetweenEachTextSentEntryBox.get()
if waitTimeTillStartingSpamTime == '':
waitTimeTillStartingSpamTime = '15'
if numberOfTextsToSendNumber == '':
numberOfTextsToSendNumber = '50'
if delayTimeBetweenEachTextSentTime == '':
delayTimeBetweenEachTextSentTime = '1'
countdown(int(waitTimeTillStartingSpamTime)) # delay countdown before stating spam
spammer = Spammer(int(numberOfTextsToSendNumber), float(delayTimeBetweenEachTextSentTime)) # creating spammer
if safeModeCheckBox.get() == 1:
win.wm_attributes('-alpha', 0.7)
win.attributes('-zoomed', True)
win.resizable(False, False)
win.update()
# Create a Label and a Button widget
pressEnterToExitLabel = ttk.Label(win, text="Press {ALT + ENTER} to Stop operation", font='Century 22 bold')
pressEnterToExitLabel.pack(ipadx=10)
# Disable the Mouse Pointer
win.config(cursor="none")
win.update()
# press ctrl+shift+z to print "Hotkey Detected"
keyboard.add_hotkey('alt + enter', exitOnEnter_callback, args=(pressEnterToExitLabel, spammer))
# keyboard.wait('shift + enter')
spammer.startOperation(spamTextBox.get("1.0", END), statusTextBox, win, spamProgressBar)
exitOnEnter_callback(None, spammer)
# define the countdown func.
def countdown(t):
while t:
mins, secs = divmod(t, 60)
timer = '{:02d}:{:02d}'.format(mins, secs)
time.sleep(1)
t -= 1
statusTextBox.delete("0.0", END)
statusTextBox.insert("0.0", "Stating operation in: " + str(timer))
win.update()
def exitOnEnter_callback(label, spamObject):
win.attributes('-zoomed', False)
win.wm_attributes('-alpha', 1)
win.geometry("620x550")
win.resizable(True, True)
win.config(cursor="arrow")
spamObject.breakOperationCall()
if label is not None:
label.destroy()
win.update()
# start spamming button
startSpammingButton = customtkinter.CTkButton(master=frame_1, command=startSpammingButton_callback,
text="Start Spam!",
font=customtkinter.CTkFont(size=14, weight="normal"))
startSpammingButton.place(x=100, y=330)
# guide label
guideLabel = customtkinter.CTkLabel(master=frame_1,
text="Defaults:\n delayBeforeStart - 15s\n numberOfTextsToSpam - "
"50\n delayBetweenEachText - 1s\n\n\n\n\n\n⚠ Safe mode: disables "
"interactions till "
"operation completion and lets you break operation midway ("
"RECOMMENDED)\n\n⚠ Warning:\nImmediately select the desired text field to SPAM"
" right after "
"pressing start button",
font=customtkinter.CTkFont(size=12, weight="normal"), text_color="yellow",
justify=customtkinter.LEFT, wraplength=165)
guideLabel.place(x=320, y=140)
win.mainloop()