Skip to content

Commit

Permalink
added a button to enable/disable the mini ftool
Browse files Browse the repository at this point in the history
  • Loading branch information
None authored and None committed May 21, 2023
1 parent a7dbfb4 commit c076fda
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
7 changes: 6 additions & 1 deletion MiniPyFlyff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tkinter import Tk, Button, Label, Entry, X, LEFT, Frame, Checkbutton, IntVar, Menu, END
from tkinter import Tk, Button, Label, Entry, X, LEFT, RIGHT, Frame, Checkbutton, IntVar, Menu, END
import miscs
import keyboardListener
import miniFtool
Expand Down Expand Up @@ -92,6 +92,11 @@
button_mini_ftool_start_stop.pack(side=LEFT, padx=1, pady=1)
button_mini_ftool_start_stop.config(command=lambda: toolControl.start_stop_mini_ftool(button_mini_ftool_start_stop))

button_mini_ftool_enable_disable = Button(frame_mini_ftool_buttons, text="Enable", width=10)
button_mini_ftool_enable_disable.pack(side=RIGHT, padx=1, pady=1)
button_mini_ftool_enable_disable.config(
command=lambda: toolControl.enable_disable_mini_ftool(button_mini_ftool_enable_disable))

entry_alt_control_keys.insert(END, saveConfigs.open_json_config()[0])
entry_mini_ftool_key.insert(END, saveConfigs.open_json_config()[1])
entry_mini_ftool_timers.insert(END, saveConfigs.open_json_config()[2])
Expand Down
2 changes: 2 additions & 0 deletions globalVariables.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mini_ftool_on = False

mini_ftool_enable_disabled = False

alt_control_on = False

mini_ftool_hotkey = None
Expand Down
Binary file modified help/help.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions helpWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
You can check the box "Make Timers Random" to generate a random
delay between each key press.
You can start/stop the Mini Ftool loop by clicking the button to
Start/Stop it, or you can setup a shortcut to start/stop it.
You can start/stop the Mini Ftool loop by clicking the button to
Start/Stop it, you also can setup a shortcut.
You can enable/disable the Mini Ftool by clicking the button to
enable/disable it.
Click the button below to see a picture of a valid Mini PyFlyff
configuration:"""
Expand All @@ -29,15 +32,15 @@ def open_help():
help_window = Toplevel()

window_width = 400
window_height = 400
window_height = 425

screen_width = help_window.winfo_screenwidth()
screen_height = help_window.winfo_screenheight()

x = (screen_width / 2) - (window_width / 2)
y = (screen_height / 2) - (window_height / 2)

help_window.geometry("400x400+" + str(int(x)) + "+" + str(int(y)))
help_window.geometry("400x425+" + str(int(x)) + "+" + str(int(y)))

help_window.title("Help")
if os.path.isfile("icon/PyFlyff.ico"):
Expand Down
2 changes: 1 addition & 1 deletion miniFtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def mini_ftool(check):
while True:
try:
if globalVariables.mini_ftool_on:
if globalVariables.mini_ftool_on and globalVariables.mini_ftool_enable_disabled:
for key, timer in zip(globalVariables.mini_ftool_keys, globalVariables.mini_ftool_key_timers):
browserControl.mini_ftool_send_keys(key)

Expand Down
9 changes: 9 additions & 0 deletions toolControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ def start_stop_mini_ftool(button):
else:
globalVariables.mini_ftool_on = True
button["text"] = "Stop"


def enable_disable_mini_ftool(button):
if globalVariables.mini_ftool_enable_disabled:
globalVariables.mini_ftool_enable_disabled = False
button["text"] = "Enable"
else:
globalVariables.mini_ftool_enable_disabled = True
button["text"] = "Disable"

0 comments on commit c076fda

Please sign in to comment.