- Clone the repository
git clone https://github.com/DEVUCP/EconBot
- Make sure you have Python 3.12 or higher installed. You can check your version with :
python --version
- Install the required dependencies:
pip install discord
-
Sign into your discord account on the Discord Developer Portal
-
Create a new application by clicking the
New Application
button in the top right of the page.After creating your application, it will redirect you to its setting's page.
-
Click the
OAuth2
section. -
Scroll down to the
OAuth2 URL Generator
. -
Tick on the
Bot
option.After that, the URL Generator panel will expand downward.
-
Scroll down to
Bot permissions
and under "General permissions" tickAdministrator
. -
Scroll further down to
Integration type
and make sure its onGuild Install
-
You may use the Generated URL to invite your bot into your servers.
Token Setup & Environment Variable Setup
-
Get your bot token from going to the
Bot
section in your application settings. -
Press on
Reset Token
to create your bot token. (NOTE: You will only be able to view it once after reseting, otherwise you'll have to reset it again) -
Copy the token (its a bunch of random characters).
-
Set up an environment variable named
econtoken
and value as your token that you copied (here are some video tutorials...)
Alternatively you can just directly paste the bot token into the code; however, this is not recommended.
- To do this, go to the file
main.py
and on the last line you should see
singletons.client.run(os.getenv("econtoken"))
- Replace it with this instead. (paste your token in place of the
YOUR TOKEN HERE
)
singletons.client.run("YOUR TOKEN HERE")
- Open up terminal
- Make sure you're in the root directory (the folder you just cloned)
Note : You will have to run and terminate the bot process once to generate the save file so the bot will work.
- Run the bot using
py main.py
- You can terminate it by pressing
CTRL + C
in the terminal you ran it in.
Running and terminating the first time will generate a userdata.pkl
file in saveload
directory which is necessary for the bot to work.
Run again after that and you should be good to go.
You can earn money and employability with $work
command. You make different amount of money depending on your occupation.
You can alternatively earn more money on average with $crime
, but this will decrease your employability.
Finanlly, you can earn little money on average with $beg
, this will decrease your employability, but not as much as crime.
Every 1 minute
that passes in real life is equal to 1 hour
in game.
For now what time or day it is doesn't really affect gameplay whatsoever, but could be implemented easily using utils.py
module.
Doing the market command will display the normal Market and a drop-down menu, where you could buy from the Black Market.
You can go to any page from the black market or normal market by just adding the page number in the command -> $market 3
(will display 3rd page of normal market)
Your bank card determines the maximum you're allowed to deposit into your bank account.
To upgrade your card:
- Max out your current card by depositing to its limit
- Use the
$balance
command - Click the green "Upgrade Card!" button that appears
You can check available jobs with $jobs
command.
Every in-game week avaialble jobs will change. You can only apply to those in that listing with $apply <job name>
All they're used for at the moment is job requirements
Strength -> Can be increased with $workout
Dexterity -> Can be increased with $paint
Intelligence -> Can be increased with $study
Charisma -> Can be increased with $socalize
Creativity -> Can be increased with $paint
Employability -> Can be increased by working ($work
)
The main limiter with advancing in the game. You're supposed to tactically use your energy.
You gain 1 energy every in-game hour from the last time you've expended an energy slot.
You can check your bar with $profile
or $energy
if you want to just see your energy.
Items can be bought in the markets, each can have a unique usage.
You can buy items for their selling price, but be careful- because you sell them for a loss!
class structure can be found in UML claas diagrams.pdf
(NOT UPDATED)
-
Folder & file names should be lowercase and
flatcase
. -
Any non-const variables should be in
snake_case
. -
Add comments to the code that explain the purpose of the code, not what it does.
-
All
const
variables should be inMACRO_CASE
. -
All Classes and Methods should be in
PascalCase
. Example:GetAccountID()
. -
Make sure to use XML documentation with every function.
Saving ONLY occurs when bot's run is terminated. Generates a 'savedata.pkl'
file in saveload/
directory.
Saving is done via python's pickle
module.
See pickling documentation for more info.
.
├── assets/ # Contains image files for the project
│ ├── icon.png
│ └── installation_banner.gif
│
├── commands/ # Holds command-related modules
│ ├── apply.py
│ ├── bank.py
│ │
│ ├── display/ # Modules for displaying information
│ │ ├── balance.py
│ │ ├── clock.py
│ │ ├── help.py
│ │ │
│ │ ├── interactables/ # Interactive display components
│ │ │ └── itemlists.py
│ │ │
│ │ ├── inventory.py
│ │ ├── jobs.py
│ │ ├── markets.py
│ │ └── profile.py
│ │
│ ├── earnings.py
│ ├── inventory.py
│ └── training.py
│
├── econ/ # Economy system modules
│ ├── attribute.py
│ ├── bank.py
│ │
│ ├── cards/
│ │ └── bankcard.py # Bank card related modules
│ │
│ ├── energy.py
│ │
│ ├── items/ # Item-related modules
│ │ ├── item.py
│ │ └── items.py
│ │
│ ├── jobs/ # Job-related modules
│ │ ├── job.py
│ │ ├── jobs.py
│ │ └── listings.py
│ │
│ └── user.py
│
├── saveload/ # Save and load functionality, also holds the generated save file.
│ └── saveload.py
│
├── constants.py
├── main.py
├── README.md
├── singletons.py
└── utils.py