def cmdHelp(obj, t): #@CREDIT Neek #format should be !command : Info \n msg = obj.data["msg"].split(" ") sender = obj.data["sender"] # No argument, list all commands if len(msg) == 1: reply = '' cmds = A.getCommands() keys = cmds.keys() keys.sort() A.tell(sender, "==Commands==") for k in keys: if len(reply) + len(A.B.prefix) > 50: A.tell(sender, reply) reply = '' if cmds[k][2] <= A.getClient(sender).group: if len(reply) > 0: reply += ", " reply += k + "(%d)" % cmds[k][2] A.tell(sender, reply) # Argument, provide description of command elif len(msg) == 2: cmd = msg[1].rstrip().lstrip('!') cmdobj = A.getCmd('!' + cmd) if cmdobj == None: A.tell(sender, "Unknown command: %s" % cmd) else: A.tell(sender, "%s: %s" % (cmd, cmdobj[1]))
def cmdIDDQD(obj, t): sender = obj.data['sender'] client = A.getClient(sender) db = database.DB() db.tableSelect("clients") entry = db.rowFind(client.cl_guid, 'guid') entry["cgroup"] = 5 db.rowUpdate(entry) db.commit() db.disconnect() A.rcon('bigtext "Congratuations! You have exquisite taste.') A.delCmd("!iddqd")
def eveLock(obj, t): cobj = A.getClient(obj.client) if 'fairplay_locked' in cobj.__dict__.keys(): if cobj.fairplay_locked is True: A.rcon('forceteam %s %s' % (cobj.uid, cobj.fairplay_lockedteam))