private static int ScanConstellations() { double yReference = 720.0; int constellation; if (Navigation.GetAspectRatio() == new Size(8, 5)) { yReference = 800.0; } Rectangle constActivate = new RECT( Left: (int)(70 / 1280.0 * Navigation.GetWidth()), Top: (int)(665 / 720.0 * Navigation.GetHeight()), Right: (int)(100 / 1280.0 * Navigation.GetWidth()), Bottom: (int)(695 / 720.0 * Navigation.GetHeight())); for (constellation = 0; constellation < 6; constellation++) { // Select Constellation int yOffset = (int)((180 + (constellation * 75)) / yReference * Navigation.GetHeight()); if (Navigation.GetAspectRatio() == new Size(8, 5)) { yOffset = (int)((225 + (constellation * 75)) / yReference * Navigation.GetHeight()); } Navigation.SetCursorPos(Navigation.GetPosition().Left + (int)(1130 / 1280.0 * Navigation.GetWidth()), Navigation.GetPosition().Top + yOffset); Navigation.Click(); Navigation.Speed speed = constellation == 0 ? Navigation.Speed.Normal : Navigation.Speed.Fast; Navigation.SystemRandomWait(speed); // Grab Color using (Bitmap region = Navigation.CaptureRegion(constActivate)) { // Check a small region next to the text "Activate" // for a mostly white backround ImageStatistics statistics = new ImageStatistics(region); if (statistics.Red.Mean >= 190 && statistics.Green.Mean >= 190 && statistics.Blue.Mean >= 190) { break; } } } Navigation.sim.Keyboard.KeyPress(WindowsInput.Native.VirtualKeyCode.ESCAPE); UserInterface.SetCharacter_Constellation(constellation); return(constellation); }