Add some items, repair to_make_recursive
This commit is contained in:
parent
9644cc5619
commit
3de2568dfa
@ -13,6 +13,9 @@ class MainClass:
|
|||||||
self.optimizer = optimizer.Optimizer()
|
self.optimizer = optimizer.Optimizer()
|
||||||
|
|
||||||
async def best_place_mine(self, msg, command, args):
|
async def best_place_mine(self, msg, command, args):
|
||||||
|
if len(args) == 0:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["NotEnoughParamError"])
|
||||||
|
return
|
||||||
if args[0] not in self.optimizer.mines["0"].keys():
|
if args[0] not in self.optimizer.mines["0"].keys():
|
||||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["error"]["OreNotFoundError"].format(ore=args[0]))
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["error"]["OreNotFoundError"].format(ore=args[0]))
|
||||||
return
|
return
|
||||||
@ -42,6 +45,9 @@ class MainClass:
|
|||||||
self.optimizer = optimizer.Optimizer()
|
self.optimizer = optimizer.Optimizer()
|
||||||
|
|
||||||
async def to_make(self, msg, command, args):
|
async def to_make(self, msg, command, args):
|
||||||
|
if len(args) == 0:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["NotEnoughParamError"])
|
||||||
|
return
|
||||||
if args[0] not in self.optimizer.items.keys():
|
if args[0] not in self.optimizer.items.keys():
|
||||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
||||||
return
|
return
|
||||||
@ -59,6 +65,11 @@ class MainClass:
|
|||||||
value=result["value"]))
|
value=result["value"]))
|
||||||
|
|
||||||
async def to_make_recursive(self, msg, command, args):
|
async def to_make_recursive(self, msg, command, args):
|
||||||
|
if len(args) == 0:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["NotEnoughParamError"])
|
||||||
|
return
|
||||||
|
if len(args) == 1:
|
||||||
|
args.append("1")
|
||||||
if args[0] not in self.optimizer.items.keys():
|
if args[0] not in self.optimizer.items.keys():
|
||||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
||||||
return
|
return
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"time": 5,
|
"time": 5,
|
||||||
"quantity": 1,
|
"quantity": 1,
|
||||||
"required": {
|
"required": {
|
||||||
"coal": 1
|
"coal": 5
|
||||||
},
|
},
|
||||||
"building": "crafting"
|
"building": "crafting"
|
||||||
},
|
},
|
||||||
@ -140,7 +140,7 @@
|
|||||||
"time": 1800,
|
"time": 1800,
|
||||||
"quantity": 2,
|
"quantity": 2,
|
||||||
"required": {
|
"required": {
|
||||||
"liana":1
|
"liana": 1
|
||||||
},
|
},
|
||||||
"building": "chemistery"
|
"building": "chemistery"
|
||||||
},
|
},
|
||||||
@ -156,11 +156,22 @@
|
|||||||
},
|
},
|
||||||
"water": {
|
"water": {
|
||||||
"value": 5,
|
"value": 5,
|
||||||
"time":120,
|
"time": 120,
|
||||||
"quantity":10,
|
"quantity": 10,
|
||||||
"required":{
|
"required": {
|
||||||
"amberCharger":20,
|
"amberCharger": 20,
|
||||||
"cosmicIce":10
|
"cosmicIce": 10
|
||||||
}
|
},
|
||||||
|
"building": "smelting"
|
||||||
|
},
|
||||||
|
"copperKnive": {
|
||||||
|
"value": 300,
|
||||||
|
"time": 120,
|
||||||
|
"quantity": 1,
|
||||||
|
"required": {
|
||||||
|
"copperBar": 1,
|
||||||
|
"pumpkin": 1
|
||||||
|
},
|
||||||
|
"building": "crafting"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ class Optimizer():
|
|||||||
already_crafted = [result[0] for result in results]
|
already_crafted = [result[0] for result in results]
|
||||||
index = 0
|
index = 0
|
||||||
for i, q, t in needed_result:
|
for i, q, t in needed_result:
|
||||||
print(i, q, t)
|
|
||||||
if i in already_crafted:
|
if i in already_crafted:
|
||||||
results[already_crafted.index(i)] = (
|
results[already_crafted.index(i)] = (
|
||||||
results[already_crafted.index(i)][0],
|
results[already_crafted.index(i)][0],
|
||||||
|
Loading…
Reference in New Issue
Block a user