Ejemplo n.º 1
0
 def join(self, ctx):
     """:If you are new, use this to start playing."""
     user = Player()
     user.name = str(ctx.message.author)
     author = str(ctx.message.author)
     if not path.isfile(str(ctx.message.author) + "player11" + ".txt"):
         userlist.append(user)
         usernamelist.append(user.name)
         userlist[findPlayer(author)].update()
         userlist[findPlayer(author)].update()
         userlist[findPlayer(author)].move(level.root.index)
         userlist[findPlayer(author)].update()
         yield from self.bot.send_message(ctx.message.author, "Welcome" + str(ctx.message.author) + ' ' + level.find(user.location).desc)
     else:
         yield from self.bot.send_message(ctx.message.author, "You are already a registered user.")
         del user
Ejemplo n.º 2
0
    return readlevel


level = Floor()
level.floorgen()
#level = readfloor("currentfloor.txt")
level.updateFloor()
level.printFloor()



for file in listdir('./'):
    print("in file loop")
    if file.find("player11") != -1:
        user = Player()
        user.name = file.strip("player11.txt")
        user.readplayer()
        userlist.append(user)
        usernamelist.append(user.name)



class commands():
    "game commands"

    def __init__(self, bot):
        self.bot = bot

    @commands.command(pass_context=True, no_pm=False)
    @asyncio.coroutine
    def join(self, ctx):