Overwatch Custom Game Automation
A library for automating Overwatch custom games. Click here for tutorial and documentation
- .Net Framework 4.7.1 or later.
Add a reference to Deltin.CustomGameAutomation.
Create a CustomGame object. By default, it uses the first Overwatch process it finds.
CustomGame cg = new CustomGame();
If you want it to use a specific Overwatch process, you can use the main window handle as an argument.
Process overwatchProcess = ... CustomGame cg = new CustomGame(overwatchProcess.MainWindowHandle);
By default the CustomGame class uses BitBlt to capture screenshots of the Overwatch process. Since this method doesn't work on some systems, you can choose the screenshot method to use.
CustomGame cg = new CustomGame(default(IntPtr), ScreenshotMethods.BitBlt); // or CustomGame cg = new CustomGame(default(IntPtr), ScreenshotMethods.ScreenCopy);
- BitBlt does not require to be on top. You can have other windows over the Overwatch window and it will still work.
- ScreenCopy needs to be on top and have no windows overlapping the Overwatch window. Does not work with all border styles right now.
The Overwatch window the CustomGame class is using must have default colorblind, brightness, and gamma settings with contrast at the minimum. Some methods may not work unless you are the moderator of the custom game and/or you are in spectator.
It is possible to run your application and play Overwatch at the same time by starting 2 Overwatch processes directly from the Overwatch.exe file, which is by default at C:/Program Files (x86)/Overwatch/Overwatch.exe. Create the CustomGame object with the main window handle of the Overwatch process you want the CustomGame class to use. If you are using ScreenCopy, which requires the Overwatch window the CustomGame class is using to be on top, I recommend using a virtual machine.
You can target a specific player on the server with their slot.
CustomGame.BlueSlots, for the example above, will return a List
CustomGame.CG_Interact.Move(0, 8) will move the player Deltin from slot 0 on the blue team to slot 8 on the red team.
CustomGame.CG_PlayerInfo.IsUltimateReady(5) will check if the player in slot 5's ultimate ability is ready.