GithubHelp home page GithubHelp logo

epic_rpg_converter's Introduction

Resource conversion bot for Epic RPG

Invite to server

This is a Discord bot which implements a simple shortest path graph-based conversion strategy between the many resources available in Epic RPG. It allows users to quickly switch areas as they progress through the game and intelligently alerts them to impossible trades (apples for logs in Area 1, for example). A user is automatically registered with the bot their first time using it, and information such as area preferences and usage statistics are persistently stored in a PostgreSQL database.

Note: I've retired this bot seeing as I do not have the computational resources to keep it online for the 100+ servers that it was active in. I also am unwilling to go through Discord's (draconian) verification process. The code here is fully functional, so if anyone is interested in picking it up and running with it, please go ahead and let me know if you need any help.


Usage

Developer

Usage

Converting Specific Items

To convert a specific number of resources to a different kind of item, tell the bot how many of the first that you have, and which item you want to convert them to:

!CONV n item1 item2

If this is not possible, or not possible in your current area (because, for example, you cannot trade apples to logs in area 1), the bot will tell you. Items which have two words must be seperated by a - and be all lower case.

Example:

!CONV 5 apple log
!CONV 5 hyper-log fish
!CONV 6 ruby epic-fish

Converting Your Entire Inventory

You can also see how many of a resource could be made from all of the resources in your inventory. This bot cannot interface directly with EPIC RPG because of how Discord allows bots to behave, so you must show your inventory to update it. That means running rpg inv or any other valid inventory command to update the values in your inventory for this bot. You must do this before trying to use any other inventory commands. To convert your entire inventory to a certain resource, tell the bot that you want to convert your inventory, and then the item that you want to convert it to. If you don't specify an item, the bot will return your current inventory.

!CONV inv (item)

Example:

!CONV i log
!CONV inv hyper-log
!CONV inventory epic-fish.

Trade Rates from an Area

Available trades and their rates are different between areas. To tell the bot which area you want to use, tell it that you want to change areas, and which area to use. This will be stored in your user profile until you change it. Example:

!CONV change-area 6

Your User Data

To see all of the data that the bot has collected on you, just ask it!

!CONV user

Developer

If you want to host your own instance of the bot, follow these steps.

Installing the bot

Clone the repository to your own computer and change directories.

git clone [email protected]:Chris1221/epic_rpg_converter.git
cd epic_rpg_converter

Install all of the python dependencies.

pip install -r requirements.txt

Then install the bot (we use the -e option here so that you can edit the code and run it right away.).

pip install -e .

Registering your bot

register a new bot on the Discord Developer Portal and obtain a bot token.

Create a file called .env. We use python-dotenv to manage secrets.

## In .env
DISCORD_TOKEN=${YOUR_TOKEN}

Setting up your database

Ensure that you have PostgreSQL installed. You can either download it from an official repository or if you are on OSX, install it with Homebrew.

brew install postgresql

Start your PostgreSQL server (psql)

pg_ctl -D $DATA -l $LOG start

Replacing the DATA directory and LOG variables with values appropriate for your system.

Your username will be your system username by default.

Open up the .env file from before and add three values:

DB_NAME="Name"
DB_USER="YOUR_NAME"
DB_PASS="A_PASSWORD"

The name will be the name of the database that is created, while the username and password do what they say on the tin.

Running the bot

To run the bot, either call epic_rpg_converter.bot.run() or use the command line entry point:

convert_bot

After that, invite your bot to a server and play around. If you want to use a different trigger (!CONV used here) so that you can have both bots in the same server, change the trigger variable in bot.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.