コード例 #1
0
 public SearchModule(VBot bot, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
 {
     loadPersistentData();
     foreach (SearchClassEntry Entry in Searches)
     {
         commands.Add(new Search(bot, Entry));
     }
 }
コード例 #2
0
        public RepliesModule(VBot bot, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
        {
            SaveDataFile = ModuleSavedDataFilePath();

            Responses = GetDataDictionary();

            commands.Add(new ReplyFunction(bot, this));
            adminCommands.Add(new ReplyAdd(bot, this));
            adminCommands.Add(new ReplyRemove(bot, this));
        }
コード例 #3
0
ファイル: MotdModule.cs プロジェクト: monster860/TF2MChatBots
        public MotdModule(VBot bot, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
        {
            // loading config
            int updateInterval = int.Parse(config["updateInterval"].ToString());

            // loading saved data
            loadPersistentData();

            // loading commands
            commands.Add(new GetMOTD(bot, this));
            commands.Add(new CurrentMotdTick(bot, this));
            commands.Add(new GetMotdSetter(bot, this));
            adminCommands.Add(new SetMotd(bot, this));
            adminCommands.Add(new RemoveMotd(bot, this));
            adminCommands.Add(new SetExtendedMotd(bot, this));
            adminCommands.Add(new EmulateMotd(bot, this));

            motdPost = new BaseTask(updateInterval, new System.Timers.ElapsedEventHandler(MotdPost));
        }
コード例 #4
0
        //string prefix, ObservableCollection<MapModule.Map> Maplist)

        public WebServerHostingModule(VBot bot, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
        {
            loadPersistentData();

            try
            {
                WebsiteFilesDirectory = config["FilesDirectory"].ToString();
                header  = System.IO.File.ReadAllText(Path.Combine(WebsiteFilesDirectory, config["HeaderFileName"].ToString()));
                trailer = System.IO.File.ReadAllText(Path.Combine(WebsiteFilesDirectory, config["TrailerFileName"].ToString()));

                StartWebServer(config["Address"].ToString());

                bot.HTMLParsers.Add(this);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                Console.WriteLine("Files not found, webserver load failed");
            }

            adminCommands.Add(new RebootWebModule(bot, this));
            adminCommands.Add(new RemoveTable(bot, this));
        }
コード例 #5
0
 public CountDownModule(VBot bot, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
 {
 }
コード例 #6
0
 public MapModule(VBot bot, IHTMLFileFromArrayPasser HtmlListiner, Dictionary <string, Dictionary <string, object> > Jsconfig) : base(bot, Jsconfig)
 {
     this.HTMLlistiner = HtmlListiner;
     LoadModule(bot);
 }
コード例 #7
0
ファイル: SetMotd.cs プロジェクト: monster860/TF2MChatBots
 public SetMotd(VBot bot, MotdModule motd) : base(bot, "Set", motd)
 {
 }
コード例 #8
0
ファイル: ReplyAdd.cs プロジェクト: monster860/TF2MChatBots
 public ReplyAdd(VBot bot, RepliesModule repliesModule) : base(bot, "!replyadd")
 {
     replymodule = repliesModule;
 }
コード例 #9
0
ファイル: Program.cs プロジェクト: monster860/TF2MChatBots
        private static void Main(string[] args)
        {
            Console.WriteLine("RUNNING");


            ConsoleUserHandler consolehandler = new ConsoleUserHandler();
            MediaBot           MediaHandler   = new MediaBot();
            VBot               vbot_instance  = new VBot();
            GhostChecker       ghostchecker   = new GhostChecker();
            List <UserHandler> user_handlers  = new List <UserHandler>()
            {
                consolehandler, MediaHandler, vbot_instance, ghostchecker
            };

            HttpInterface               Test_Bot = new HttpInterface();
            SteamAccountVBot            SteamPlatformInterface = new SteamAccountVBot();
            List <ApplicationInterface> services = new List <ApplicationInterface>()
            {
                SteamPlatformInterface, Test_Bot
            };

            foreach (UserHandler handler in user_handlers)
            {
                foreach (ApplicationInterface service_instance in services)
                {
                    AssignConnection(handler, service_instance);
                }
            }

            /*
             * ConsoleInterface DebugInterface = new ConsoleInterface();
             * if (Console.ReadLine().Equals("Y"))
             * {
             *  bool RunConsole = true;
             *
             *  while (RunConsole)
             *  {
             *      MessageEventArgs Msg = new MessageEventArgs(DebugInterface);
             *      Msg.Sender = new ChatroomEntity("Console", DebugInterface);
             *      Msg.ReceivedMessage = Console.ReadLine();
             *      Msg.Sender.Rank = ChatroomEntity.AdminStatus.True;
             *      VbotHandler.ProcessPrivateMessage(DebugInterface, Msg);
             *      Msg.InterfaceHandlerDestination = DebugInterface;
             *
             *      if (Msg.ReceivedMessage.Equals("Exit"))
             *      {
             *          RunConsole = false;
             *      }
             *  }
             * }
             */


            Thread[] BotThreads = new Thread[services.Count];

            //Start looping and iterating//
            for (int x = 0; x < services.Count; x++)
            {
                BotThreads[x]          = new Thread(new ThreadStart(services[x].StartTickThreadLoop));
                BotThreads[x].Priority = ThreadPriority.BelowNormal;
                BotThreads[x].Start();
            }

            bool Running = true;

            while (Running)
            {
                System.Threading.Thread.Sleep(30000);
            }
        }
コード例 #10
0
 public ReplyRemove(VBot bot, RepliesModule repliesModule) : base(bot, "!ReplyRemove")
 {
     replymodule = repliesModule;
 }
コード例 #11
0
 public ReplyFunction(VBot bot, RepliesModule module) : base(bot, null)
 {
     this.module = module;
 }