• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Bot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Initialize

 public override void Initialize(Bot Bot)
 {
     mSelfBot = Bot;
     mCurrentAction = PetBotAction.Idle;
     mActionStartedTimestamp = UnixTimestamp.GetCurrent();
     mPossibleTricks = PetDataManager.GetTricksForType(Bot.PetData.Type);
 }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:7,代码来源:PetBot.cs


示例2: GroupRun

 public void GroupRun(SteamFriends.ChatMsgCallback callback, Bot bot, object[] args = null)
 {
     List<string> strings = new List<string>(callback.Message.Split(' '));
     strings.RemoveAt(0);
     string company = String.Join(" ", strings.ToArray());
     bot.ChatroomMessage(bot.chatRoomID, Util.GetYahooStocks(company));
 }
开发者ID:nukeop,项目名称:SteamRelayBot,代码行数:7,代码来源:Stock.cs


示例3: cmd_cycle

        public static void cmd_cycle(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            var chan = "";

            if (args.Length > 1 && args[1].StartsWith("#"))
            {
                chan = args[1];
            }
            else
            {
                chan = ns;
            }

            String cpns = Tools.FormatNamespace(chan, Types.NamespaceFormat.Packet).ToLower();

            if (!Core.ChannelData.ContainsKey(cpns))
            {
                bot.Say(ns, "<b>&raquo; It doesn't look like I'm in that channel.</b>");
                return;
            }

            lock (CommandChannels["part"])
            {
                CommandChannels["part"].Add(ns);
            }

            lock (CommandChannels["join"])
            {
                CommandChannels["join"].Add(ns);
            }

            bot.Part(cpns);
            bot.Join(cpns);
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:34,代码来源:Cycle.cs


示例4: TravelInfoPanelRouteConditional

		static public ITaskParam TravelInfoPanelRouteConditional(Bot Bot)
		{
			var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;

			var InfoPanelRoute = MemoryMeasurement.InfoPanelRoute();

			//	from the set of Waypoint markers in the Info Panel pick the one that represents the next Waypoint/System.
			//	We assume this is the one which is nearest to the topleft corner of the Screen which is at (0,0)
			var WaypointMarkerNext =
				InfoPanelRoute?.WaypointMarker
				?.OrderByCenterDistanceToPoint(new Vektor2DInt(0, 0))
				?.FirstOrDefault();

			if (null == WaypointMarkerNext)
			{
				return new ToClientStatusParam("no route in InfoPanel.", TaskStatusEnum.Idle);
			}

			if ((Bot?.LastOcurrenceAge(BotInstant =>
				(BotInstant.ShipState()?.ManeuverType?.Docked() ?? false)) ?? int.MaxValue) < TravelInfoPanelRouteParam.ShipTransitionSettlingTime)
			{
				return new ToClientStatusParam("char is docked, no action required.", TaskStatusEnum.Idle);
			}

			return
				new SequentialParam(
					new ITaskParam[]
					{
						new WaitUntilShipManeuverPossible(),
						new MenuPathParam(WaypointMarkerNext, new[] { TravelInfoPanelRouteParam.MenuEntryRegexPattern }).ContainerRateLimitEqualByTime(TravelInfoPanelRouteParam.InputNextManeuverDistanceMin),
					});
		}
开发者ID:trainingday01,项目名称:Optimat.EveOnline,代码行数:32,代码来源:TravelInfoPanelRoute.cs


示例5: UIChat

 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="chatroomName">Chatroom name.</param>
 /// <param name="bot">Bot reference.</param>
 /// <param name="uiThread">The thread for the currently running UI.</param>
 public UIChat(string chatroomName, Bot bot, dAmnNET dAmn, Thread uiThread)
     : base(chatroomName, bot)
 {
     this.dAmn = dAmn;
     this.UIThread = uiThread;
     Messages = new ObservableCollection<string>();
 }
开发者ID:gbrusella,项目名称:oberon-bot,代码行数:13,代码来源:UIChat.cs


示例6: cmd_act

        public static void cmd_act(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            if (args.Length < 2)
            {
                bot.Say(ns, String.Format("<b>&raquo; Usage:</b> {0}act <i>[#channel]</i> msg", bot.Config.Trigger));
            }
            else
            {
                String chan, mesg;

                if (!args[1].StartsWith("#"))
                {
                    chan = ns;
                    mesg = msg.Substring(4);
                }
                else
                {
                    chan = args[1];
                    mesg = msg.Substring(5 + args[1].Length);
                }

                lock (CommandChannels["send"])
                {
                    CommandChannels["send"].Add(ns);
                }

                bot.Act(chan, mesg);
            }
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:29,代码来源:Act.cs


示例7: UpdateBot

 public void UpdateBot(Bot bot)
 {
     var healthSlider = gameObject.GetComponentInChildren<Slider>();
     healthSlider.minValue = 0;
     healthSlider.maxValue = bot.PhysicalHealth.Maximum;
     healthSlider.value = bot.PhysicalHealth.Current;
 }
开发者ID:FVANtom,项目名称:BotRetreatArena,代码行数:7,代码来源:HealthTagController.cs


示例8: Resolve

		static public ITaskParam Resolve(
			this ShipUndockParam Param,
			Bot Bot)
		{
			var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;

			if (false == MemoryMeasurement.ShipState()?.Docked())
			{
				return null;
			}

			var WindowStationLobby = MemoryMeasurement.WindowStationLobby?.FirstOrDefault();

			var ButtonUndock = WindowStationLobby?.ButtonUndock;

			if (WindowStationLobby?.UnDocking() ?? false)
			{
				return new ToClientStatusParam("waiting for undock to complete", TaskStatusEnum.WaitingForTransition);
			}

            if (null == ButtonUndock)
			{
				return new ToClientStatusParam("button to undock not available", TaskStatusEnum.Failed);
			}

			return new MouseClickUIElementParam(ButtonUndock, MouseButtonIdEnum.Left);
		}
开发者ID:trainingday01,项目名称:Optimat.EveOnline,代码行数:27,代码来源:ShipUndock.cs


示例9: Run

        public override System.Collections.Generic.IEnumerator<string> Run(Bot bot)
        {
            var r = new Random();
            var chosenCombo = (from combo in bot.getComboList()
                              where
                                  combo.Score > 0 && combo.Type.HasFlag(ComboType.GROUND)
                              orderby combo.Score descending
                              
                              select combo).Take(5);
            if (chosenCombo.Count() == 0)
			{
				_reason = "No combos?";
                yield break;
			}
            var c = chosenCombo.ElementAt(r.Next(chosenCombo.Count()));
            var timer = 0;
            while(Math.Abs(bot.myState.XDistance) > c.XMax || bot.enemyState.ActiveCancelLists.Contains("REVERSAL") || bot.enemyState.ScriptName.Contains("UPWARD"))
            {
                bot.pressButton("6");
                if (timer++ > 10)
				{
					_reason = "Rerolling";
                    yield break;
				}
                
                yield return "Getting in range"+timer;
            }

			var substate = new SequenceState(c.Input);
			while(!substate.isFinished())
				yield return substate.Process(bot);
        }
开发者ID:Hatnice,项目名称:UltraBotFramework,代码行数:32,代码来源:GiefBot.cs


示例10: cmd_part

        public static void cmd_part(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            var c = ns;

            if (args.Length != 2)
            {
                // Ignore this for now.
                //bot.Say(ns, String.Format("<b>&raquo; Usage:</b> {0}part #channel", bot.Config.Trigger));
            }
            else
            {
                if (!args[1].StartsWith("#"))
                {
                    bot.Say(ns, "<b>&raquo; Invalid channel!</b> Channels should start with a #");
                    return;
                }

                c = args[1];
            }

            lock (CommandChannels["part"])
            {
                CommandChannels["part"].Add(ns);
            }

            bot.Part(c);
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:27,代码来源:Part.cs


示例11: Main

 private static void Main(string[] args)
 {
     using (var bot = new Bot())
     {
         bot.Run();
     }
 }
开发者ID:kezlya,项目名称:opit1,代码行数:7,代码来源:rogram.cs


示例12: IsCommandExecutionAllowed

        public bool IsCommandExecutionAllowed(Command command, Bot bot, string hostMask)
        {
            var users = bot.GetAuthenticatedUsers();
            var user = users.GetUserByHostMask(hostMask);

            return user.SecurityLevel >= (int)command.GetRequiredSecurityLevel();
        }
开发者ID:mikoskinen,项目名称:ircbot-dotnet,代码行数:7,代码来源:CommandSecurityChecker.cs


示例13: cmd_disconnects

 public static void cmd_disconnects(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
 {
     if (Program.Disconnects == 0)
         bot.Say(ns, "<b>&raquo; I have not disconnected since startup.</b>");
     else
         bot.Say(ns, String.Format("<b>&raquo; I have disconnected {0} time{1} since startup.</b>", Program.Disconnects, Program.Disconnects == 1 ? "" : "s"));
 }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:7,代码来源:Disconnects.cs


示例14: HandleGameEntitiesDispositionMessage

 public static void HandleGameEntitiesDispositionMessage(Bot bot, GameEntitiesDispositionMessage message)
 {
     if (!bot.Character.IsFighting())
         logger.Error("Received GameEntitiesDispositionMessage but character is not in fight !");
     else
         bot.Character.Fight.Update(message);
 }
开发者ID:Splitx,项目名称:BehaviorIsManaged,代码行数:7,代码来源:FightHandler.cs


示例15: HandleGameFightHumanReadyStateMessage

 public static void HandleGameFightHumanReadyStateMessage(Bot bot, GameFightHumanReadyStateMessage message)
 {
     if (!bot.Character.IsFighting())
         logger.Error("Received GameFightHumanReadyStateMessage but character is not in fight !");
     else
         bot.Character.Fight.Update(message);
 }
开发者ID:Splitx,项目名称:BehaviorIsManaged,代码行数:7,代码来源:FightHandler.cs


示例16: Tell

 public Tell(Bot bot)
     : base(bot)
 {
     Bot.OnChannelMessage+=new IrcEventHandler(Bot_OnMessage);
     Bot.OnQueryMessage += new IrcEventHandler(Bot_OnMessage);
     Bot.OnJoin += new JoinEventHandler(Bot_OnJoin);
 }
开发者ID:BackupTheBerlios,项目名称:abbot-svn,代码行数:7,代码来源:Tell.cs


示例17: HandleGameMapMovementMessage

        public static void HandleGameMapMovementMessage(Bot bot, GameMapMovementMessage message)
        {
            if (bot.Character.Context == null)
            {
                logger.Error("Context is null as processing movement");
                return;
            }

            var actor = bot.Character.Context.GetContextActor(message.actorId);

            if (actor == null)
                logger.Error("Actor {0} not found", message.actorId); // only a log for the moment until context are fully handled
            else
            {
                var path = Path.BuildFromServerCompressedPath(bot.Character.Map, message.keyMovements);

                if (path.IsEmpty())
                {
                    logger.Warn("Try to start moving with an empty path");
                    return;
                }

                var movement = new MovementBehavior(path, actor.GetAdaptedVelocity(path));
                movement.Start(DateTime.Now + TimeSpan.FromMilliseconds(EstimatedMovementLag));

                actor.NotifyStartMoving(movement);
            }
        }
开发者ID:a3gis,项目名称:BehaviorIsManaged,代码行数:28,代码来源:MapMovementHandler.cs


示例18: Resolve

		static public IEnumerable<ITaskParam> Resolve(
			this ShipModuleActivateParam Param,
			Bot Bot)
		{
			var Module = Param?.Module;
			var Target = Param?.Target;

			if (null != Target)
			{
				var TargetMeasurementLast =
					Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert?.Target?.FirstOrDefault(Candidate => Candidate?.Id == Target?.Id);

				if (null == TargetMeasurementLast)
				{
					yield return new ToClientStatusParam("requested Target not present", TaskStatusEnum.Failed);
				}

				if (!(TargetMeasurementLast?.Active ?? false))
				{
					yield return new MouseClickUIElementParam(TargetMeasurementLast, BotEngine.Motor.MouseButtonIdEnum.Left);
				}
			}

			//	Sensor Data is noisy and will sometimes report an active module as inactive.
			//	Therefore activation is only attempted when multiple sensor measurements have shown inactivity.
			if (Bot?.SequenceInstantOfAccuEntityReversed(Module)
				?.Take(ShipModuleActivateParam.NoiseSupressionThresholdStepCount)
				?.Any(ModuleInstant => ModuleInstant?.LastInstant?.Wert?.Module?.RampActive ?? false) ?? false)
			{
				//	module was active in the last NoiseSupressionThresholdStepCount steps.
				yield break;
			}

			yield return new ShipModuleActivityToggleParam(Module);
		}
开发者ID:trainingday01,项目名称:Optimat.EveOnline,代码行数:35,代码来源:ShipModuleActivate.cs


示例19: Run

 public override System.Collections.Generic.IEnumerator<string> Run(Bot bot)
 {
     string danceButton = "";
     int danceDuration = 0;
     var rnd = random.NextDouble();
     if (rnd > .9)
     {
         danceButton = "2";
         danceDuration = 1 + random.Next(_maxCrouch);
     }
     else if (rnd > .65 && Math.Abs(bot.myState.XDistance) < _targetDistance)
     {
         danceButton = "4";
         danceDuration = 1 + random.Next(_maxBackward);
     }
     else
     {
         danceButton = "6";
         danceDuration = 1 + random.Next(_maxForward);
     }
     while (danceDuration-- > 0)
     {
         bot.pressButton(danceButton);
         yield return "Dancing";
     }
 }
开发者ID:Hatnice,项目名称:UltraBotFramework,代码行数:26,代码来源:StateLibrary.cs


示例20: FriendRun

 public void FriendRun(SteamFriends.FriendMsgCallback callback, Bot bot, object[] args = null)
 {
     List<string> strings = new List<string>(callback.Message.Split(' '));
     strings.RemoveAt(0);
     string company = String.Join(" ", strings.ToArray());
     bot.FriendMessage(callback.Sender, Util.GetYahooStocks(company));
 }
开发者ID:nukeop,项目名称:SteamRelayBot,代码行数:7,代码来源:Stock.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BotClient类代码示例发布时间:2022-05-24
下一篇:
C# Boss类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap