Exemplo n.º 1
0
 def datapack(*args):
     try:
         with MCRcon(config['serverIP'], config['rconPASS']) as mcr:
             if len(args) == 1:
                 response = mcr.command("datapack " + args[0])
                 btext.debug(args)
                 btext.debug("1")
                 btext.info(response)
             elif len(args) == 2:
                 response = mcr.command("datapack " + args[0] + ' "' +
                                        args[1] + '"')
                 btext.debug(args)
                 btext.debug("2")
                 btext.info(response)
             elif len(args) == 3:
                 response = mcr.command("datapack " + args[0] + ' "' +
                                        args[1] + '" ' + args[2])
                 btext.debug(args)
                 btext.debug("3")
                 btext.info(response)
             elif len(args) == 4:
                 response = mcr.command("datapack " + args[0] + ' "' +
                                        args[1] + '" ' + args[2] + ' "' +
                                        args[3] + '"')
                 btext.debug(args)
                 btext.debug("4")
                 btext.info(response)
     except Exception as e:
         btext.debug(e)
         btext.error(
             "Something fucky happened while trying to use {}".format(
                 inspect.stack()[0][3]))
Exemplo n.º 2
0
 def pardonip(target):
     try:
         with MCRcon(config['serverIP'], config['rconPASS']) as mcr:
             response = mcr.command("pardon-ip " + target)
             btext.info(response)
     except:
         btext.error(
             "Something fucky happened while trying to use {}".format(
                 inspect.stack()[0][3]))
Exemplo n.º 3
0
 def ban(target, reason):
     try:
         with MCRcon(config['serverIP'], config['rconPASS']) as mcr:
             response = mcr.command("ban " + target + " " + reason)
             btext.info(response)
     except:
         btext.error(
             "Something fucky happened while trying to use {}".format(
                 inspect.stack()[0][3]))
Exemplo n.º 4
0
 def whitelist(operator, username):
     try:
         with MCRcon(config['serverIP'], config['rconPASS']) as mcr:
             response = mcr.command("whitelist " + operator + " " +
                                    username)
             btext.debug(response)
     except:
         btext.error(
             "Something fucky happened while trying to use {}".format(
                 inspect.stack()[0][3]))
Exemplo n.º 5
0
 def say(message):
     try:
         with MCRcon(config['serverIP'], config['rconPASS']) as mcr:
             response = mcr.command("say " + message)
             btext.success('Successfully sent "' + message +
                           '" to the Server!')
     except:
         btext.error(
             "Something fucky happened while trying to use {}".format(
                 inspect.stack()[0][3]))