Exemple #1
0
        private static void initBot()
        {
            irc.meebyIrc.OnError += MeebyIrc_OnError;
            irc.meebyIrc.OnErrorMessage += MeebyIrc_OnErrorMessage;
            irc.meebyIrc.OnConnecting += MeebyIrc_OnConnecting;
            irc.meebyIrc.OnConnected += MeebyIrc_OnConnected;
            irc.meebyIrc.OnAutoConnectError += MeebyIrc_OnAutoConnectError;
            irc.meebyIrc.OnDisconnecting += MeebyIrc_OnDisconnecting;
            irc.meebyIrc.OnDisconnected += MeebyIrc_OnDisconnected;
            irc.meebyIrc.OnRegistered += MeebyIrc_OnRegistered;
            irc.meebyIrc.OnPart += MeebyIrc_OnPart;
            irc.meebyIrc.OnJoin += MeebyIrc_OnJoin;
            irc.meebyIrc.OnChannelAction += MeebyIrc_OnChannelAction;
            irc.meebyIrc.OnReadLine += MeebyIrc_OnReadLine;
            irc.meebyIrc.OnChannelMessage += MeebyIrc_OnChannelMessage;
            irc.meebyIrc.OnOp += MeebyIrc_OnOp;
            irc.meebyIrc.OnDeop += MeebyIrc_OnDeop;
            if (irc.checkForUpdates)
                CheckForUpdate();

            irc.meebyIrc.WriteLine("CAP REQ :twitch.tv/membership");

            _ask = new Ask();
            _quotes = new Quotes();
            _blacklist = new Blacklist(irc);
            _coins = new Coins();
            _slots = new Slots(_coins);
            _bet = new Bet(_coins);
            _customCvars = new CustomCvars();
            _votes = new Votes();
            _intervals = new Intervals();
            _viewerPB = new ViewerPB(irc);
            _jsonStatus = new Json_status(irc, _viewerPB);
            _statusCheckTimer = new System.Timers.Timer();
            _timer = new System.Timers.Timer();
            _leaderboards = new Leaderboards();
            _fortuneTeller = new FortuneTeller();

            _quotes.loadQuotesFromFile();
            _jsonStatus.SendChannel(irc._config.channel);
            _statusCheckTimer.Interval = 5 * 60 * 1000; // 5 minutes
            _statusCheckTimer.Start();
            _statusCheckTimer.Elapsed += new ElapsedEventHandler(_jsonStatus.TimerTick);
            _timer.Interval = 60 * 1000;
            _leaderboards.SendJsonPointer(_jsonStatus);
        }
 internal void SendJsonPointer(Json_status _jsonStatus)
 {
     json = _jsonStatus;
 }
        public void createHighlight(ReadMessage msg, Json_status _jsonStatus)
        {
            string highlightFile = "highlights.txt";
            List<string> highlightList = new List<string>();
            string line = "";
            if (File.Exists(highlightFile))
            {
                StreamReader SR = new StreamReader(highlightFile);

                while ((line = SR.ReadLine()) != null)
                {
                    if (line != "")
                    {
                        highlightList.Add(line);
                    }
                }
                SR.Close();
                SR.Dispose();
            }

            line = _jsonStatus.getStreamTime();
            if(line != "")
            {
                highlightList.Add(line);
                sendChatMessage("Added highlight times to a file - \"" + line + "\"");
                File.WriteAllLines(highlightFile, highlightList);
            }
            else
            {
                sendChatMessage("Failed to add new highlight to a file " + line);
            }
        }
 public void sendIrc(oldIRCClient _irc, Json_status _json)
 {
     irc = _irc;
     json = _json;
 }