Leia este documento em portuguĂŞs.
Anya Shop Bot is a tool designed to automate the process of checking and purchasing specific items in Diablo 2 Resurrected, focusing on studying the game item randomization. This bot is intended for OFFLINE use only, serving purely educational and experimental purposes.
The goal of this project is to share the knowledge I gained during development. I hope to inspire others to embark on this journey and discover that programming is accessible to anyone who is willing to learn and seek information.
My motivation was to fulfill my dream of developing a bot, something I have desired since my first contact with bots and programming 22 years ago.
- What Does Anya Shop Bot Do?
- Installation and Prerequisites
- Downloading and Configuring the Bot
- Running the Bot
- Releases
The bot automates the process of checking and purchasing items using Optical Character Recognition (OCR). Interact with npc Anya, looking for specific items that match the attributes given.
It specifically searches for:
- Armors with the suffix "The Whale" that contain life and are socketed.
- Trap Claws with assassin or trap skills and lighting sentry skills.
You can define the exact parameters witch the bot will search for:
-
Minimum life percentage and minimum number of sockets for armors.
-
Minimum assassin or trap skills and minimum lighting sentry skills for claws.
If an item meets your criteria, the bot will automatically purchase it.
After interacting with Anya, the bot will leave and return to town through the red portal, refreshing her inventory. Then repeat the process until the bot is paused.
This tool can save you countless hours of manual checking. Additionally, analyzing the log of images for items that met at least one criterion can be fascinating, offering insights into the game item randomization.
Before using the bot, it is necessary to ensure that some tools are installed on your system.All links provided below will direct you to the official download pages for each tool:
Anya Shop Bot is developed in Python, which is necessary for running the program.
OCR (Optical Character Recognition) that allows the bot to convert images into text. It is essential installing for the program to function correctly.
Later in the setup, you will need to have the directory path where Tesseract was installed copied. Follow the instructions below:
Windows:
During Tesseract installation, you will need to choose the directory, as shown in the image:
By default, the directory will be C:\Program Files\Tesseract-OCR. If your installation directory is different, make sure to copy the path of your specific installation and keep it saved.
Linux or macOS:
After installing Tesseract, run the following command in your terminal:
which tesseract
This command will return the path to Tesseract executable. For example:
/usr/bin/tesseract
Next, copy the path that is returned, but make sure to remove /tesseract from the end. So, if the command returns /usr/bin/tesseract, you'll copy only /usr/bin as the path. The final result will be:
/usr/bin
To ensure the bot works correctly, please configure the game and screen according to the following specifications:
- Diablo 2 Resurrected must be in English.
- The resolution must be 1280x720.
- The game must be in Windowed Mode.
- The Graphic Preset must be set to "Medium".
- In accessibility Large Font Mode must be enabled.
Choose one of the files below to download Anya Shop Bot based on your operating system:
- anya-shop-bot-0.1.2.zip for systems that use ZIP files (Windows).
- anya-shop-bot-0.1.2.tar for systems that use TAR files (Linux or macOS).
After downloading and extracting the bot folder:
- Ensure that Python is installed on your system.
- Navigate to the folder where you extracted the bot folder and open it.
- Locate the file named
install_requirements.py
. - Double-click on
install_requirements.py
to run it. This will install all the necessary dependencies.
Locate and edit the Config File:
In the folder where you extracted the bot, find the file named
config.ini
, and open it using a text editor of your choice, ex: (Notepad on
Windows, TextEdit on macOS, etc.).
1- Tesseract Path Configuration
Inside [tesseract] section, you need to specify the path where Tesseract OCR is installed, which you copied earlier during the installation process.
If you are unsure of where Tesseract is installed, scroll to the installation steps at the beginning of the document to find instructions on how to locate the path.
-
Windows:
If Tesseract is installed in the default directory
C:\Program Files\Tesseract-OCR
, no changes are needed.If installed elsewhere, specify the full path to the Tesseract executable and format it correctly:
- add an extra backslash (
\
) in each path segment. For example:
[tesseract] pytesseract_path = C:\\Your\\Custom\\Path\\To\\Tesseract-OCR
- add an extra backslash (
-
Linux or macOS:
Paste the copied path earlier. For example:
[tesseract] pytesseract_path = /usr/local/bin
2- Configuring Items Parameters
Armor:
-
min_life: Defines the minimum life percentage an armor item must have to be considered by the bot. This value should be between 1 and 99
-
min_sockets: Specifies the minimum number of sockets that the armor must have to be considered. This value should be between 1 and 4.
Example:
[params] min_life = 90 min_sockets = 4
Armor purchased by the bot using these parameters:
Claw:
-
min_skill: Defines the minimum number of assassin or trap skills an item must have. This value should be between 1 and 3.
-
min_has_skill: Specifies the minimum number of lightning sentry skills an item must have. This value should also be between 1 and 3.
Example:
[params] min_skill = 2 min_has_skill = 2
Claw purchased by the bot using these parameters:
- Ensure that the game is open and is configured according to the instructions provided above, in this document.
- Your character is positioned near Ana and the portal, as shown in the image below
-
Navigate to the folder where you extracted the bot files.
-
Locate the run.py file inside this folder.
-
Double-click on the run.py file to open the bot.
-
A window like this will open:
-
After opening the Bot Runner, follow the instructions provided in the window to start the bot.
-
Before running the bot, ensure that the Bot Runner window is overlaid on top of the Diablo 2 Resurrected window, as shown in the image below:
Version 0.1.2 - Latest Release
This is the first version of the bot. It includes basic functionality, still has room for improvement. More features and enhancements will be added in future updates.
Download Links:
This is the first version of the bot. It includes basic functionality, still has room for improvement. More features and enhancements will be added in future updates.
Download Links: