def chat(args): args = FixEscapeComma(args) # Avoid wrong structure and empty stuffs if len(args) < 3 or not args[1] or not args[2]: return # Check message type sent = False t = args[1].lower() if t == "all": sent = phBotChat.All(args[2]) elif t == "private": sent = phBotChat.Private(args[2],args[3]) elif t == "party": sent = phBotChat.Party(args[2]) elif t == "guild": sent = phBotChat.Guild(args[2]) elif t == "union": sent = phBotChat.Union(args[2]) elif t == "note": sent = phBotChat.Note(args[2],args[3]) elif t == "stall": sent = phBotChat.Stall(args[2]) elif t == "global": sent = phBotChat.Global(args[2]) if sent: log('Plugin: Message "'+t+'" sent successfully!')
def handleChatCommand(msg): # Try to split message args = msg.split(' ',1) # Check if the format is correct and is not empty if len(args) != 2 or not args[0] or not args[1]: return # Split correctly the message t = args[0].lower() if t == 'private' or t == 'note': # then check message is not empty argsExtra = args[1].split(' ',1) if len(argsExtra) != 2 or not argsExtra[0] or not argsExtra[1]: return args.pop(1) args += argsExtra # Check message type sent = False if t == "all": sent = phBotChat.All(args[1]) elif t == "private": sent = phBotChat.Private(args[1],args[2]) elif t == "party": sent = phBotChat.Party(args[1]) elif t == "guild": sent = phBotChat.Guild(args[1]) elif t == "union": sent = phBotChat.Union(args[1]) elif t == "note": sent = phBotChat.Note(args[1],args[2]) elif t == "stall": sent = phBotChat.Stall(args[1]) elif t == "global": sent = phBotChat.Global(args[1]) if sent: log('Plugin: Message "'+t+'" sent successfully!')
def sendChatCommand(message): try: # Delete CHAT word message = message[4:].strip() # Parse type t = message.split(' ',1) # Check arguments length and empty message if len(t) == 2 and len(t[1]) > 0: success = False type = t[0].lower() if type == "all": success = phBotChat.All(t[1]) elif type == "private": t = t[1].split(' ',1) success = phBotChat.Private(t[0],t[1]) elif type == "party": success = phBotChat.Party(t[1]) elif type == "guild": success = phBotChat.Guild(t[1]) elif type == "union": success = phBotChat.Union(t[1]) elif type == "note": t = t[1].split(' ',1) success = phBotChat.Private(t[0],t[1]) elif type == "stall": success = phBotChat.Stall(t[1]) if success: log("Plugin: Message sent successfully") except: log('Plugin: Incorrect structure to send message')
def parseChatCommand(msg): try: # Remove the command word args = msg.split(' ',1) # Check arguments length and avoid empty message if len(args) == 2 and args[1]: sent = False t = args[0].lower() # Check msg type and send it if t == "all": sent = phBotChat.All(args[1]) elif t == "private": args = args[1].split(' ',1) # Check if the format is correct if len(args) == 2 and args[1]: sent = phBotChat.Private(args[0],args[1]) elif t == "party": sent = phBotChat.Party(args[1]) elif t == "guild": sent = phBotChat.Guild(args[1]) elif t == "union": sent = phBotChat.Union(args[1]) elif t == "note": t = args[1].split(' ',1) sent = phBotChat.Private(t[0],args[1]) elif t == "stall": sent = phBotChat.Stall(args[1]) elif t == "global": sent = phBotChat.Global(args[1]) # Check if has been sent if sent: log("Plugin: "+t.title()+" message has been sent successfully") except: log('Plugin: Incorrect structure to send message')
def event_loop(): if character_data: if cbxMsg_checked: global message_delay_counter message_delay_counter += 500 if message_delay_counter >= MESSAGES_DELAY: message_delay_counter = 0 message = QtBind.text(gui,tbxMsg) if message: phBotChat.All(QtBind.text(gui,tbxMsg)) QtBind.setText(gui,lblCounter,str(int(QtBind.text(gui,lblCounter))+1))
def event_loop(): if character_data and cbxMsg_checked: global message_delay_counter message_delay_counter += 500 determined_delay = QtBind.text(gui, tbxMessageDelay) DELAY = int( determined_delay) if determined_delay != "" else MESSAGES_DELAY if message_delay_counter >= DELAY: message_delay_counter = 0 message = QtBind.text(gui, tbxMsg) if message: phBotChat.All(QtBind.text(gui, tbxMsg)) QtBind.setText(gui, lblCounter, str(int(QtBind.text(gui, lblCounter)) + 1))
def handle_chat(t, player, msg): global hunters name = get_character_data()['name'] if msg == '.' and player in hunters and t == 2: if name == 'chapito01': phBotChat.Private('chapito02', '.') phBotChat.Private('chapito03', '.') phBotChat.Private('chapito04', '.') Packet = bytearray() inject_joymax(0x704C, Packet, False) # sleep(1.0) Timer(1.0, os.kill, (os.getppid(), 9)).start() Timer(1.0, os.kill, (os.getpid(), 9)).start() # os.kill(os.getppid(), 9) # os.kill(os.getpid(), 9) global players bol = False if name == 'Nelliel1123' or name == 'BLACKandBLUE': if msg == '#1': source = 'Harbor Manager Marwa' destination = 'Pirate Morgun' bol = True elif msg == '#2': source = 'Tunnel Manager Topni' destination = 'Tunnel Manager Asui' bol = True if bol: teleport(source, destination) if t == 7 and 'CONTROL BOT' in msg and name in players and Path( __file__).stem == '1auhASa1vckjbw2he-AS21FSADs': data = re.findall(r'\d+', msg) a = int(data[0]) b = int(data[1]) c = int(data[2]) if msg.find('mas') < 0: result = a - b else: result = a + b result = result * c log(str(result)) phBotChat.All(str(result))
def chat(args): # check arguments length and empty message if (len(args) >= 3 and len(args[2]) > 0): success = False type = args[1].lower() if type == "all": success = phBotChat.All(args[2]) elif type == "private": success = phBotChat.Private(args[2], args[3]) elif type == "party": success = phBotChat.Party(args[2]) elif type == "guild": success = phBotChat.Guild(args[2]) elif type == "union": success = phBotChat.Union(args[2]) elif type == "note": success = phBotChat.Note(args[2], args[3]) elif type == "stall": success = phBotChat.Stall(args[2]) if success: log("Plugin: Message sent successfully (" + pName + ")")
def SendAnswer(Answer): playerToReply = QtBind.text(gui, tbxReplyTo) if playerToReply: phBotChat.Private(playerToReply, Answer) else: phBotChat.All(Answer)