44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
import cv2 as cv
|
|
|
|
class CLIAgent:
|
|
def __init__(self, mainAgent) -> None:
|
|
self.isRunning = False
|
|
if (not mainAgent):
|
|
raise Exception("CLI: Main agent not found...")
|
|
self.mainAgent = mainAgent
|
|
|
|
def printMenu(self):
|
|
print("Enter a command:")
|
|
print("\tH\tHelp.")
|
|
print("\tF\tStart the fishing agent.")
|
|
print("\tQ\tQuit.")
|
|
print("$>> ", end='')
|
|
|
|
def run(self):
|
|
self.isRunning = True
|
|
|
|
self.printMenu()
|
|
while self.isRunning:
|
|
userInput = input()
|
|
userInput = str.lower(userInput).strip()
|
|
|
|
if (userInput == "f"):
|
|
print("Starting Fishing bot...")
|
|
self.mainAgent.startScreenCaptureThread()
|
|
break
|
|
# fishingAgent = FishingAgent(mainAgent)
|
|
# fishingAgent.run()
|
|
elif (userInput == "h"):
|
|
self.printMenu()
|
|
break
|
|
elif (userInput == "q"):
|
|
cv.destroyAllWindows()
|
|
print("Exiting application...")
|
|
self.isRunning = False
|
|
break
|
|
else:
|
|
print("Unknown Command.")
|
|
self.printMenu()
|
|
break
|
|
|