2020-11-07 16:40:57 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
from fishy.engine.fullautofisher.engine import FullAuto
|
|
|
|
|
|
|
|
|
|
|
|
class Test:
|
|
|
|
def __init__(self, engine: FullAuto):
|
|
|
|
self.engine = engine
|
|
|
|
self.target = None
|
|
|
|
|
2021-05-15 12:20:38 +00:00
|
|
|
# noinspection PyProtectedMember
|
2022-02-01 16:50:57 +00:00
|
|
|
def print_coords(self):
|
2021-05-15 12:20:38 +00:00
|
|
|
logging.info(self.engine.get_coords())
|
2020-11-07 16:40:57 +00:00
|
|
|
|
|
|
|
def set_target(self):
|
2021-05-15 12:20:38 +00:00
|
|
|
self.target = self.engine.get_coords()
|
2020-11-07 16:40:57 +00:00
|
|
|
logging.info(f"target_coods are {self.target}")
|
|
|
|
|
|
|
|
def move_to_target(self):
|
|
|
|
if not self.target:
|
|
|
|
logging.info("please set a target first")
|
|
|
|
self.engine.move_to(self.target)
|
|
|
|
|
|
|
|
def rotate_to_target(self):
|
|
|
|
if not self.target:
|
|
|
|
logging.info("please set a target first")
|
|
|
|
self.engine.rotate_to(self.target[2])
|
|
|
|
|
|
|
|
def look_for_hole(self):
|
|
|
|
logging.info("looking for a hole")
|
|
|
|
|
|
|
|
if self.engine.look_for_hole():
|
|
|
|
logging.info("found a hole")
|
|
|
|
else:
|
|
|
|
logging.info("no hole found")
|