diff --git a/fishy/__main__.py b/fishy/__main__.py index 9e01a2e..31021d8 100644 --- a/fishy/__main__.py +++ b/fishy/__main__.py @@ -3,14 +3,12 @@ Usage: fishy.py -h | --help fishy.py -v | --version - fishy.py [--debug] [--ip=] [--hook-threshold=] [--check-frequency=] [--collect-r] [--borderless] + fishy.py [--debug] [--ip=] [--collect-r] [--borderless] Options: -h, --help Show this screen. -v, --version Show version. --ip= Local Ip Address of the android phone. - --hook-threshold= Threshold amount for classifier after which label changes [default: 1]. - --check-frequency= Sleep after loop in s [default: 1]. --debug Start program in debug controls. --borderless Use if the game is in fullscreen or borderless window """ @@ -22,14 +20,7 @@ import cv2 from docopt import docopt from pynput.keyboard import Listener -from fishy.systems.controls import Control -from fishy.systems.fishing_event import HookEvent, StickEvent, LookEvent, IdleEvent -from fishy.systems.fishing_mode import FishingMode -from fishy.systems.globals import G -from fishy.systems.log import Log -from fishy.systems.pixel_loc import PixelLoc -import fishy.systems.fishy_network as net -from fishy.systems.window import Window +from fishy.systems import * """ Start reading from `init.py` @@ -85,13 +76,12 @@ def startFishing(): """ Control.current = 1 if G.arguments["--debug"] else 0 - FishingMode.Threshold = int(G.arguments["--hook-threshold"]) use_net = G.arguments["--ip"] is not None if use_net: net.initialize(G.arguments["--ip"]) - sleepFor = (1 / float(G.arguments["--check-frequency"])) + sleepFor = 1 # initializes fishing modes and their callbacks FishingMode("hook", 0, HookEvent()) diff --git a/fishy/systems/__init__.py b/fishy/systems/__init__.py index e69de29..52833e1 100644 --- a/fishy/systems/__init__.py +++ b/fishy/systems/__init__.py @@ -0,0 +1,8 @@ +from fishy.systems.controls import Control +from fishy.systems.fishing_event import HookEvent, StickEvent, LookEvent, IdleEvent +from fishy.systems.fishing_mode import FishingMode +from fishy.systems.globals import G +from fishy.systems.log import Log +from fishy.systems.pixel_loc import PixelLoc +import fishy.systems.fishy_network as net +from fishy.systems.window import Window diff --git a/fishy/systems/gui.py b/fishy/systems/gui.py new file mode 100644 index 0000000..8c2f25f --- /dev/null +++ b/fishy/systems/gui.py @@ -0,0 +1,78 @@ +from tkinter import * + + +def start(): + writeToLog(console, "yo") + + +def writeToLog(log, msg): + numlines = log.index('end - 1 line').split('.')[0] + log['state'] = 'normal' + if int(numlines) >= 50: # delete old lines + log.delete(1.0, 2.0) + if log.index('end-1c') != '1.0': # new line for each log + log.insert('end', '\n') + log.insert('end', msg) + log.see("end") # scroll to bottom + log['state'] = 'disabled' + + +root = Tk() +root.title("Fiishybot for Elder Scrolls Online") +root.geometry('600x600') + +# region menu +menubar = Menu(root) + +filemenu = Menu(menubar, tearoff=0) +filemenu.add_command(label="Create Shortcut", command=start) +menubar.add_cascade(label="File", menu=filemenu) + +debug_menu = Menu(menubar, tearoff=0) +debug_menu.add_command(label="Check PixelVal", command=start) +debug_menu.add_command(label="LogDump", command=start) +menubar.add_cascade(label="Debug", menu=debug_menu) +root.config(menu=menubar) +# endregion + +# region console +console = Text(root, state='disabled', wrap='none') +console.pack(fill=BOTH, expand=True, pady=(15, 15), padx=(5, 5)) +console.mark_set("sentinel", INSERT) +console.config(state=DISABLED) + +controls_frame = Frame(root) +# endregion + +# region controls +left_frame = Frame(controls_frame) + +Label(left_frame, text="IP").grid(row=0, column=0) +ip = Entry(left_frame) +ip.grid(row=0, column=1) + +Label(left_frame, text="Fullscreen: ").grid(row=1, column=0, pady=(5, 5)) +borderless = Checkbutton(left_frame) +borderless.grid(row=1, column=1) + +left_frame.grid(row=0, column=0) + +right_frame = Frame(controls_frame) + +Label(right_frame, text="Action Key:").grid(row=0, column=0) +action_key_entry = Entry(right_frame) +action_key_entry.grid(row=0, column=1) +action_key_entry.insert(0, "e") + +Label(right_frame, text="Press start").grid(row=1, columnspan=2, pady=(5, 5)) + +right_frame.grid(row=0, column=1, padx=(50, 0)) + +controls_frame.pack() +Button(root, text="START", width=25, command=start).pack(pady=(15, 15)) +# endregion + +# root.update() + +# root.minsize(root.winfo_width(), root.winfo_height()) +root.mainloop()