Added new cli parser
This commit is contained in:
parent
9b0fe2183b
commit
c1bdce49a8
|
|
@ -9,11 +9,17 @@ class FightingAgent:
|
||||||
self.player = player
|
self.player = player
|
||||||
self.logger = Logger("Combat Agent", player.debug)
|
self.logger = Logger("Combat Agent", player.debug)
|
||||||
self.hasTarget = False
|
self.hasTarget = False
|
||||||
|
self.combatClass = self.loadCombatClass()
|
||||||
|
|
||||||
|
def loadCombatClass(self):
|
||||||
|
return 42
|
||||||
|
|
||||||
def startFighting(self):
|
def startFighting(self):
|
||||||
self.player.checkConnection()
|
self.player.checkConnection()
|
||||||
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...")
|
||||||
|
|
||||||
|
|
|
||||||
4
bots/fighting/hunter/marksmanship/Routine.py
Normal file
4
bots/fighting/hunter/marksmanship/Routine.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
class Routine:
|
||||||
|
def __init__(self, monitor, player) -> None:
|
||||||
|
self.player = player
|
||||||
|
self.monitor = monitor
|
||||||
8
config_Aelyss.json
Normal file
8
config_Aelyss.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"antiAfk": true,
|
||||||
|
"class": "HUNTER",
|
||||||
|
"spe": "MARKSMANSHIP",
|
||||||
|
"debug": false,
|
||||||
|
"lang": "en",
|
||||||
|
"name": "Aelyss"
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import json
|
import json
|
||||||
class Config:
|
class Config:
|
||||||
def __init__(self) -> None:
|
def __init__(self, configName = "config") -> None:
|
||||||
with open("config.json", encoding="utf-8") as jsonFile:
|
with open(configName + ".json", encoding="utf-8") as jsonFile:
|
||||||
self.file = json.load(jsonFile)
|
self.file = json.load(jsonFile)
|
||||||
|
|
@ -7,8 +7,8 @@ from bots.idling.IdlingAgent import IdlingAgent
|
||||||
from core.Player import Player, PLAYER_STATE
|
from core.Player import Player, PLAYER_STATE
|
||||||
|
|
||||||
class MainAgent:
|
class MainAgent:
|
||||||
def __init__(self) -> None:
|
def __init__(self, configName = "config ") -> None:
|
||||||
self.config = Config()
|
self.config = Config(configName)
|
||||||
self.monitor = Monitor(self.config)
|
self.monitor = Monitor(self.config)
|
||||||
self.playerAgent = Player(self.monitor, self.config)
|
self.playerAgent = Player(self.monitor, self.config)
|
||||||
self.idlingBot = IdlingAgent(self.monitor, self.playerAgent)
|
self.idlingBot = IdlingAgent(self.monitor, self.playerAgent)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ class CLIAgent:
|
||||||
def __init__(self, mainAgent) -> None:
|
def __init__(self, mainAgent) -> None:
|
||||||
self.isRunning = False
|
self.isRunning = False
|
||||||
self.logger = Logger("CliAgent")
|
self.logger = Logger("CliAgent")
|
||||||
|
|
||||||
if (not mainAgent):
|
if (not mainAgent):
|
||||||
raise Exception("Main agent not found...")
|
raise Exception("Main agent not found...")
|
||||||
self.mainAgent = mainAgent
|
self.mainAgent = mainAgent
|
||||||
|
|
|
||||||
37
main.py
37
main.py
|
|
@ -1,9 +1,44 @@
|
||||||
|
import sys
|
||||||
from core.cli.CliAgent import CLIAgent
|
from core.cli.CliAgent import CLIAgent
|
||||||
from core.MainAgent import MainAgent
|
from core.MainAgent import MainAgent
|
||||||
|
|
||||||
|
def printLogo():
|
||||||
|
print("""
|
||||||
|
,--,
|
||||||
|
,--.'|
|
||||||
|
.---. ,---. | | :
|
||||||
|
/. ./| ' ,'\\ ,--, ,--, : : '
|
||||||
|
.-'-. ' | / / ||'. \\/ .`| ,---. | ' |
|
||||||
|
/___/ \\: |. ; ,. :' \\/ / ; / \\ ' | |
|
||||||
|
.-'.. ' ' .' | |: : \\ \\.' / / / || | :
|
||||||
|
/___/ \\: '' | .; : \\ ; ; . ' / |' : |__
|
||||||
|
. \\ ' .\\ | : | / \\ \\ \\ ' ; /|| | '.'|
|
||||||
|
\\ \\ ' \\ | \\ \\ /./__; ; \' | / |; : ;
|
||||||
|
\\ \\ |--" `----' | :/\\ \\ ;| : || , /
|
||||||
|
\\ \\ | `---' `--` \\ \\ / ---`-'
|
||||||
|
'---" `----'
|
||||||
|
""")
|
||||||
|
|
||||||
###### MAIN ########
|
###### MAIN ########
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
mainAgent = MainAgent()
|
configName = "config"
|
||||||
|
length = len(sys.argv)
|
||||||
|
for i in range(1, length):
|
||||||
|
arg = sys.argv[i]
|
||||||
|
if (arg == "-c" or arg == "--config"):
|
||||||
|
configName = sys.argv[i + 1]
|
||||||
|
elif (arg == "-h" or arg == "--help"):
|
||||||
|
printLogo()
|
||||||
|
print("usage: wowxel [-h] -c CONFIG_FILE_NAME")
|
||||||
|
print("wowxel: A pixel bot for World of Warcraft")
|
||||||
|
print("optional arguments:")
|
||||||
|
print("-h, --help show this help message and exit")
|
||||||
|
print("-c CONFIG_FILE_NAME, --config CONFIG_FILE_NAME Specify the path to the configuration file (config by default)")
|
||||||
|
print("\n")
|
||||||
|
quit()
|
||||||
|
|
||||||
|
|
||||||
|
mainAgent = MainAgent(configName)
|
||||||
cliAgent = CLIAgent(mainAgent)
|
cliAgent = CLIAgent(mainAgent)
|
||||||
|
|
||||||
cliAgent.run()
|
cliAgent.run()
|
||||||
Loading…
Reference in New Issue
Block a user