Skip to content

Commit

Permalink
Release 1.2.2
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
Adolsik authored Nov 13, 2022
1 parent f7d7d33 commit 024c28f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
23 changes: 13 additions & 10 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,34 @@ def stop():
root.destroy()

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


root = Tk()
root.geometry('520x160')
root.geometry('470x270')
root.title('Simple AFK BOT')


label_working_time = Label(root, text="Enter how long should bot works (in seconds): ")
frame_main = LabelFrame(root, text="Main", padx=10, pady=10)
frame_main.place(x=10, height=200, width=450)

label_working_time = Label(frame_main, 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)
entry_working_time = Entry(frame_main)
entry_working_time.grid(row=0, column=1, padx=10, pady=10)

button_start = Button(root, text='Start', padx=30, command=go)
button_start.grid(row=1, column=1, columnspan=2, padx=50, pady=10)
button_start.place(x=155, y=150)

label_status = Label(root, text=f'Status: {main.status}')
label_status.grid(row=1, column=0, padx=50, pady=10)
label_status = Label(root, text=f'Status: BOT IS NOT WORKING')
label_status.place(x=110, y=10)

button_quit = Button(root, text="Quit", command=stop, padx=30)
button_quit.grid(row=3, column=1, padx=50, pady=10)
button_quit.place(x=125, y=220, height=30, width=200)

label_quit = Label(root,text="Press F8 to stop the bot")
label_quit.grid(row=3, column=0, padx=20, pady=10)
label_quit = Label(root,text="*PRESS F8 TO STOP BOTTING")
label_quit.place(x=270, y=152)

keyboard.add_hotkey('f8', stop)

Expand Down
10 changes: 4 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
import time
import random

status = "BOT IS NOT WORKING"


def go(working_time):
def go(working_time,bot_status):
time_delayed = 0.0
status = "BOT IS WORKING"
bot_status.config(text="Status: BOT IS WORKING")

# Primary monitor size
screen_width, screen_high = pag.size()
Expand All @@ -25,5 +22,6 @@ def go(working_time):
pag.press(['w', 's', 'a', 'd', 'space'])

time_delayed += 3
status = "BOTTING IS DONE"
bot_status.config(text="Status: BOT HAS FINISHED HIS WORK")


0 comments on commit 024c28f

Please sign in to comment.