本文整理匯總了C#中Bot類的典型用法代碼示例。如果您正苦於以下問題:C# Bot類的具體用法?C# Bot怎麽用?C# Bot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Bot類屬於命名空間,在下文中一共展示了Bot類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
public override void Initialize(Bot Bot)
{
mSelfBot = Bot;
mCurrentAction = PetBotAction.Idle;
mActionStartedTimestamp = UnixTimestamp.GetCurrent();
mPossibleTricks = PetDataManager.GetTricksForType(Bot.PetData.Type);
}
示例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));
}
示例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>» 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);
}
示例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),
});
}
示例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>();
}
示例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>» 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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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>» Usage:</b> {0}part #channel", bot.Config.Trigger));
}
else
{
if (!args[1].StartsWith("#"))
{
bot.Say(ns, "<b>» Invalid channel!</b> Channels should start with a #");
return;
}
c = args[1];
}
lock (CommandChannels["part"])
{
CommandChannels["part"].Add(ns);
}
bot.Part(c);
}
示例11: Main
private static void Main(string[] args)
{
using (var bot = new Bot())
{
bot.Run();
}
}
示例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();
}
示例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>» I have not disconnected since startup.</b>");
else
bot.Say(ns, String.Format("<b>» I have disconnected {0} time{1} since startup.</b>", Program.Disconnects, Program.Disconnects == 1 ? "" : "s"));
}
示例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);
}
示例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);
}