diff --git a/modules/__pycache__/bake.cpython-36.pyc b/modules/__pycache__/bake.cpython-36.pyc index 40a79cc..35d1e64 100644 Binary files a/modules/__pycache__/bake.cpython-36.pyc and b/modules/__pycache__/bake.cpython-36.pyc differ diff --git a/modules/__pycache__/help.cpython-36.pyc b/modules/__pycache__/help.cpython-36.pyc new file mode 100644 index 0000000..a929689 Binary files /dev/null and b/modules/__pycache__/help.cpython-36.pyc differ diff --git a/modules/bake.py b/modules/bake.py index a399ba3..9526b70 100644 --- a/modules/bake.py +++ b/modules/bake.py @@ -59,6 +59,15 @@ async def invsee(self, c, n, m): else: await self.message(c, 'you look through your kitchen and see {}, with a combined value of ${}'.format(' '.join(it), sum([self.bakedGoods[i] for i in it])/10)) +async def generate(self, c, n, m): + if int(random.uniform(0,20)) == 1: + inv = self.db['inv'] + inv.insert(dict(name=n, item=random.choice(list(self.bakedGoods.keys())))) + qed = self.db['qed'] + if qed.find_one(name=n) == None: + qed.insert(dict(name=n)) + await self.message(n, 'Ding! you left some stuff in the oven! (you were lucky and found an item!!!) check out what you have with "ov items" and you can do cool stuff like bake them! (i will not query you again, so periodically check for new items!)') + async def init(self): self.db = dataset.connect('sqlite:///database.db') @@ -68,6 +77,8 @@ async def init(self): self.cmd['items'] = invsee self.cmd['goods'] = invsee + self.raw['genGoods'] = generate + self.bakedGoods = { 'cheese': 50, 'wheat': 1, diff --git a/modules/help.py b/modules/help.py new file mode 100644 index 0000000..d734955 --- /dev/null +++ b/modules/help.py @@ -0,0 +1,30 @@ + + + +async def helpParse(self, c, n, m): + if m in self.help: + self.more[c] = self.help[m][1] + await self.message(c, self.help[m][0]) + else: + await self.message(c, 'my main commands are: {}'.format(' '.join([i for i in self.help if not ' ' in i]))) + + +async def more(self, c, n, m): + if c in self.more: + await self.message(c, self.more.pop(c)) + return + else: + await self.message(c, 'what more could you want?') + + +async def init(self): + self.cmd['help'] = helpParse + self.cmd['more'] = more + + self.help['help'] = ['help command - list commands or show info about one', 'i hope this was helpful'] + self.help['help command'] = ['help - show more info about a command (more)', 'there is even a more, for a even more in depth look!'] + + + + self.more={} +