def onExecute(nick, user, host, chan, matches): executed, errors = dcpu.execute(matches.group(1)) if executed: irc.privmsg(nick, chan, executed) if errors: irc.privmsg(nick, chan, errors)
def onDisassemble(nick, user, host, chan, matches): print "Disassembling" print matches.group() print matches.group(1) code = dcpu.disassemble(matches.group(1)) if code: irc.privmsg(nick, chan, code)
def onBin(nick, user, host, chan, matches): converted = 0 if matches.group(1) == "0x": converted = bin(int(matches.group(2), 16)) else: converted = bin(int(matches.group(2), 16)) irc.privmsg(nick, chan, converted)
def onHex(nick, user, host, chan, matches): converted = 0 if matches.group(1) == "0b": converted = hex(int(matches.group(2), 2)) else: converted = hex(int(matches.group(2))) irc.privmsg(nick, chan, converted)
def onAssemble(nick, user, host, chan, matches): print "Assembling" print matches.group() print matches.group(1) binary, errors = dcpu.assemble(matches.group(1)) if binary: irc.privmsg(nick, chan, ', '.join(binary)) if errors: irc.privmsg(nick, chan, errors)
def onDec(nick, user, host, chan, matches): converted = 0 if matches.group(1) == "0b": converted = str(int(matches.group(2), 2)) elif matches.group(1) == "0x": converted = str(int(matches.group(2), 16)) else: converted = str(int(matches.group(2))) irc.privmsg(nick, chan, converted)
def onReload(nick, user, host, chan, matches): if(host == "unaffiliated/thatotherpersony"): subprocess.call(["git", "pull", "origin", "master"]); irc.privmsg(nick, chan, "Pulled latest changes from GitHub. Restarting.") exit() elif(host == "unaffiliated/quu"): irc.privmsg(nick, chan, "wat. Quu. derp.\nReally?\nInitializing spambot mode. >:D") else: irc.privmsg(nick, chan, "No. I don't wanna!")
#--- #INSET BOT COMMANDS IN HERE #--- try: pass except: pass if irc_type == 'privmsg' and ':.q ' in data[1][3][:4]: tmp = data[1][3].split(' ', 3) z = 0 for line in tmp: tmp[z] = tmp[z].lower() z += 1 print tmp if tmp[1] == 'add': if len(tmp) == 4: network.send( irc.privmsg(data[1][2], database.add_quote(tmp[2], tmp[3]))) elif tmp[1] != 'add' or tmp[1] != '': if len(tmp) == 2: tmp.append('') if len(tmp) == 3: network.send( irc.privmsg(data[1][2], database.get_quote(tmp[1], tmp[2]))) #--- #END OF BOT COMMANDS #--- print data
def onStinks(nick, user, host, chan, matches): messages = ["So do you!!!", "Shut up.", "You smell even worse.", "You really shouldn't be talking."] irc.privmsg(nick, chan, choice(messages))
def onSup(nick, user, host, chan, matches): irc.privmsg(nick, chan, "I'm fine. How about you?")
def onHello(nick, user, host, chan, matches): irc.privmsg(nick, chan, "Howdy!")
def onRudeness(nick, user, host, chan, matches): irc.privmsg(nick, chan, "Why don't you?")
def onTest(nick, user, host, chan, matches): irc.privmsg(nick, chan, "lolololol wat derp. ping Quu! ping mrout! Why not!")