little-fort / booster-bot

A bot that could HYPOTHETICALLY be used to farm boosters for any deck in Marvel Snap.
GNU General Public License v3.0
77 stars 5 forks source link

BoosterBot for Marvel Snap

A bot that could hypothetically be used to farm boosters for any deck in Marvel Snap. Strictly for educational purposes, of course. Can also be paired with an Agatha deck to more effectively farm missions and seasonal ranks. The bot uses various UI reference points to determine game state and then simulates user clicks to perform relevant actions.

NOTE: Because this is simulating user input, the bot will keep giving the Snap window focus and moving the mouse pointer to various locations of the game screen. It cannot run in the background and it will be difficult to do anything else on the PC while the bot is running. For best results, turn it on when you're going to be AFK for a while.

Features

Prerequisites

This is only intended for use with the Steam version of Marvel Snap on Windows 10/11. No additional third-party software is required.

Game should be run in fullscreen mode at 1080p for best results. Although the bot can function in windowed mode, performance becomes very inconsistent.

With the official launch of the PC client, the bot will be non-functional when the game is in "landscape mode". You can disable "Landscape" in the game settings to return to the old UI and the bot will function as intended.

Getting Started

Simple

  1. Download the latest .zip from the Releases page.
  2. Unpack the archive into directory of your choice.
  3. Start the game and wait until main menu is loaded.
  4. Disable 'Landscape' toggle in game settings
  5. Start BoosterBot.exe and select desired run options.
  6. Exit by closing the console window or pressing Ctrl+Alt+Q.

NOTE: Due to the bot's nature (taking over cursor control and processing screen content on an endless loop), it may be flagged and quarantined by certain third-party antivirus programs. If you find the bot being halted repeatedly, you may need to whitelist the application directory in your antivirus software.

Advanced

Source can be cloned directly. Project is built on .NET 8, so you will need Visual Studio 2022 or the .NET 8 SDK installed in order to run.

The .exe can also be run from the command line with the following options:

Downscaled mode

-d, --downscaled

Should be used only if you are running a display in a downscaled resolution (i.e. a native 2K display set to 1080p) and the bot is having trouble recognizing the game state. Will adjust thresholds slightly to account for less precision when detecting UI elements.

Usage: BoosterBot.exe -d

Scaling

-s, --scaling

Used to adjust display scale, if necessary. You can check your current display scale in the display properties under System > Display > Custom scaling. If the display where Marvel Snap will be running is currently set to 100% scale (Windows 10) or the custom scaling entry field is empty (Windows 11), this value does not need to be used. If you have a custom scale value set, divide it by 100 and then pass in the value as an argument. Can be used if you are running the game at a resolution other than 1080p and the bot is not working. However, effectiveness is still low and it would be preferable to set the display to 1080p.

Usage: BoosterBot.exe -s 2.75

Startup automation

You can pass in arguments to skip the initial startup menu and launch the bot with your preferred configuration. Useful if you want to automate the bot's schedule or bind it to a hotkey.

-m, --mode

Specifies the game mode that the bot should play. Valid arguments: c, conquest, l, ladder, r, ranked

-t, --turns

Configures the turn at which the bot should auto-retreat, if desired. Valid arguments: any integer. Value can be ignored or set to 0 if the bot should play matches to the end. Only applicable in ranked mode and will be ignored in Conquest.

-ct, --tier

Specifies the maximum tier that the bot should play if the bot was set to play Conquest. Valid arguments: pg (Proving Grounds), s (Silver), g (Gold), i (Infinite)

Usage:

Event UI

-e, --event

Can be used to adjust the default click point for the Conquest button in case there's an active event mode (e.g. Deadpool's Diner, High Voltage).

Usage: BoosterBot.exe -e

Notes