hrm... doesnt seem to do anything :S
is this correct?
[code:1]using System;
using System.Net;
using Server;
using Server.IRC;
namespace Server.IRC
{
public sealed class StatusBot : QuakeNetBot
{
private static StatusBot m_Bot;
private static string[] m_Servers = new string[]
{
"irc.quakenet.org",
"uk.quakenet.org"
};
public static void Initialize()
{
bool FoundServer = false;
int CurrentServer = 0;
while ( (FoundServer == false) && (CurrentServer < m_Servers.Length) ) {
try
{
Console.WriteLine("StatusBot: Trying to connect to: " + m_Servers[CurrentServer]);
m_Bot = new StatusBot ( m_Servers[CurrentServer], "^shadowlands^", "slbot", 6667, "#ShadowLands" );
FoundServer = true;
}
catch
{
Console.WriteLine("StatusBot: Failed to connect to: " + m_Servers[CurrentServer]);
CurrentServer += 1;
}
}
}
public StatusBot ( string pServer, string pNickname, string pAuthname, int Port, params string[] pChannels ) : base ( pServer, pNickname, pAuthname, Port, pChannels )
{
}
~StatusBot()
{
m_Bot.SetTopic ("#ShadowLands","4,1Welcome to ShadowLands UO Shard - Shard is DOWN - http://shadowlands.netgamers.co.uk" );
}
private void UpdateTopic()
{
SetTopic ("#ShadowLands","4,1Welcome to ShadowLands UO Shard - Shard is UP - http://shadowlands.netgamers.co.uk" );
}
public override void OnChannelMessage ( string Channel, string Nickname, string Message )
{
// base.OnChannelMessage( Channel, Nickname, Message);
if (String.Compare(Message,"!stats",true) == 0)
{
Say(Channel, "Open Connections: {0}", Network.NetState.Instances.Count.ToString() );
Say(Channel, "Mobiles: {0}", World.Mobiles.Count.ToString() );
Say(Channel, "Items: {0}", World.Items.Count.ToString() );
}
if (String.Compare(Message,"!updatetopic",true) == 0)
{
UpdateTopic();
}
}
public override void OnPrivateMessage ( string Nickname, string Message )
{
// base.OnPrivateMessage( Nickname, Message);
}
}
}[/code:1]