Added debug mode + fighting agent class

This commit is contained in:
2024-09-22 16:00:48 -04:00
parent 29f9ce5140
commit 9b0fe2183b
20 changed files with 87 additions and 28 deletions
+31
View File
@@ -0,0 +1,31 @@
import time
from threading import Thread
from core.Logger import Logger
class FightingAgent:
def __init__(self, monitor, player) -> None:
self.isCombatModeEnabled = False
self.monitor = monitor
self.player = player
self.logger = Logger("Combat Agent", player.debug)
self.hasTarget = False
def startFighting(self):
self.player.checkConnection()
self.isCombatModeEnabled = True
while self.isCombatModeEnabled is True:
time.sleep(0.1)
self.logger.log("Combat mode is now disabled...")
def stopFighting(self):
self.isCombatModeEnabled = False
def run(self):
self.logger.log("Combat mode is now enabled...")
fightingThread = Thread(
target=self.startFighting,
args=(),
name="fighting thread",
daemon=True)
fightingThread.start()