Add main agent, cli and opencv image template comparison test
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user