Add routine for hunter mark first step
This commit is contained in:
parent
da1ba01120
commit
fe2d532dc1
9
bots/components/spell.py
Normal file
9
bots/components/spell.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import cv2 as cv
|
||||
|
||||
class Spell:
|
||||
def __init__(self, monitor, path, cooldown) -> None:
|
||||
self.monitor = monitor
|
||||
self.spellIcon = cv.imread("assets/spells/" + path, cv.IMREAD_GRAYSCALE)
|
||||
|
||||
def click():
|
||||
self.monitor.findMatchAndClickIfAvailable(self.spellIcon)
|
||||
|
|
@ -1,25 +1,34 @@
|
|||
import time
|
||||
from threading import Thread
|
||||
from core.Logger import Logger
|
||||
from core.Player import CLASSES, SPE
|
||||
|
||||
class FightingAgent:
|
||||
def __init__(self, monitor, player) -> None:
|
||||
self.isCombatModeEnabled = False
|
||||
self.monitor = monitor
|
||||
self.player = player
|
||||
self.classRoutine = None
|
||||
self.logger = Logger("Combat Agent", player.debug)
|
||||
self.hasTarget = False
|
||||
self.combatClass = self.loadCombatClass()
|
||||
self.getRoutine()
|
||||
|
||||
def loadCombatClass(self):
|
||||
return 42
|
||||
|
||||
def getRoutine(self):
|
||||
if (self.player.playerClass == CLASSES.HUNTER and self.player.player.playerSpe == SPE.MARKSMANSHIP):
|
||||
from bots.fighting.hunter.marksmanship.Routine import Routine
|
||||
else:
|
||||
self.logger.log("Cannot find a Routine for your class and spe")
|
||||
self.classRoutine = Routine(self.monitor, self.player)
|
||||
|
||||
def startFighting(self):
|
||||
self.player.checkConnection()
|
||||
self.classRoutine.start()
|
||||
self.isCombatModeEnabled = True
|
||||
|
||||
while self.isCombatModeEnabled is True:
|
||||
|
||||
time.sleep(0.1)
|
||||
self.logger.log("Combat mode is now disabled...")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
from bots.components.spell import Spell
|
||||
|
||||
class Routine:
|
||||
def __init__(self, monitor, player) -> None:
|
||||
self.player = player
|
||||
self.monitor = monitor
|
||||
self.monitor = monitor
|
||||
self.arcaneShotSpell = Spell(monitor, "hunter/general/ArcaneShot.jpg")
|
||||
|
||||
def hasTarget(self):
|
||||
pass
|
||||
|
||||
def start(self):
|
||||
print("Starting fight routine")
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"antiAfk": true,
|
||||
"class": "DRUID",
|
||||
"spe": "MARKSMANSHIP",
|
||||
"spe": "RESTORATION",
|
||||
"debug": false,
|
||||
"lang": "en",
|
||||
"name": "Droïde"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import json
|
||||
from enum import Enum
|
||||
import time
|
||||
import cv2 as cv
|
||||
|
|
@ -6,6 +5,7 @@ from core.Logger import Logger
|
|||
|
||||
CONNECT_STATUS = Enum('CONNECT_STATUS', ["CONNECTED", "CONNECTING", "DISCONNECTED"])
|
||||
CLASSES = Enum('CLASSES', ['DRUID', 'MAGE', 'HUNTER', 'PRIEST'])
|
||||
SPE = Enum('SPE', ['MARKSMANSHIP'])
|
||||
PLAYER_STATE = Enum('STATE', ['IDLE', 'FISHING', 'FARMING', 'BG_FARMING'])
|
||||
|
||||
class Player:
|
||||
|
|
@ -20,6 +20,7 @@ class Player:
|
|||
self.state = PLAYER_STATE.IDLE
|
||||
self.monitor = monitor
|
||||
self.playerClass = self.config.file["class"]
|
||||
self.playerSpe = self.config.file["spe"]
|
||||
self.playerName = self.config.file["name"]
|
||||
self.enterWorldButton = cv.imread("assets/" + self.lang + "/menus/EnterWorldButton.jpg", cv.IMREAD_GRAYSCALE)
|
||||
self.reconnectButton = cv.imread("assets/" + self.lang + "/menus/Reconnect.jpg", cv.IMREAD_GRAYSCALE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user