Skip to content

Commit

Permalink
Release 1.2.1
Browse files Browse the repository at this point in the history
Release 1.2.1
  • Loading branch information
Adolsik authored Nov 10, 2022
1 parent 9a6aa42 commit 094c8f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions gui.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import sys
from tkinter import *
import main
import threading
import time
import keyboard

def stop(event=None):

def stop():
root.destroy()

def go():
t1 = threading.Thread(target=main.go, args=(float(entry_working_time.get()),))
t1 = threading.Thread(target=main.go, args=(float(entry_working_time.get()),), daemon=True)
t1.start()


root = Tk()
root.geometry('520x160')

root.title('Simple AFK BOT')


label_working_time = Label(root, text="Enter how long should bot works (in seconds): ")
label_working_time.grid(row=0, column=0, padx=10, pady=10)
entry_working_time = Entry(root)
Expand All @@ -25,12 +29,12 @@ def go():
label_status = Label(root, text=f'Status: {main.status}')
label_status.grid(row=1, column=0, padx=50, pady=10)

button_quit = Button(root, text="Quit", command=root.destroy, padx=30)
button_quit = Button(root, text="Quit", command=stop, padx=30)
button_quit.grid(row=3, column=1, padx=50, pady=10)

label_quit = Label(root,text="Press F8 to stop the bot")
label_quit.grid(row=3, column=0, padx=20, pady=10)

root.bind('<F8>',stop)
keyboard.add_hotkey('f8', stop)

root.mainloop()

0 comments on commit 094c8f8

Please sign in to comment.