Monitor overview and warpout?

Let me introduce my solution: class BackgoundColors

class BackgroundColors
public static class BackgroundColors
	{
		#region Colors Names
		/// <summary>
		/// This color not used in default overview settings (#004F4C)
		/// </summary>
		public static readonly ColorORGB Mosque;       //004F4C

		/// <summary>
		/// Pilot is in your militia or allied to your militia (#4C007F)
		/// </summary>
		public static readonly ColorORGB Indigo;       //4C007F

		/// <summary>
		/// Pilot is in your alliance, Pilot has Excellent Standing.(#002699)
		/// </summary>
		public static readonly ColorORGB DarkBlue;     //002699

		/// <summary>
		/// Pilot has a limited engagement with you (#00A091)
		/// </summary>
		public static readonly ColorORGB PersianGreen; //00A091

		/// <summary>
		/// Pilot is a suspect (#FFB200)
		/// </summary>
		public static readonly ColorORGB Yellow;       //FFB200

		/// <summary>
		/// Pilot has Good Standing., Pilot (agent) is interactable (#337FFF)
		/// </summary>
		public static readonly ColorORGB Blue;         //337FFF

		/// <summary>
		/// Pilot is in your fleet (#9926E5)
		/// </summary>
		public static readonly ColorORGB Violet;       //9926E5

		/// <summary>
		/// Pilot is in your corporation (#199919)
		/// </summary>
		public static readonly ColorORGB Green;        //199919

		/// <summary>
		/// Pilot has Bad Standing., Pilot has a kill right on him that you can activate, Pilot is at war with your militia (blink) (#FF5900)
		/// </summary>
		public static readonly ColorORGB Orange;       //FF5900

		/// <summary>
		/// Pilot has bounty on him (#000000)
		/// </summary>
		public static readonly ColorORGB Black;        //000000

		/// <summary>
		/// Pilot has Neutral Standing. (#B2B2B2)
		/// </summary>
		public static readonly ColorORGB Grey;         //B2B2B2

		/// <summary>
		/// Pilot is a criminal, Pilot has Terrible Standing., Pilot has a security status below -5, Pilot is at war with your corporation/alliance (blink) (#BF0000)
		/// </summary>
		public static readonly ColorORGB Red;          //BF0000  

		#endregion

		static BackgroundColors()
		{
			Mosque = new ColorORGB { OMilli = 500, RMilli = 0, GMilli = 340, BMilli = 330 };
			Indigo = new ColorORGB { OMilli = 050, RMilli = 300, GMilli = 0, BMilli = 500 };
			DarkBlue = new ColorORGB { OMilli = 500, RMilli = 0, GMilli = 150, BMilli = 600 };
			PersianGreen = new ColorORGB { OMilli = 500, RMilli = 0, GMilli = 630, BMilli = 570 };
			Yellow = new ColorORGB { OMilli = 500, RMilli = 1000, GMilli = 700, BMilli = 0 };
			Blue = new ColorORGB { OMilli = 500, RMilli = 200, GMilli = 500, BMilli = 1000 };
			Violet = new ColorORGB { OMilli = 500, RMilli = 600, GMilli = 150, BMilli = 900 };
			Green = new ColorORGB { OMilli = 500, RMilli = 100, GMilli = 600, BMilli = 100 };
			Orange = new ColorORGB { OMilli = 500, RMilli = 1000, GMilli = 350, BMilli = 0 };
			Black = new ColorORGB { OMilli = 500, RMilli = 0, GMilli = 0, BMilli = 0 };
			Grey = new ColorORGB { OMilli = 500, RMilli = 700, GMilli = 700, BMilli = 700 };
			Red = new ColorORGB { OMilli = 500, RMilli = 750, GMilli = 0, BMilli = 0 };
		}

		public static bool IsFriend(ColorORGB color)
		{
			return new[] { DarkBlue, Indigo, Blue, Green, Violet }.Contains(color, new ORGBColorComparar());
		}

		public static bool IsNeutral(ColorORGB color) => IsSameColor(color, Grey);

		public static bool IsEnemy(ColorORGB color)
		{
			return new[] {PersianGreen, Yellow, Orange, Grey, Red }.Contains(color, new ORGBColorComparar());
		}

		public static bool IsSameColor(ColorORGB c1, ColorORGB c2)
		{
			if (c1 == null && c2 == null)
			{
				return true;
			}
			else
				if (c1 == null || c2 == null) return false;

			return c1.OMilli == c2.OMilli && c1.RMilli == c2.RMilli && c1.GMilli == c2.GMilli && c1.BMilli == c2.BMilli;
		}

public class ORGBColorComparar : IEqualityComparer<ColorORGB>
	{
		bool IEqualityComparer<ColorORGB>.Equals(ColorORGB x, ColorORGB y)
		{
			if (x == null && y == null)
			{
				return true;
			}
			else
				  if (x == null || y == null) return false;

			return x.OMilli == y.OMilli && x.RMilli == y.RMilli && x.GMilli == y.GMilli && x.BMilli == y.BMilli;
		}

		int IEqualityComparer<ColorORGB>.GetHashCode(ColorORGB obj)
		{
			ColorORGB x = obj as ColorORGB;
			return (x.BMilli ?? 0)^(x.GMilli ?? 0) + (x.RMilli ?? 0) *1000 + (x.OMilli ?? 0)*1000000;
		}
	}

I added this code in the BotExtension.cs

To work with this class, you must first configure the overview: check the checkboxes and the bot will be able to recognize the pilots with the corresponding status.

1 Like