当前位置: 首页>>代码示例>>C#>>正文


C# IBot类代码示例

本文整理汇总了C#中IBot的典型用法代码示例。如果您正苦于以下问题:C# IBot类的具体用法?C# IBot怎么用?C# IBot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IBot类属于命名空间,在下文中一共展示了IBot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Handle

 public bool Handle(ChatMessage message, IBot bot)
 {
     try
     {
         using (var _database = new TwitterNotifierSprocketRepository())
         {
             _database.RecordActivity(message.FromUser);
             InviteUserIfNeccessary(message.FromUser, bot, _database);
             var twitterUsers = GetUserNamesFromMessage(message.Content, _database);
             var user = _database.FetchOrCreateUser(message.FromUser);
             if (twitterUsers.Count() > 0)
             {
                 foreach (var u in twitterUsers)
                 {
                     if (ShouldNotifyUser(u.ScreenName, _database))
                     {
                         NotifyUserOnTwitter(message, user, u);
                         _database.MarkUserNotified(u.ScreenName);
                     }
                 }
                 return true;
             }
         }
     }
     catch (Exception e)
     {
         bot.PrivateReply(message.FromUser, e.GetBaseException().Message);
     }
     return false;
 }
开发者ID:sethwebster,项目名称:Jabbot.TwitterNotifierSprocket,代码行数:30,代码来源:TwitterNotifierSprocket.cs

示例2: CheckForkStatus

 private static void CheckForkStatus(KeyValuePair<dynamic, dynamic> fork, IDictionary<string, string> existingForkStatus, IBot bot)
 {
     string id = fork.Key.ToString();
     string url = fork.Value.ToString() + "/commits";
     var commits = url.GetResponse<IEnumerable<dynamic>>().ToList();
     bot.ProcessForkStatus(id, existingForkStatus, commits);
 }
开发者ID:NickJosevski,项目名称:jibbr,代码行数:7,代码来源:ForksTask.cs

示例3: Run

		/// <summary>Runs the bot.</summary>
		public static void Run(IBot bot)
		{
			using (var platform = new ConsolePlatform())
			{
				platform.DoRun(bot);
			}
		}
开发者ID:Corniel,项目名称:AIGames.UltimateTicTacToe.StarterBot,代码行数:8,代码来源:ConsolePlatform.cs

示例4: Decorator

        public Sequence this[IBot.IBot bot]
        {
            get
            {
                var seq = new Sequence(

                    new Decorator(ret => bot.isRunning, new TreeSharp.Action(ret => RunStatus.Success)),
                    
                    //first we must have a valid target
                    new Decorator(ret => Util.Targeting.HasValidTarget(bot.CurrentTarget), new TreeSharp.Action(ret => RunStatus.Success)),

                    //if we are already busy, don't continue.
                    new Decorator(ret => !bot.isInAction, new TreeSharp.Action(ret => RunStatus.Success)),


                    //send the attack action.
                    new TreeSharp.Action(ret =>
                    {
                        bot.Attack(bot.CurrentTarget);
                    }),

                    //wait for the action to complete (or we time out).
                    new Wait(1, ret => bot.isInAction, new TreeSharp.Action(ret => RunStatus.Success))
            );

                return seq;

            }

        }
开发者ID:InjectionDev,项目名称:Dev.D3,代码行数:30,代码来源:AttackTargetDecorator.cs

示例5: FunkyBotStop

        // When the bot stops, output a final item-stats report so it is as up-to-date as can be
        private void FunkyBotStop(IBot bot)
        {
            // Issue final reports
            OutputReport();

            PlayerMover.iTotalAntiStuckAttempts = 1;
            PlayerMover.vSafeMovementLocation = Vector3.Zero;
            PlayerMover.vOldPosition = Vector3.Zero;
            PlayerMover.iTimesReachedStuckPoint = 0;
            PlayerMover.timeLastRecordedPosition = DateTime.Today;
            PlayerMover.timeStartedUnstuckMeasure = DateTime.Today;
            hashUseOnceID = new HashSet<int>();
            dictUseOnceID = new Dictionary<int, int>();
            dictRandomID = new Dictionary<int, int>();
                Bot.Stats.iMaxDeathsAllowed=0;
                Bot.Stats.iDeathsThisRun=0;
                initTreeHooks=false;
            //Total Stats
                Bot.BotStatistics.ItemStats.Update();
                Bot.BotStatistics.GameStats.Update();
                Bot.BotStatistics.ProfileStats.OutputReport();

                RemoveHandlers();
                ResetTreehooks();
        }
开发者ID:NEVEROYATNII,项目名称:Funky,代码行数:26,代码来源:OnBotStop.cs

示例6: DoRun

		/// <summary>Runs it all.</summary>
		public void DoRun(IBot bot, IEnumerable<IInstruction> instructions)
		{
			if (bot == null) { throw new ArgumentNullException("bot"); }
			if (instructions == null) { throw new ArgumentNullException("instructions"); }

			var settings = new Settings();
			var state = new GameState();

			foreach (var instruction in instructions)
			{
				if (settings.Apply(instruction))
				{
					bot.ApplySettings(settings);
				}
				else if (state.Apply(instruction)) { }
				else if (instruction is RequestMoveInstruction)
				{
					bot.Update(state);
					try
					{
						var response = bot.GetResponse(((RequestMoveInstruction)instruction).Time);
						Writer.WriteLine(response.Move);
						if (!String.IsNullOrEmpty(response.Log))
						{
							Logger.WriteLine(response.Log);
						}
					}
					catch (Exception x)
					{
						Writer.WriteLine(new MoveInstruction(Move.Center));
						Logger.WriteLine(x);
					}
				}
			}
		}
开发者ID:Corniel,项目名称:AIGames.UltimateTicTacToe.StarterBot,代码行数:36,代码来源:ConsolePlatform.cs

