mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge branch 'master' into feature/fullauto
This commit is contained in:
commit
23488d4c3d
@ -1,2 +1,2 @@
|
|||||||
from fishy.__main__ import main
|
from fishy.__main__ import main
|
||||||
__version__ = "0.4.5"
|
__version__ = "0.4.6"
|
||||||
|
@ -62,8 +62,6 @@ def initialize(window_to_hide):
|
|||||||
if not config.get("addoninstalled", 0) or helper.get_addonversion(chalutier[0]) < chalutier[2]:
|
if not config.get("addoninstalled", 0) or helper.get_addonversion(chalutier[0]) < chalutier[2]:
|
||||||
helper.install_addon(*chalutier)
|
helper.install_addon(*chalutier)
|
||||||
helper.install_addon(*lam2)
|
helper.install_addon(*lam2)
|
||||||
helper.remove_addon("ProvisionsChalutier") #TODO delete with fishy 0.4.6
|
|
||||||
helper.remove_addon("FooAddon") #TODO delete with fishy 0.4.6
|
|
||||||
config.set("addoninstalled", helper.get_addonversion(chalutier[0]))
|
config.set("addoninstalled", helper.get_addonversion(chalutier[0]))
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class SemiFisherEngine(IEngine):
|
|||||||
t = 0
|
t = 0
|
||||||
while t < 10.0:
|
while t < 10.0:
|
||||||
t += freq
|
t += freq
|
||||||
logging.debug(str(FishingMode.CurrentMode.label) + ":" + str(self.fishPixWindow.get_capture()[0][0]))
|
logging.debug(str(FishingMode.CurrentMode) + ":" + str(self.fishPixWindow.get_capture()[0][0]))
|
||||||
time.sleep(freq)
|
time.sleep(freq)
|
||||||
|
|
||||||
logging.debug("Will display pixel values for 10 seconds")
|
logging.debug("Will display pixel values for 10 seconds")
|
||||||
|
@ -33,7 +33,6 @@ class FishEvent:
|
|||||||
# initialize these
|
# initialize these
|
||||||
action_key = 'e'
|
action_key = 'e'
|
||||||
collect_key = 'r'
|
collect_key = 'r'
|
||||||
collect_allow_auto = False
|
|
||||||
sound = False
|
sound = False
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +58,6 @@ def init():
|
|||||||
FishEvent.jitter = config.get("jitter", False)
|
FishEvent.jitter = config.get("jitter", False)
|
||||||
FishEvent.action_key = config.get("action_key", 'e')
|
FishEvent.action_key = config.get("action_key", 'e')
|
||||||
FishEvent.collect_key = config.get("collect_key", 'r')
|
FishEvent.collect_key = config.get("collect_key", 'r')
|
||||||
FishEvent.collect_allow_auto = config.get("collect_allow_auto", False)
|
|
||||||
FishEvent.uid = config.get("uid")
|
FishEvent.uid = config.get("uid")
|
||||||
FishEvent.sound = config.get("sound_notification", False)
|
FishEvent.sound = config.get("sound_notification", False)
|
||||||
|
|
||||||
@ -161,10 +159,9 @@ def on_reelin():
|
|||||||
|
|
||||||
|
|
||||||
def on_loot():
|
def on_loot():
|
||||||
if FishEvent.collect_allow_auto:
|
_fishing_sleep(0)
|
||||||
_fishing_sleep(0.15)
|
|
||||||
keyboard.press_and_release(FishEvent.collect_key)
|
keyboard.press_and_release(FishEvent.collect_key)
|
||||||
_fishing_sleep(0.3)
|
_fishing_sleep(0)
|
||||||
|
|
||||||
|
|
||||||
def on_invfull():
|
def on_invfull():
|
||||||
|
@ -39,10 +39,7 @@ def loop(hsv):
|
|||||||
if all(hsv == s.value):
|
if all(hsv == s.value):
|
||||||
FishingMode.CurrentMode = s
|
FishingMode.CurrentMode = s
|
||||||
|
|
||||||
if FishingMode.CurrentMode == State.LOOKING:
|
if FishingMode.CurrentMode != FishingMode.PrevMode:
|
||||||
_notify(FishingMode.CurrentMode)
|
|
||||||
time.sleep(1)
|
|
||||||
elif FishingMode.CurrentMode != FishingMode.PrevMode:
|
|
||||||
_notify(FishingMode.CurrentMode)
|
_notify(FishingMode.CurrentMode)
|
||||||
|
|
||||||
FishingMode.PrevMode = FishingMode.CurrentMode
|
FishingMode.PrevMode = FishingMode.CurrentMode
|
||||||
|
@ -51,7 +51,6 @@ def start_semifisher_config(gui: 'GUI'):
|
|||||||
def save():
|
def save():
|
||||||
gui.config.set("action_key", action_key_entry.get(), False)
|
gui.config.set("action_key", action_key_entry.get(), False)
|
||||||
gui.config.set("collect_key", collect_key_entry.get(), False)
|
gui.config.set("collect_key", collect_key_entry.get(), False)
|
||||||
gui.config.set("collect_allow_auto", collect_allow_auto.instate(['selected']), False)
|
|
||||||
gui.config.set("borderless", borderless.instate(['selected']), False)
|
gui.config.set("borderless", borderless.instate(['selected']), False)
|
||||||
gui.config.set("jitter", jitter.instate(['selected']), False)
|
gui.config.set("jitter", jitter.instate(['selected']), False)
|
||||||
gui.config.set("sound_notification", sound.instate(['selected']), False)
|
gui.config.set("sound_notification", sound.instate(['selected']), False)
|
||||||
@ -65,10 +64,6 @@ def start_semifisher_config(gui: 'GUI'):
|
|||||||
if web.sub():
|
if web.sub():
|
||||||
gui._notify.set(1)
|
gui._notify.set(1)
|
||||||
|
|
||||||
def toggle_collect():
|
|
||||||
gui.config.set("collect_allow_auto", collect_allow_auto.instate(['selected']), False)
|
|
||||||
collect_key_entry['state'] = NORMAL if config.get("collect_allow_auto") else DISABLED
|
|
||||||
|
|
||||||
def del_entry_key(event):
|
def del_entry_key(event):
|
||||||
event.widget.delete(0,"end")
|
event.widget.delete(0,"end")
|
||||||
event.widget.insert(0, str(event.char))
|
event.widget.insert(0, str(event.char))
|
||||||
@ -98,15 +93,10 @@ def start_semifisher_config(gui: 'GUI'):
|
|||||||
action_key_entry.insert(0, config.get("action_key", "e"))
|
action_key_entry.insert(0, config.get("action_key", "e"))
|
||||||
action_key_entry.bind("<KeyRelease>", del_entry_key)
|
action_key_entry.bind("<KeyRelease>", del_entry_key)
|
||||||
|
|
||||||
Label(controls_frame, text="Auto-Looting: ").grid(row=3, column=0, pady=(15, 0))
|
Label(controls_frame, text="Looting Key:").grid(row=4, column=0, pady=(5, 5))
|
||||||
collect_allow_auto = Checkbutton(controls_frame, command=toggle_collect, var=BooleanVar(value=config.get("collect_allow_auto")))
|
|
||||||
collect_allow_auto.grid(row=3, column=1, pady=(15, 0))
|
|
||||||
|
|
||||||
Label(controls_frame, text="Looting Key:").grid(row=4, column=0, pady=(0, 15))
|
|
||||||
collect_key_entry = Entry(controls_frame, justify=CENTER)
|
collect_key_entry = Entry(controls_frame, justify=CENTER)
|
||||||
collect_key_entry.grid(row=4, column=1, pady=(0, 15))
|
collect_key_entry.grid(row=4, column=1, pady=(5, 5))
|
||||||
collect_key_entry.insert(0, config.get("collect_key", "r"))
|
collect_key_entry.insert(0, config.get("collect_key", "r"))
|
||||||
collect_key_entry['state'] = NORMAL if config.get("collect_allow_auto") else DISABLED
|
|
||||||
collect_key_entry.bind("<KeyRelease>", del_entry_key)
|
collect_key_entry.bind("<KeyRelease>", del_entry_key)
|
||||||
|
|
||||||
Label(controls_frame, text="Sound Notification: ").grid(row=5, column=0, pady=(5, 5))
|
Label(controls_frame, text="Sound Notification: ").grid(row=5, column=0, pady=(5, 5))
|
||||||
|
@ -2,6 +2,7 @@ import logging
|
|||||||
import uuid
|
import uuid
|
||||||
from tkinter import OptionMenu, Button, IntVar
|
from tkinter import OptionMenu, Button, IntVar
|
||||||
from typing import List, Callable, Optional, Dict, Any
|
from typing import List, Callable, Optional, Dict, Any
|
||||||
|
import queue
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from fishy.web import web
|
from fishy.web import web
|
||||||
@ -25,8 +26,8 @@ class GUI:
|
|||||||
self._start_restart = False
|
self._start_restart = False
|
||||||
self._destroyed = True
|
self._destroyed = True
|
||||||
self._log_strings = []
|
self._log_strings = []
|
||||||
self._function_queue: Dict[str, Callable] = {}
|
self._function_queue = queue.Queue()
|
||||||
self._result_queue: Dict[str, Any] = {}
|
self._result_dict: Dict[str, Any] = {}
|
||||||
self._bot_running = False
|
self._bot_running = False
|
||||||
|
|
||||||
# UI items
|
# UI items
|
||||||
@ -72,21 +73,21 @@ class GUI:
|
|||||||
self._thread.start()
|
self._thread.start()
|
||||||
|
|
||||||
def _clear_function_queue(self):
|
def _clear_function_queue(self):
|
||||||
while len(self._function_queue) > 0:
|
while not self._function_queue.empty():
|
||||||
_id, func = self._function_queue.popitem()
|
_id, func = self._function_queue.get()
|
||||||
result = func()
|
result = func()
|
||||||
self._result_queue[_id] = result
|
self._result_dict[_id] = result
|
||||||
|
|
||||||
def call_in_thread(self, func: Callable, block=False):
|
def call_in_thread(self, func: Callable, block=False):
|
||||||
_id = str(uuid.uuid4())
|
_id = str(uuid.uuid4())
|
||||||
self._function_queue[_id] = func
|
self._function_queue.put((_id, func))
|
||||||
|
|
||||||
if not block:
|
if not block:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
wait_until(lambda: _id in self._result_queue)
|
wait_until(lambda: _id in self._result_dict)
|
||||||
|
|
||||||
return self._result_queue.pop(_id)
|
return self._result_dict.pop(_id)
|
||||||
|
|
||||||
def _get_start_stop_text(self):
|
def _get_start_stop_text(self):
|
||||||
return "STOP (F9)" if self._bot_running else "START (F9)"
|
return "STOP (F9)" if self._bot_running else "START (F9)"
|
||||||
|
@ -63,9 +63,6 @@ def send_notification(message):
|
|||||||
@uses_session
|
@uses_session
|
||||||
@fallback(None)
|
@fallback(None)
|
||||||
def send_hole_deplete(fish_caught, hole_time, fish_times):
|
def send_hole_deplete(fish_caught, hole_time, fish_times):
|
||||||
if not is_subbed()[0]:
|
|
||||||
return False
|
|
||||||
|
|
||||||
hole_data = {
|
hole_data = {
|
||||||
"fish_caught": fish_caught,
|
"fish_caught": fish_caught,
|
||||||
"hole_time": hole_time,
|
"hole_time": hole_time,
|
||||||
|
Loading…
Reference in New Issue
Block a user