This commit is contained in:
lickthecheese 2020-04-06 21:15:28 -04:00
parent cf236af621
commit 280bde6b3d
4 changed files with 41 additions and 0 deletions

Binary file not shown.

View file

@ -59,6 +59,15 @@ async def invsee(self, c, n, m):
else: 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)) 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): async def init(self):
self.db = dataset.connect('sqlite:///database.db') self.db = dataset.connect('sqlite:///database.db')
@ -68,6 +77,8 @@ async def init(self):
self.cmd['items'] = invsee self.cmd['items'] = invsee
self.cmd['goods'] = invsee self.cmd['goods'] = invsee
self.raw['genGoods'] = generate
self.bakedGoods = { self.bakedGoods = {
'cheese': 50, 'cheese': 50,
'wheat': 1, 'wheat': 1,

30
modules/help.py Normal file
View file

@ -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 <command> - show more info about a command (more)', 'there is even a more, for a even more in depth look!']
self.more={}