Esempio n. 1
0
        /**
         * Constructor for FurkieBot, I'm guessing.
         */
        public FurkieBot(IRCConfig config) {
            this.config = config;


            //DataTable of Racers for the current CMR
            racers = new DataTable();
            racers.Columns.Add("Name", typeof(string));
            racers.Columns.Add("Status", typeof(int)); //1 = done; 2 = racing; 3 = ready; 4 = forfeit; 5 = dq; 6 = standby
            racers.Columns.Add("Hour", typeof(int));
            racers.Columns.Add("Min", typeof(int));
            racers.Columns.Add("Sec", typeof(int));
            racers.Columns.Add("TSec", typeof(int));
            racers.Columns.Add("Comment", typeof(string));
            racers.Columns.Add("Rating", typeof(int)); //Currently not being used, may or may not be used in the future, bird knows what's up


            string filepath = @"..\..\..\Data\Userlist\userlist.json"; // !! FILEPATH !!
            string[] jsonarray = File.ReadAllLines(filepath);
            string json = string.Join("", jsonarray);

            userlist = JsonConvert.DeserializeObject<DataSet>(json).Tables["userlist"]; // initially loads the userlist from JSON

            dummyRacingChan = "#cmr-"; //first part of racingchannel string
            realRacingChan = ""; //real racing channel string
            mainchannel = "#dustforcee"; //also the channel that will be joined upon start, change to #dustforcee for testing purposes
            cmrId = GetCurrentCMRID();
            comNames = ""; // Used for NAMES commands


            cmrStatus = GetCurrentCMRStatus(); //CMR status can be closed, open, racing or finished


        } /* IRCBot */
Esempio n. 2
0
 private static void Main(string[] args) {
     IRCConfig conf = new IRCConfig();
     conf.name = "FurkieBot";
     conf.nick = "FurkieBot";
     conf.altNick = "FurkieBot_";
     conf.port = 6667;
     conf.server = "irc2.speedrunslive.com";
     conf.pass = "******";
     using (var bot = new FurkieBot(conf)) {
         bot.Connect();
         bot.IRCWork();
     }
     Console.WriteLine("Furkiebot quit/crashed");
     Console.ReadLine();
 } /* Main() */