本文整理汇总了C#中Bot.?.SequenceStepLastState方法的典型用法代码示例。如果您正苦于以下问题:C# Bot.?.SequenceStepLastState方法的具体用法?C# Bot.?.SequenceStepLastState怎么用?C# Bot.?.SequenceStepLastState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot.?.SequenceStepLastState方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Resolve
static public IEnumerable<ITaskParam> Resolve(
this InfoPanelExpandParam Param,
Bot Bot)
{
if (null == Param)
{
yield break;
}
yield return new InfoPanelEnableParam(Param.InfoPanelType);
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
if (null == MemoryMeasurement)
{
yield break;
}
var ButtonAndPanel = MemoryMeasurement.InfoPanelButtonAndInfoPanel(Param.InfoPanelType);
if (ButtonAndPanel.Value?.IsExpanded ?? false)
{
yield break;
}
var ButtonExpand = ButtonAndPanel.Value?.HeaderButtonExpand;
if (null == ButtonExpand)
{
yield return new ToClientStatusParam("Info Panel Button Expand not found", TaskStatusEnum.Failed);
yield break;
}
yield return new MouseClickUIElementParam(ButtonExpand, BotEngine.Motor.MouseButtonIdEnum.Left);
}
示例2: 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),
});
}
示例3: 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);
}
示例4: 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);
}
示例5: Resolve
static public IEnumerable<ITaskParam> Resolve(
this InfoPanelEnableParam Param,
Bot Bot)
{
if (null == Param)
{
yield break;
}
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
var ButtonAndPanel = MemoryMeasurement.InfoPanelButtonAndInfoPanel(Param.InfoPanelType);
if (null != ButtonAndPanel.Value)
{
yield break;
}
yield return new UIElementModalHideAllParam();
var ButtonEnable = ButtonAndPanel.Key;
if (null == ButtonEnable)
{
yield return new ToClientStatusParam("Info Panel Button Enable not found", TaskStatusEnum.Failed);
yield break;
}
yield return new MouseClickUIElementParam(ButtonEnable, BotEngine.Motor.MouseButtonIdEnum.Left);
}
示例6: Resolve
static public IEnumerable<ITaskParam> Resolve(
this ShipModuleHardenerActivateParam Param,
Bot Bot)
{
foreach (var ModuleToActivate in
Bot?.SequenceStepLastState()?.SensorDataAccumulator?.ShipUiModule
?.Where(Module => Module?.ModuleButtonTooltipLast?.Wert?.IsHardener() ?? false).EmptyIfNull())
{
yield return new ShipModuleActivateParam(ModuleToActivate);
}
foreach (var ModuleToMeasure in
Bot?.SequenceStepLastState()?.SensorDataAccumulator?.ShipUiModule.EmptyIfNull())
{
yield return new ShipUiModuleMeasureTooltipParam(ModuleToMeasure);
}
}
示例7: Resolve
static public IEnumerable<ITaskParam> Resolve(
this OverviewEntryLockTargetParam Param,
Bot Bot)
{
yield return new SpaceObjectDistanceEnsureMaxParam(Param?.OverviewEntry, Bot?.SequenceStepLastState()?.SensorDataAccumulator?.TargetingRangeMax);
yield return new MenuPathParam(Param?.OverviewEntry, Sensor.SpaceObject.SpaceObjectMenuEntryLockRegexPattern);
}
示例8: Resolve
static public IEnumerable<ITaskParam> Resolve(
this UIElementModalHideAllParam Param,
Bot Bot)
{
return
Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert?.GetUIElementChildTransitive()
?.Where(Sensor.Extension.IsOccludingModal)
?.Select(UIElementModal => new UIElementHideParam(UIElementModal));
}
示例9: Resolve
static public IEnumerable<ITaskParam> Resolve(
this ActiveShipOpenInventoryCargoSpaceParam Param,
Bot Bot)
{
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
var WindowInventoryDone =
MemoryMeasurement?.WindowInventory
?.FirstOrDefault(WindowInventory => WindowInventory.ActiveShipSelectedCargoSpaceType() == Param?.CargoSpaceType);
if (null != WindowInventoryDone)
{
yield return new UIElementBringIntoViewParam(WindowInventoryDone);
yield break;
}
foreach (var WindowInventory in MemoryMeasurement?.WindowInventory.EmptyIfNull())
{
// just in case the Viewport is not large enough to show all entries at the same time.
yield return new InventoryCollapseTreeExceptActiveShipParam(WindowInventory);
var ActiveShipEntry = WindowInventory.TreeEntryActiveShip();
if (null == ActiveShipEntry)
{
continue;
}
var ActiveShipEntryCargoType = ActiveShipEntry?.TreeEntryForCargoSpaceType(Param.CargoSpaceType);
if (null != ActiveShipEntryCargoType)
{
yield return new MouseClickUIElementParam(ActiveShipEntryCargoType, BotEngine.Motor.MouseButtonIdEnum.Left);
yield break;
}
var ExpandCollapseToggleRegion = ActiveShipEntry?.ExpandCollapseToggleRegion;
if (ActiveShipEntry.IsExpanded() || null == ExpandCollapseToggleRegion)
{
yield return new ToClientStatusParam("requested cargo space type not available", TaskStatusEnum.Failed);
yield break;
}
yield return new MouseClickUIElementParam(ExpandCollapseToggleRegion, BotEngine.Motor.MouseButtonIdEnum.Left);
yield break;
}
yield return new WindowInventoryOpenParam();
}
示例10: Resolve
static public ITaskParam Resolve(
this ShipStop Param,
Bot Bot)
{
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
var ButtonStop = MemoryMeasurement?.ShipUi?.ButtonStop;
if (null == ButtonStop)
{
return new ToClientStatusParam("ButtonStop not available", TaskStatusEnum.Failed);
}
return new MouseClickUIElementParam(ButtonStop, BotEngine.Motor.MouseButtonIdEnum.Left);
}
示例11: Resolve
static public IEnumerable<ITaskParam> Resolve(
this UIElementHideParam Param,
Bot Bot)
{
var UIElementToHide = Param?.UIElement;
if (null == UIElementToHide)
{
yield break;
}
if (UIElementToHide.IsMessageConnectionLost())
{
// in this case, closing the MessageBox would result in the eve process exiting.
// since relogin is not implemented yet, leave the message on screen so the user can tell what happened only by looking at eve client.
yield return new ToClientStatusParam("connection lost", TaskStatusEnum.Failed);
}
if (UIElementToHide.IsOccludingModal() ||
UIElementToHide is Menu)
{
yield return WindowsInput.Native.VirtualKeyCode.ESCAPE.AsMotionParam();
yield break;
}
if (UIElementToHide is PanelGroup)
{
// to close a PanelGroup, click somewhere. Try to choose a region where clicking will not trigger any other actions.
// the region beside the top of the neocom should be good for that.
var Neocom = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert?.Neocom;
var RegionToClickCenter = new Vektor2DInt(Neocom.Region.Max0 + 30, 10);
yield return new MotionParam(
new[] {
new MotionParamMouseRegion(UIElementToHide,
(RegionToClickCenter - UIElementToHide.RegionCenter() ?? new Vektor2DInt()).OrtogonFromCenterAndSize(new Vektor2DInt(60, 16)))
}, MouseButtonIdEnum.Right);
yield break;
}
// other methods not implemented yet (e.g. minimize button on Window)
yield return new ToClientStatusParam(TaskStatusEnum.Failed);
}
示例12: Resolve
static public ITaskParam Resolve(
this ShipUiModuleMeasureTooltipParam Param,
Bot Bot)
{
var Module = Param?.Module;
if (null == Module)
{
return null;
}
var BotInstant = Bot?.SequenceStepLastState();
if (null != Module?.ModuleButtonTooltipLast?.Wert)
{
// Tooltip was already measured.
return null;
}
// move mouse over Module to trigger tooltip.
return Module?.NotDefaultLastTime?.Wert?.Module?.InputParamMouseRegion()?.InputParamMouseMove();
}
示例13: Resolve
static public IEnumerable<ITaskParam> Resolve(
this MenuPathParam Param,
Bot Bot)
{
var RootUIElement = Param.RootUIElement;
var PathListSegmentRegexPattern = Param.PathSegmentRegexPattern;
if (null == RootUIElement)
{
yield break;
}
var RootUIElementAsOverviewEntry = RootUIElement as OverviewEntry;
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
var ListMenu = MemoryMeasurement?.Menu?.OrderBy(Menu => Menu?.InTreeIndex ?? int.MaxValue)?.ToArray();
var MenuRegionExpandedToIntersectionTolerance =
ListMenu?.ElementAtOrDefault(0)?.Region.Expanded(MenuPathParam.RootIntersectionTolerance);
var MenuRootNearMenu =
MenuRegionExpandedToIntersectionTolerance?.Intersect(RootUIElement.Region) ?? false;
var MenuRootComplete = MenuRootNearMenu;
if (null != RootUIElementAsOverviewEntry)
{
// Screen region of OverviewEntry change often compared to other UIElements which are used as menu roots.
// Therefore proximity of the OverviewEntry to the Menu is not a requirement.
var MenuNearWindowOverview =
MemoryMeasurement?.WindowOverview?.Any(WindowOverview =>
MenuRegionExpandedToIntersectionTolerance?.Intersect(WindowOverview?.ListViewport?.Region ?? OrtogoonInt.Leer) ?? false) ?? false;
var MenuContainsEntryIndicatingInSpaceObject =
null != ListMenu?.ElementAtOrDefault(0)?.EntryRemoveFromOverview();
MenuRootComplete =
(RootUIElementAsOverviewEntry.IsSelected ?? false) &&
MenuNearWindowOverview &&
MenuContainsEntryIndicatingInSpaceObject;
}
if (!MenuRootComplete)
{
yield return new MouseClickUIElementParam(RootUIElement, Param.RootMouseButton);
yield return new ResolutionIncompleteParam();
yield break;
}
for (int MenuIndex = 0; MenuIndex < (PathListSegmentRegexPattern?.Length ?? 0); MenuIndex++)
{
var PathSegmentRegexPattern = PathListSegmentRegexPattern[MenuIndex];
var MenuSetEntrySuitable =
ListMenu?.ElementAtOrDefault(MenuIndex)?.ListEntry
?.Where(Entry => Entry?.Label?.RegexMatchSuccessIgnoreCase(PathSegmentRegexPattern) ?? false)
?.ToArray();
if (!(0 < MenuSetEntrySuitable?.Count()))
{
yield return new ToClientStatusParam("Menu does not contain requested Entry", TaskStatusEnum.Failed);
}
var MenuComplete =
(MenuSetEntrySuitable?.Any(Entry => Entry?.HighlightVisible ?? false) ?? false) &&
MenuIndex <= ListMenu?.Length;
var EntryIsLastNot = MenuIndex < PathListSegmentRegexPattern.Length - 1;
if (!MenuComplete)
{
yield return new MouseClickUIElementParam(MenuSetEntrySuitable?.FirstOrDefault(), MouseButtonIdEnum.Left);
if (EntryIsLastNot)
{
yield return new ResolutionIncompleteParam();
}
}
}
}
示例14: Resolve
static public IEnumerable<ITaskParam> Resolve(
this MinePortionConditionalParam Param,
Bot Bot)
{
var MemoryMeasurement = Bot?.SequenceStepLastState()?.MemoryMeasurement?.Wert;
var ShipState = MemoryMeasurement.ShipState();
if (ShipState?.Docked() ?? false)
{
foreach (var WindowInventory in MemoryMeasurement?.WindowInventory.EmptyIfNull())
{
var ItemHangar = WindowInventory.EntryItemHangar();
if (!(ShipCargoSpaceTypeEnum.OreHold == WindowInventory.ActiveShipSelectedCargoSpaceType()))
{
continue;
}
if (null == ItemHangar)
{
continue;
}
foreach (var Item in WindowInventory.SelectedRightInventory?.List?.Entry.EmptyIfNull())
{
// deposit Item from Ship to Item Hangar.
yield return new MouseClickUIElementParam(Item, BotEngine.Motor.MouseButtonIdEnum.Left, ItemHangar);
}
}
yield return new ShipUndockParam();
}
var SensorDataAccumulator = Bot?.SequenceStepLastState()?.SensorDataAccumulator;
var SetModuleMiner =
SensorDataAccumulator?.ShipUiModule?.WhereTooltip(Sensor.Extension.IsMiner)
.EmptyIfNull().ToArray();
var ListOverviewEntry =
MemoryMeasurement?.WindowOverview?.Select(WindowOverview => WindowOverview?.ListViewport?.Entry)
?.ConcatNullable()?.OfType<OverviewEntry>()?.ToArray();
var ListOverviewEntryToMine =
ListOverviewEntry?.Where(Entry => Entry.OreTypeEnum().HasValue)?.ToArray();
var ListTarget =
MemoryMeasurement?.Target?.OrderByDescending(Target => Target?.Active ?? false)
.EmptyIfNull().ToArray();
foreach (var ModuleMiner in SetModuleMiner)
{
if (ModuleMiner.IsActive())
{
continue;
}
foreach (var Target in ListTarget)
{
if (!(ModuleMiner?.ModuleButtonTooltipLast?.Wert?.CanMineType(Target) ?? false))
{
continue;
}
var TargetDistanceMax = Target?.DistanceMax();
var OptimalRange = ModuleMiner?.ModuleButtonTooltipLast?.Wert?.OptimalRange();
if (!(Target?.DistanceMax() < ModuleMiner?.ModuleButtonTooltipLast?.Wert?.OptimalRange()))
{
continue;
}
yield return new ShipModuleActivateParam(ModuleMiner, Target);
}
}
var OverviewEntryToMine = ListOverviewEntryToMine?.FirstOrDefault();
if (null != OverviewEntryToMine)
{
yield return new OverviewEntryLockTargetParam(OverviewEntryToMine);
}
if (SetModuleMiner?.Any(Module => !Module.IsActive()) ?? false)
{
yield return new WaitUntilShipManeuverPossible();
yield return new MenuPathParam(MemoryMeasurement?.InfoPanelLocationInfo?.ButtonListSurroundings, new[] { "belt", ".", @"warp.*within\s*0" });
}
}