Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import threading
- #Maed by megaloler
- cons = []
- HOST = '72.172.232.90'
- PORT = 443
- USER = raw_input("Username: ")
- PASS = raw_input("Password: ")
- ROOM = raw_input("Room: ")
- COLOR = '6A0'
- SIZE = '13'
- NAMECOLOR = '8F0'
- FONT = "0"
- curroom = 0
- class RecvThread (threading.Thread):
- def run(self):
- ss = self.ss
- while 1:
- data = ss[0].recv(1024)
- if data == "": break
- datas = data.split(":")
- if datas[0] == "b":
- name = datas[2]
- mes = ":".join(datas[9:])
- if mes[0:2] == "<n":
- name = mes[0:7] + name
- mes = mes [7:]
- print ss[1] + ": " + name + ": " + mes
- def con(room):
- print "Connecting..."
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect((HOST, PORT))
- s.send("v" + chr(0))
- data = s.recv(1024)
- print "Connected!"
- print "Logging in..."
- s.send("bauth:"+room+":7202053138505182:"+USER+":"+PASS + chr(0))
- t = RecvThread()
- t.ss = (s,room)
- t.start()
- cons.append((s,room))
- print "Welcome to " + ROOM + "!"
- con(ROOM)
- while 1:
- ddd = raw_input("")
- if ddd == "": break
- if ddd[0] == "/":
- ddd = ddd[1:]
- ddds = ddd.split(" ")
- if len(ddds) == 1:
- print "Set to what?"
- else:
- if ddds[0] == "name":
- NAMECOLOR = ddds[1]
- if len(NAMECOLOR) < 3:
- NAMECOLOR = "0" + NAMECOLOR
- if len(NAMECOLOR) < 3:
- NAMECOLOR = "0" + NAMECOLOR
- if len(NAMECOLOR) < 3:
- NAMECOLOR = "0" + NAMECOLOR
- print "Name color set to " + NAMECOLOR
- elif ddds[0] == "color":
- COLOR = ddds[1]
- if len(COLOR) < 3:
- COLOR = "0" + COLOR
- if len(COLOR) < 3:
- COLOR = "0" + COLOR
- if len(COLOR) < 3:
- COLOR = "0" + COLOR
- print "Color set to " + COLOR
- elif ddds[0] == "size":
- SIZE = ddds[1]
- if len(SIZE) == 1:
- SIZE = "0" + SIZE
- print "Size set to " + SIZE
- elif ddds[0] == "font":
- FONT = ddds[1]
- if FONT == "":
- FONT = "0"
- print "Font set to " + FONT
- else:
- ppp = "bmsg:<n"+NAMECOLOR+"/><f x"+SIZE+COLOR+"=\""+FONT+"\">" + ddd + chr(13) + chr(10) + chr(0)
- cons[curroom][0].send(ppp)
- print "Disconnecting..."
- for s in cons:
- s[0].close()
- print "Bye!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement