private void RelocateAddon() { Console.WriteLine("Relocating addon..."); AddonLocator.ReCalculateAddonPosition(); var addonLocation = AddonLocator.GetAddonLocation(); if (addonLocation.Width == 1 || addonLocation.Height == 1) { Logger.Log("Addon could not be located. Make sure it's loaded and visible.", ConsoleColor.Red); } else { Logger.Log($"Addon successfully located: {addonLocation.ToString()}", ConsoleColor.Green); } AddonFolderHandler.LocateAddonFolderPath(); var addonFolderPath = AddonFolderHandler.GetAddonFolderPath(); if (!string.IsNullOrEmpty(addonFolderPath)) { Logger.Log($"Successfully found Wow Addon folder at {addonFolderPath}", ConsoleColor.Green); } else { Logger.Log("Addon folder could not be found!", ConsoleColor.Red); Logger.Log("Make sure the game is running when the app tries to locate the Addon PATH. Run 'addon reload' when the game is running to retry.", ConsoleColor.Red); } }
public Dictionary <IntPtr, Bitmap> CaptureScreenShots() { var screenshots = new Dictionary <IntPtr, Bitmap>(); var addonLocations = AddonLocator.GetAddonLocations(); using (var bitmap = new Bitmap(_screenbounds.Width, _screenbounds.Height)) { using (var g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(Point.Empty, Point.Empty, _screenbounds.Size); } foreach (var hWnd in addonLocations.Keys) { Bitmap clone; if (addonLocations[hWnd] == Rectangle.Empty) { clone = bitmap.Clone(new Rectangle(1, 1, 1, 1), PixelFormat.Format24bppRgb); } else { clone = bitmap.Clone(addonLocations[hWnd], PixelFormat.Format24bppRgb); } screenshots.Add(hWnd, clone); } } return(screenshots); }
static void Main() { var gameHandle = AddonLocator.InitializeGameHandle(); var settings = SettingsLoader.LoadSettings <AppSettings>("settings.json"); InitializeBotRunner(gameHandle, settings); Plugins = PluginLoader.GetPlugins(GetApplicationSettings(settings)); RenderStartMessage(); HandleInput(); }
public Bitmap CaptureScreenShot() { Bitmap clone; var bounds = Screen.GetBounds(Point.Empty); using (var bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (var g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size); } var addonLocation = AddonLocator.GetAddonLocation(); if (addonLocation == Rectangle.Empty) { addonLocation = new Rectangle(1, 1, 1, 1); } clone = bitmap.Clone(addonLocation, PixelFormat.Format24bppRgb); } return(clone); }