Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, threading, time, random
- def ping():
- while True:
- chsocket.send(bytes("\r\n\x00", "utf-8"))
- time.sleep(20)
- chsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- chsocket.setblocking(True)
- chsocket.connect(("sXX.chatango.com", 443)) # replace XX with chatango tagserver number
- chsocket.send(bytes("bauth:roomnamehere:"+str(int(random.randrange(10 ** 15, (10 ** 16) - 1)))+":user:password\x00", "utf-8"))
- t = threading.Thread(target=ping)
- t.daemon = True
- t.start()
- while True:
- rbuf = b""
- while not rbuf.endswith(b'\x00'):
- rbuf += chsocket.recv(1024)
- for raw in rbuf.split(b'\x00'):
- if raw.decode("latin-1").rstrip("\r\n").split(":")[0] == "b" and raw.decode("latin-1").rstrip("\r\n").split(":")[-1].split(">")[-1] == "metalbot":
- chsocket.send(bytes("bmsg:t12r:<n000/><f x11000=\"0\">"+random.choice(["Hello! I am Metalbot v 1.3", "Yes, Master?", "I don't actually do anything \o/", "How are you today?", "Wanna play?", "Bored?", "Lovely weather isn't it?"]), "utf-8"))
- time.sleep(0.01)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement