help
This commit is contained in:
parent
cf236af621
commit
280bde6b3d
4 changed files with 41 additions and 0 deletions
Binary file not shown.
BIN
modules/__pycache__/help.cpython-36.pyc
Normal file
BIN
modules/__pycache__/help.cpython-36.pyc
Normal file
Binary file not shown.
|
@ -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,
|
||||
|
|
30
modules/help.py
Normal file
30
modules/help.py
Normal 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={}
|
||||
|
Loading…
Reference in a new issue