This Discord bot fetches the latest prices from the Old School Runescape Grand Exchange and calculates potential profits from herb farming runs and cooking fish. Unlike the OSRS Wiki herb calculator, this bot uses a different method to fetch Grand Exchange prices for items, providing more accurate current prices.
The bot commands are configured in a way that the parameters for the command will be prompted and autofilled by the bot.
/herb_profit
/fish_profit
Feel free to submit ideas (as issues) or pull requests for requested or nice-to-have features. See the projects board for accurate feature/issue tracking.
- Allow users to set if they want the latest price or 1h average
-
Raw Fish vs. Cooked Fish Price Check:
- Fetch current Grand Exchange prices for raw fish 🐟.
- Fetch current Grand Exchange prices for cooked fish 🍣.
- Calculate the potential profit from cooking each type of fish 💰.
- Display the profit data in a nicely formatted table in Discord 📊.
-
Item Price Potential:
- Fetch Grand Exchange price for high volume + profit margin items 💎.
osrs_utilities/
├── assets/
│ ├── images/
├── bot/
│ ├── __init__.py
│ ├── bot.py
│ ├── commands/
│ │ ├── __init__.py
│ │ ├── herb_profit.py # Herb profit command logic
│ │ ├── fish_profit.py # Fish profit command logic (future)
│ │ └── # Other command modules
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── api.py # API fetching logic
│ │ ├── calculations.py # Calculation logic
│ │ └── helpers.py # Helper functions
├── config/
│ ├── __init__.py
│ ├── config.yaml #-contains the bot config values
│ ├── settings.py #-loads all settings from .env and config
├── data/
│ ├── __init__.py
│ ├── items.py #-sets all item IDs required
├── tests/ # Test cases for the bot
│ ├── __init__.py
│ ├── test_commands.py
│ ├── test_utils.py
│ └── # Other test modules
├── .env
├── .gitignore
├── docker-compose.yml
├── Dockerfile
├── LICENSE.txt
├── README.md
├── requirements.txt
└── run.py #-main logic to run/start the bot
- Python 3.7+
- Docker and Docker Compose
- A Discord account and a Discord server where you have permission to add bots.
-
Clone the repository:
git clone https://github.com/PrettyNeet/OSRS_Utilities cd osrs_utilities
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory and add your Discord bot token:DISCORD_BOT_TOKEN=your_discord_bot_token
-
Configure settings:
Update
config.yaml
with any additional settings you need.bot_prefix: intents: headers: debug:
-
Run the bot:
python .\run.py
-
Clone the repository:
git clone https://github.com/PrettyNeet/OSRS_Utilities cd osrs_utilities
-
Set up environment variables:
Create a .env file in the root directory and add your Discord bot token:
DISCORD_BOT_TOKEN=your_discord_bot_token
Build and run the Docker container:
docker-compose up --build
- Add your bot to your Discord server using the OAuth2 URL generated in the Discord Developer Portal.
- refer to the command section or bot.py for all commands
To enable or disable debugging, set the debug value in config/config.yaml:
debug: true
When debugging is enabled, additional information will be printed to the console to help diagnose issues.
To add new commands and features, follow these steps:
- Create a new command file:
- If you have multiple commands related to a feature, you might want to group them in a separate file.
- create the new command file in /commands/ folder
- Define the command in the command file:
- Implement the command as a class inheriting from commands.Cog.
- Register the command using the @commands.command() decorator.
- Add utility functions (if needed):
- re-use any of the helper utilities found in the /utils/ folder
- if a new utility is identified, create one here to be re-used later in new commands
- Load the new command in run.py and/or bot.py:
- Ensure the new command file is imported and the setup function is called.
Feel free to submit issues or pull requests if you have any improvements or features you would like to add.
This project was heavily inspired by the OSRS Wiki, which provides a wealth of information and tools for Old School RuneScape players. Special thanks to the contributors of the OSRS Wiki for their extensive work in maintaining and updating the resources that make projects like this possible.
The farming yield logic is heavy based on the herb farming calculator