public SendQueue(IRCBot launcher) { this.Users = new Dictionary<string, User>(); this.UserQueue = new ConcurrentQueue<User>(); this.tim = new Timer(WorkerTick, null, Timeout.Infinite, Timeout.Infinite); this.host = launcher; }
static void Main(string[] args) { bool saveall = false; bool verbose = true; IRCConfig conf = new IRCConfig(); conf.filepath = "imglist.txt"; conf.triggerpath = "triggers.txt"; conf.filterpath = "filters.txt"; string confpath = "config.ini"; conf.ReadConfig(confpath); for(int i=0; i<args.Length; i++) { switch (args[i]) { case "-all": saveall = true; break; case "-c": if (args.Length > i + 1 && File.Exists(args[i + 1])) { confpath = args[i + 1]; i++; } else Console.WriteLine("Unable to load provided config. Searching in default location."); break; case "-t": if (args.Length > i + 1 && File.Exists(args[i + 1])) { conf.triggerpath = args[i + 1]; i++; } else Console.WriteLine("Unable to load provided trigger list. Searching in default location."); break; case "-s": verbose = false; break; case "-f": if (args.Length > i + 1 && File.Exists(args[i + 1])) { conf.filterpath = args[i + 1]; i++; } else Console.WriteLine("Unable to load provided filter list. Searching in default location."); break; } } if (conf.server == null) { Console.WriteLine("Please provide the server URL:"); conf.server = Console.ReadLine(); using (StreamWriter sw = new StreamWriter(confpath, true)) sw.WriteLine("server=" + conf.server); } if (conf.chan == null) { Console.WriteLine("Please provide the channel:"); conf.chan = Console.ReadLine(); using (StreamWriter sw = new StreamWriter(confpath, true)) sw.WriteLine("chan=" + conf.chan); } if (conf.nick == null) { Console.WriteLine("Please provide the nickname:"); conf.nick = Console.ReadLine(); using (StreamWriter sw = new StreamWriter(confpath, true)) sw.WriteLine("nick=" + conf.nick); } if (conf.nspass == null) { Console.WriteLine("Please provide the NickServ password:"******"nspass="******"Please provide the master's nickname:"); conf.master = Console.ReadLine(); using (StreamWriter sw = new StreamWriter(confpath, true)) sw.WriteLine("master=" + conf.master); } conf.name = conf.nick; conf.port = 6667; IRCBot bot = new IRCBot(conf, saveall); if (verbose || !bot.uiRun) { Console.WriteLine("Bot quit/crashed"); Console.ReadKey(); } }
public HuxUI(IRCBot bot) { ircBot = bot; InitializeComponent(); }