Skip to content

Enhanced fork of rustplusplus with advanced crafting features and storage integration

License

Notifications You must be signed in to change notification settings

BigFatherJesus/rustplusplus-enhanced

Repository files navigation

discord reddit donate on ko-fi

donate on ko-fi

rustplusplus Enhanced ~ Advanced Rust+ Discord Bot

rustplusplus Enhanced is a comprehensive fork of the original rustplusplus by Alexemanuelol, enhanced by me with a little help from Claude, featuring advanced crafting features, storage integration, and optimization tools.

This NodeJS Discord Bot uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features and enhanced functionality.

Enhanced Features

Original Features

  • Receive notifications for In-Game Events (Patrol Helicopter, Cargo Ship, Chinook 47, Oil Rigs triggered)
  • Control Smart Switches or Groups of Smart Switches via Discord or In-Game Team Chat
  • Setup Smart Alarms to notify in Discord or In-Game Team Chat whenever they are triggered
  • Use Storage Monitors to keep track of Tool Cupboard Upkeep or Large Wooden Box/Vending Machine content
  • Head over to the Information Text Channel to see all sorts of information about the server, ongoing events and team member status
  • Communicate with teammates from Discord to In-Game and vice versa
  • Keep track of other teams on the server with the Battlemetrics Player Tracker
  • Extensive QoL Commands that can be used In-Game or from Discord

Enhanced Features

  • Advanced Crafting Analysis - Comprehensive crafting calculation system with optimization tools
  • Enhanced Storage Integration - Advanced storage monitoring and management capabilities
  • Automatic Reconnection System - Robust connection management with health monitoring
  • API Systems - Extended API integration for better server connectivity
  • Optimization Tools - Performance enhancements and resource optimization
  • TypeScript Support - Full TypeScript implementation for better code quality
  • Enhanced Error Handling - Improved error management and logging systems
  • πŸ†• Automated Item Database Updates - Weekly automated scraping of latest Rust item data with manual controls

Quick Start

Development Commands

Starting the Bot

npm start

Type Checking

npm test

This runs TypeScript compiler with --noEmit flag to check for type errors without generating output.

Installation

npm install

Note: Uses npm-force-resolutions for dependency resolution.

Updates

# Windows
update.bat

# Linux/Mac
./update.sh

Architecture Overview

Core Structure

  • Entry Point: index.ts - Initializes Discord bot and creates necessary directories
  • Main Bot Class: src/structures/DiscordBot.js - Extends Discord.Client with custom functionality
  • Event Handlers: src/discordEvents/ - Discord event handlers (ready, messageCreate, etc.)
  • Command System: src/commands/ - Slash commands for Discord interactions
  • Rust+ Integration: src/structures/RustPlus.js - Handles Rust+ API connections
  • Smart Device Management: src/handlers/ - Various handlers for smart devices and features

Key Components

Discord Integration

  • Uses Discord.js v14 with gateway intents for guilds, messages, and voice
  • Slash commands system with interaction handlers
  • Multi-language support via internationalization
  • Voice channel integration for TTS features

Rust+ API Integration

  • FCM (Firebase Cloud Messaging) listeners for push notifications
  • WebSocket connections to Rust+ servers
  • Smart device control (switches, alarms, storage monitors)
  • Real-time game event monitoring

Data Storage

  • Instance-based configuration system
  • JSON-based settings and templates
  • Logging system with Winston
  • Credential management for authentication

Key Technologies

  • Runtime: Node.js with TypeScript
  • Discord: Discord.js v14
  • Rust+ API: Custom rustplus.js library
  • Image Processing: Jimp and GraphicsMagick
  • Authentication: FCM push notifications
  • Voice: Discord voice integration with ffmpeg

Documentation

Documentation can be found here. The documentation explains the features as well as how to setup the bot, so make sure to take a look at it πŸ˜‰

Credentials

You can get your credentials by running the rustplusplus credential application. Download it here

Running via Docker

docker run --rm -it -v ${pwd}/credentials:/app/credentials -v ${pwd}/instances:/app/instances -v ${pwd}/logs:/app/logs -e RPP_DISCORD_CLIENT_ID=111....1111 -e RPP_DISCORD_TOKEN=token -e RPP_FIRECRAWL_API_KEY=your_api_key --name rpp nuallan/rustplusplus-forked

or

docker-compose up -d

Make sure you use the correct values for DISCORD_CLIENT_ID as well as DISCORD_TOKEN in the docker command/docker-compose.yml

Environment Variables

  • RPP_DISCORD_CLIENT_ID - Discord application client ID
  • RPP_DISCORD_TOKEN - Discord bot token
  • RPP_FIRECRAWL_API_KEY - (Optional) Firecrawl API key for automated item database updates

Project Structure

rustplusplus-enhanced/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/       # Discord slash commands
β”‚   β”œβ”€β”€ discordEvents/  # Discord event handlers
β”‚   β”œβ”€β”€ handlers/       # Feature-specific handlers
β”‚   β”œβ”€β”€ structures/     # Core classes (DiscordBot, RustPlus, etc.)
β”‚   β”œβ”€β”€ util/          # Utility functions and helpers
β”‚   β”œβ”€β”€ languages/     # Internationalization files
β”‚   β”œβ”€β”€ resources/     # Static assets (images, fonts)
β”‚   └── staticFiles/   # Game data files (items, recipes, etc.)
β”œβ”€β”€ docs/              # Documentation and setup guides
β”œβ”€β”€ config/            # Configuration files
β”œβ”€β”€ credentials/       # User authentication data (created at runtime)
β”œβ”€β”€ instances/         # Server-specific configurations (created at runtime)
β”œβ”€β”€ logs/             # Application logs (created at runtime)
β”œβ”€β”€ index.ts          # Main entry point
β”œβ”€β”€ package.json      # Dependencies and scripts
└── tsconfig.json     # TypeScript configuration

Configuration Notes

  • The bot requires Rust+ credentials obtained via the companion app
  • Each Discord server requires pairing with a Rust game server
  • Smart devices must be paired in-game before Discord control
  • The bot maintains persistent connections to monitor real-time events
  • Multi-language support requires proper locale configuration

New Features: Automated Item Database Updates

Firecrawl Integration

The bot now includes an automated system for keeping Rust item data up-to-date:

  • Weekly Automation: Every Thursday at 20:00 UTC, the bot automatically checks for new items
  • Manual Control: Use /update-database command for immediate updates
  • Rate Limiting: Built-in API rate limiting and credit management
  • Resume Capability: Automatically resumes after API credit restoration

Commands

  • /update-database ALL - Full database refresh (admin only)
  • /update-database NEW - Check for new items only
  • /update-database ITEM <name> - Update specific item

Setup

  1. Get a Firecrawl API key from firecrawl.dev
  2. Set RPP_FIRECRAWL_API_KEY environment variable
  3. The bot will automatically start weekly updates on restart

Data Output

  • Bot Format: Updates existing static files (items.json, rustlabsCraftData.json, etc.)
  • Human-Readable: Organized JSON files in src/humanReadableItems/ by category

Thanks to

liamcottle@GitHub - for the rustplus.js library.
.Vegas.#4844@Discord - for the awesome icons!
Alexemanuelol@GitHub - for the original rustplusplus project.

About

Enhanced fork of rustplusplus with advanced crafting features and storage integration

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 12

Languages