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
|
import time
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from core.Logger import Logger
|
from core.Logger import Logger
|
||||||
|
from core.Player import CLASSES, SPE
|
||||||
|
|
||||||
class FightingAgent:
|
class FightingAgent:
|
||||||
def __init__(self, monitor, player) -> None:
|
def __init__(self, monitor, player) -> None:
|
||||||
self.isCombatModeEnabled = False
|
self.isCombatModeEnabled = False
|
||||||
self.monitor = monitor
|
self.monitor = monitor
|
||||||
self.player = player
|
self.player = player
|
||||||
|
self.classRoutine = None
|
||||||
self.logger = Logger("Combat Agent", player.debug)
|
self.logger = Logger("Combat Agent", player.debug)
|
||||||
self.hasTarget = False
|
self.hasTarget = False
|
||||||
self.combatClass = self.loadCombatClass()
|
self.combatClass = self.loadCombatClass()
|
||||||
|
self.getRoutine()
|
||||||
|
|
||||||
def loadCombatClass(self):
|
def loadCombatClass(self):
|
||||||
return 42
|
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):
|
def startFighting(self):
|
||||||
self.player.checkConnection()
|
self.player.checkConnection()
|
||||||
|
self.classRoutine.start()
|
||||||
self.isCombatModeEnabled = True
|
self.isCombatModeEnabled = True
|
||||||
|
|
||||||
while self.isCombatModeEnabled is True:
|
while self.isCombatModeEnabled is True:
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
self.logger.log("Combat mode is now disabled...")
|
self.logger.log("Combat mode is now disabled...")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,13 @@
|
||||||
|
from bots.components.spell import Spell
|
||||||
|
|
||||||
class Routine:
|
class Routine:
|
||||||
def __init__(self, monitor, player) -> None:
|
def __init__(self, monitor, player) -> None:
|
||||||
self.player = player
|
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,
|
"antiAfk": true,
|
||||||
"class": "DRUID",
|
"class": "DRUID",
|
||||||
"spe": "MARKSMANSHIP",
|
"spe": "RESTORATION",
|
||||||
"debug": false,
|
"debug": false,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"name": "Droïde"
|
"name": "Droïde"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import json
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import time
|
import time
|
||||||
import cv2 as cv
|
import cv2 as cv
|
||||||
|
|
@ -6,6 +5,7 @@ from core.Logger import Logger
|
||||||
|
|
||||||
CONNECT_STATUS = Enum('CONNECT_STATUS', ["CONNECTED", "CONNECTING", "DISCONNECTED"])
|
CONNECT_STATUS = Enum('CONNECT_STATUS', ["CONNECTED", "CONNECTING", "DISCONNECTED"])
|
||||||
CLASSES = Enum('CLASSES', ['DRUID', 'MAGE', 'HUNTER', 'PRIEST'])
|
CLASSES = Enum('CLASSES', ['DRUID', 'MAGE', 'HUNTER', 'PRIEST'])
|
||||||
|
SPE = Enum('SPE', ['MARKSMANSHIP'])
|
||||||
PLAYER_STATE = Enum('STATE', ['IDLE', 'FISHING', 'FARMING', 'BG_FARMING'])
|
PLAYER_STATE = Enum('STATE', ['IDLE', 'FISHING', 'FARMING', 'BG_FARMING'])
|
||||||
|
|
||||||
class Player:
|
class Player:
|
||||||
|
|
@ -20,6 +20,7 @@ class Player:
|
||||||
self.state = PLAYER_STATE.IDLE
|
self.state = PLAYER_STATE.IDLE
|
||||||
self.monitor = monitor
|
self.monitor = monitor
|
||||||
self.playerClass = self.config.file["class"]
|
self.playerClass = self.config.file["class"]
|
||||||
|
self.playerSpe = self.config.file["spe"]
|
||||||
self.playerName = self.config.file["name"]
|
self.playerName = self.config.file["name"]
|
||||||
self.enterWorldButton = cv.imread("assets/" + self.lang + "/menus/EnterWorldButton.jpg", cv.IMREAD_GRAYSCALE)
|
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)
|
self.reconnectButton = cv.imread("assets/" + self.lang + "/menus/Reconnect.jpg", cv.IMREAD_GRAYSCALE)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user