I use central chat IRC servers to bus data between instances of blockland
Here is a basic implementation that can login and stuff
function irc::onDNSFailed(%this)
{
echo("DNS Failed");
}
function irc::onConnected(%this)
{
echo("Connected");
%this.sendline("NICK Blockhead4833\r\n");
%this.sendline("USER Blockhead4833 0 * :Pete-4833\r\n");
}
function irc::onConnectFailed(%this)
{
echo("Connection Failed");
}
function irc::onDisconnect(%this)
{
echo("Disconnected");
}
function irc::onLine(%this, %line)
{
echo("TCP: " @ %line);
if(getword(%line, 0) $= "PING")
%this.sendline("PONG" SPC getword(%line, 1) @ "\r\n");
else if(strpos(%line, "End of \MOTD Command.") > -1)
%this.sendline("ISON Blockhead4833\r\n");
else if(strpos(%line, ":+iwx") > -1)
%this.sendline("NAMES\r\n");
else if(strpos(%line, "376") > -1)
{
%this.sendline("JOIN #NexusServer\r\n");
%this.sendline("PRIVMSG Nickserv Identify Nexus password \r\n\r\n");
}
}
function irc::sendline(%this, %line)
{
echo("OUT: "@ %line);
%this.send(%line);
}
function irc_Default()
{
irc.connect("irc.centralchat.net:6667");
}
if(isobject(irc))
return;
new tcpobject(irc);