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()
|
||||
|
||||
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():
|
||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["error"]["OreNotFoundError"].format(ore=args[0]))
|
||||
return
|
||||
@ -42,6 +45,9 @@ class MainClass:
|
||||
self.optimizer = optimizer.Optimizer()
|
||||
|
||||
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():
|
||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
||||
return
|
||||
@ -59,6 +65,11 @@ class MainClass:
|
||||
value=result["value"]))
|
||||
|
||||
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():
|
||||
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ItemNotFoundError"].format(item=args[0]))
|
||||
return
|
||||
|
@ -4,7 +4,7 @@
|
||||
"time": 5,
|
||||
"quantity": 1,
|
||||
"required": {
|
||||
"coal": 1
|
||||
"coal": 5
|
||||
},
|
||||
"building": "crafting"
|
||||
},
|
||||
@ -161,6 +161,17 @@
|
||||
"required": {
|
||||
"amberCharger": 20,
|
||||
"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]
|
||||
index = 0
|
||||
for i, q, t in needed_result:
|
||||
print(i, q, t)
|
||||
if i in already_crafted:
|
||||
results[already_crafted.index(i)] = (
|
||||
results[already_crafted.index(i)][0],
|
||||
|
Loading…
Reference in New Issue
Block a user