示例7: Command

    public new IProcessingResult Command(IBot bot, IProcessingResult pr, IChatMessage msg, string cmd, string arg, string cmdOriginal, string argOriginal)
    {
        switch (cmd)
        {
            default: return pr;

            // core commands

            case "about": return About(bot, pr, arg);
            case "help": return Help(bot, pr, arg);
            case "commands": return GetCommandList(bot, pr, arg);
            case "uptime": return Uptime(bot, pr);
            case "modules": return Modules(bot, pr);

            case "edit": return Edit(pr, bot, msg, arg);
            case "unonebox":
            case "unbox": return Unonebox(pr, bot, msg, arg);
            case "undo": return Undo(bot, pr, arg);

            case "status": return Status(bot, pr);

            case "trust": return TrustedUsers(bot, pr, arg);
            case "ignore": return BannedUsers(bot, pr, arg);

            case "say": return Say(pr, arg);
            case "tell": return Tell(pr, arg);

            case "alias": return Alias(pr, bot, msg, arg);

            case "save": return Save(bot, pr, msg.UserID);
            case "shutdown": return Shutdown(bot, pr, arg, msg.UserID);


            // hoihoi-san borrowed

            case "google": return Google(pr, msg, arg);
            case "wiki": return Wiki(pr, msg, arg);
            case "urban": return Urban(pr, msg, arg);
            case "youtube": return Youtube(pr, msg, arg);
            case "weather": return Weather(pr, msg, arg);


            // advanfaged

            case "id": return ID(bot, pr, msg, arg);
            case "isch": return Isch(bot, pr, msg, arg);

            case "whois":
            case "what":
            case "last": return LastPostedImageID(bot, pr, msg, arg);


            // bonus

            case "hats": return Hats(pr);
            case "meme": return Meme(bot, pr, msg, arg);

        }
    }
开发者ID:iansaviour,项目名称:SE-chat-bot-app-3,代码行数:59,代码来源:CoreCommands.cs

示例8: ASubBot

 public ASubBot(IBot bot)
 {
     this.InitializeComponent();
     this.bot = bot;
     this.updateTimer = new System.Timers.Timer();
     updateTimer.Elapsed += delegate {
         onTick(); };
 }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:8,代码来源:ASubBot.cs

示例9: Loaded

 public void Loaded(IPlugin plugin, IBot bot)
 {
     foreach(AliasData alias in Aliases)
     {
         IExpression aliasExpression = Parse(bot.Command, alias.Expression);
         Add(bot.Command, plugin, alias, aliasExpression, false);
     }
 }
开发者ID:Gohla,项目名称:Veda-plugins,代码行数:8,代码来源:AliasPlugin.cs

示例10: GetAllUsersInSameRoomsAsJibber

 private static IEnumerable<string> GetAllUsersInSameRoomsAsJibber(IBot bot)
 {
     var rooms = GetRooms(bot);
     var users = rooms.SelectMany<dynamic, dynamic>(r => r.Users);
     var userNames = users.Select(u => u.Name);
     var distinctUserNames = userNames.Distinct().Cast<string>();
     return distinctUserNames;
 }
开发者ID:jimmyp,项目名称:jibbr,代码行数:8,代码来源:VoicemailRecorder.cs

示例11: Player

        //: base(bot, id, name, smiley, xPos, yPos, isGod, isMod, hasChat, coins, purple, isFriend, level)
        public Player(IBot bot, int id, string name, int smiley, double xPos, double yPos, bool isGod, bool isMod, bool hasChat, int coins, bool purple, bool isFriend, int level)
        {
            this.id = id;
            this.bot = bot;

            physicsPlayer = new PhysicsPlayer(bot, id, name, smiley, xPos, yPos, isGod, isMod, hasChat, coins, purple, isFriend, level);
            afkStopwatch.Start();
        }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:9,代码来源:Player.cs

示例12: FunkyBotStart

 private void FunkyBotStart(IBot bot)
 {
     if (!ErrorClickerThread.ThreadState.HasFlag(ThreadState.Running))
         {
              ErrorClickerThread.Start();
              DBLog.Info("[Funky] Error Clicking Thread Started.");
         }
 }
开发者ID:BUFORD,项目名称:Funky,代码行数:8,代码来源:Plugin.cs

示例13: BlockMap

 public BlockMap(IBot bot, int width = 0, int height = 0)
 {
     backgroundMap = new Stack<IBlock>[width + 1, height + 1];
     foregroundMap = new Stack<IBlock>[width + 1, height + 1];
     currentForegroundMap = new int[width + 1, height + 1];
     this.width = width;
     this.height = height;
     Reset();
 }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:9,代码来源:BlockMap.cs

示例14: FurnitureManager

        public FurnitureManager(IBot bot)
        {
            this.bot = bot;

            furnitureTypes.Add("door", new FurnitureDoor(0, 0));
            furnitureTypes.Add("switch", new FurnitureSwitch(0, 0));
            furnitureTypes.Add("switchdoor", new FurnitureSwitchDoor(0, 0));
            furnitureTypes.Add("empty", new FurnitureEmpty(0, 0));
            furnitureTypes.Add("spawn", new FurnitureSpawn(0, 0));
        }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:10,代码来源:FurnitureManager.cs

示例15: Minimap

 public Minimap(IBot bot, int width, int height)
     : base(bot)
 {
     this.bot = bot;
     this.width = width;
     this.height = height;
     this.bitmap = new Bitmap(width, height);
     updateThread = new SafeThread(UpdateMinimap);
     updateThread.Start();
 }
开发者ID:CheeseSoftware,项目名称:MasterBot,代码行数:10,代码来源:Minimap.cs


注:本文中的IBot类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。