New build script + bg farming bot v1
This commit is contained in:
+5
-1
@@ -1,4 +1,5 @@
|
||||
from core.Monitor import Monitor
|
||||
from bots.battleground.battlegroundAgent import BattlegroundAgent
|
||||
from bots.fishing.FishingAgent import FishingAgent
|
||||
from bots.idling.IdlingAgent import IdlingAgent
|
||||
from core.Player import Player, PLAYER_STATE
|
||||
@@ -9,6 +10,7 @@ class MainAgent:
|
||||
self.playerAgent = Player(self.monitor)
|
||||
self.idlingBot = IdlingAgent(self.monitor, self.playerAgent)
|
||||
self.fishingBot = FishingAgent(self.monitor, self.playerAgent)
|
||||
self.bgFarming = BattlegroundAgent(self.monitor, self.playerAgent)
|
||||
self.monitor.startScreenCaptureThread()
|
||||
# Start idling agent at the construction of the mainAgent for now
|
||||
self.idlingBot.run()
|
||||
@@ -17,4 +19,6 @@ class MainAgent:
|
||||
self.playerAgent.changeState(PLAYER_STATE.FISHING)
|
||||
self.fishingBot.run()
|
||||
|
||||
|
||||
def startBgBot(self):
|
||||
self.playerAgent.changeState(PLAYER_STATE.BG_FARMING)
|
||||
self.bgFarming.run()
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class Monitor:
|
||||
|
||||
matchRatio = max_val * 100
|
||||
self.logger.log(matchRatio)
|
||||
if (matchRatio < 60):
|
||||
if (matchRatio < 50):
|
||||
self.logger.log("Cannot find matching result...")
|
||||
return -1
|
||||
|
||||
|
||||
+1
-4
@@ -7,7 +7,7 @@ from core.Logger import Logger
|
||||
|
||||
CONNECT_STATUS = Enum('CONNECT_STATUS', ["CONNECTED", "CONNECTING", "DISCONNECTED"])
|
||||
CLASSES = Enum('CLASSES', ['DRUID', 'MAGE', 'HUNTER', 'PRIEST'])
|
||||
PLAYER_STATE = Enum('STATE', ['IDLE', 'FISHING', 'FARMING'])
|
||||
PLAYER_STATE = Enum('STATE', ['IDLE', 'FISHING', 'FARMING', 'BG_FARMING'])
|
||||
|
||||
class Player:
|
||||
def __init__(self, monitor) -> None:
|
||||
@@ -35,8 +35,5 @@ class Player:
|
||||
pyautogui.click()
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
|
||||
|
||||
def changeState(self, newState):
|
||||
self.state = newState
|
||||
@@ -12,6 +12,7 @@ class CLIAgent:
|
||||
def printMenu(self):
|
||||
print("Enter a command:")
|
||||
print("\tH\tHelp.")
|
||||
print("\tBG\tStart the bg farming agent.")
|
||||
print("\tF\tStart the fishing agent.")
|
||||
print("\tQ\tQuit.")
|
||||
print("$>> ", end='')
|
||||
@@ -24,8 +25,9 @@ class CLIAgent:
|
||||
userInput = input()
|
||||
userInput = str.lower(userInput).strip()
|
||||
|
||||
if (userInput == "f"):
|
||||
self.logger.log("Starting Fishing bot...")
|
||||
if (userInput == "bg"):
|
||||
self.mainAgent.startBgBot()
|
||||
elif (userInput == "f"):
|
||||
self.mainAgent.startFishBot()
|
||||
elif (userInput == "h"):
|
||||
self.printMenu()
|
||||
|
||||
Reference in New Issue
Block a user