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
.envfile in the root directory and add your Discord bot token:DISCORD_BOT_TOKEN=your_discord_bot_token
-
Configure settings:
Update
config.yamlwith 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: trueWhen 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