Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AtlasChecker"/> class.
 /// </summary>
 /// <param name="fb">A reference to FurkieBot.</param>
 public AtlasChecker()
 {
     furkiebot = FurkieBot.Instance;
     checkerThread = null;
     uploadedCount = 0;
     MapMan = MapManager.Instance;
 }
Example #2
0
        public void CheckForNewPosts()
        {
            while (true) {
                if (furkiebot == null) {
                    furkiebot = FurkieBot.Instance;
                }
                bool postFound = false;
                var subreddit = reddit.GetSubreddit("/r/test");
                foreach (var post in subreddit.New.Take(5)) {
                    if (!postIds.Contains(post.Id)) {
                        furkiebot.Msg("#dustforcee", "New Reddit post: \"" + post.Title + "\" by " + post.Author + " - " + post.Shortlink);

                        postIds.Add(post.Id);
                        postFound = true;
                    }
                }
                if (!postFound) {
                    Console.WriteLine("No new Reddit posts found. Trying again in 30 seconds.");
                }
                Thread.Sleep(30000);
            }
        }
Example #3
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() */