Help me understand where I am going wrong

Ok a little background I have created a few IBotTasks called
OverviewWindowTask which loads a Preset Tab (works)
CloseWindowTask which closes the dialog window which pops up on Rock Havens (works)
OrbitTask which orbits the pirate gate in Rock Havens works if the Overview has the pirate gate on screen.

Here is the code that I have a problem with in Combat.cs

if (!memoryMeasurement.ManeuverStartPossible())
					yield break;
				
				else
// My logic here is if we are slowing down from warp we need to do these things
				{
					                                                                                                               
					yield return new OverviewTabTask { bot = this.bot, OverviewEntry = @"# hostile: drones" };
					yield return new CloseWindowTask { bot = this.bot };
					yield return new OrbitTask { bot = this.bot };
					yield return new OverviewTabTask { bot = this.bot, OverviewEntry = @"#   --- normal pvp" };
				}

If I comment out the 2 OverviewTabTasks everything works fine the bot warps to anom, orbits because I set the right overview manually and runs the anom normally.
but If I leave the 2 OverviewTabTasks in the bot starts fine … checks tool tips starts the Afterburner and then gets into an infinite loop loading the 2 overviews This is the only place I call OverviewTabTask inside of the combat task.
Why is it executing when I haven’t even warped to the site?

If anyone can assist me and show me the error in my ways I will name my next born after them…

Lets look in

static public bool ManeuverStartPossible(this IMemoryMeasurement memoryMeasurement) =>
			!(memoryMeasurement?.IsDocked ?? false) &&
			!new[] { ShipManeuverTypeEnum.Warp, ShipManeuverTypeEnum.Jump, ShipManeuverTypeEnum.Docked }.Contains(
				memoryMeasurement?.ShipUi?.Indication?.ManeuverType ?? ShipManeuverTypeEnum.None);

It’s true if not IsDoked AND ManeuverType not Warp/Jump or Docked. So in this example there is no condition for switching to warp. Maybe you should check AnomalyEnter task?

PS: yield statement - provide the next element in an iterator - C# | Microsoft Learn

1 Like