This repository has been archived by the owner on May 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Ui.py
59 lines (49 loc) · 1.56 KB
/
Ui.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
import random
import time
import pyautogui
import tkinter as tk
from threading import Thread
from tkinter import PhotoImage
running = False
def main_loop():
global running
running = True
while running:
# type message in chat
message = random.choice(MESSAGES)
pyautogui.typewrite("/")
time.sleep(1)
pyautogui.typewrite(message)
pyautogui.press("enter")
sleep_time = random.randint(20, 110)
time.sleep(sleep_time)
def stop():
global running
running = False
window = tk.Tk()
window.title("Pls Donate Bot")
canvas = tk.Canvas(window, width=800, height=600)
canvas.pack(fill="both", expand=True)
bg_image = PhotoImage(file="bg1.png")
canvas.create_image(0, 0, image=bg_image, anchor="nw")
label = tk.Label(text="Enter your messages to send above: (one per line) When you press start you will have 5 seconds to click on the roblox window.")
label.pack()
def get_messages():
text = message_entry.get("1.0", "end-1c")
return text.split('\n')
def start():
global MESSAGES
MESSAGES = get_messages()
Thread(target=main_loop).start()
canvas_width = 800
canvas_height = 600
message_entry = tk.Text(window, font=("Helvetica", 16), bg="#2c2d2e", fg="#cccbc8")
canvas.create_window(canvas_width//2, canvas_height//2, window=message_entry)
def start_with_delay():
time.sleep(5)
start()
start_button = tk.Button(window, text="Start Script", command=start_with_delay)
start_button.pack()
stop_button = tk.Button(window, text="Stop Script", command=stop)
stop_button.pack()
window.mainloop()