Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / SASL.java
Created December 21, 2012 21:39
SASL implementation for PircBotX. Requires the following patch to the bot library: http://code.google.com/p/pircbotx/issues/detail?id=97
public class SASL extends ListenerAdapter {
String user = "user"; // Change accordingly!
String password = "password"; // Change accordingly!
boolean connected = false;
@Override
public void onMotd(MotdEvent event) throws Exception {
connected = true;
}
s = __import__("socket").socket()
s.connect(("irc.freenode.net", 6667))
s.send("NICK __import__\r\n")
s.send("USER __import__ irc.freenode.net bla :__import__\r\n")
readbuffer = ""
while True:
readbuffer += s.recv(1024)
temp = readbuffer.split("\n")
readbuffer = temp.pop()
for line in temp: