Magic Logs
Magic Logs is a python script for a Discord bot. Discord is a chat service that keeps conversations between many users organized. The general purpose of the bot is to retrieve, display, and track Old School Runescape account statistics within Discord.
It all started as a joke, a small script that a friend and I would use to tell each other how much more XP we had in a particular skill (This eventually became the flex command). Over time more commands were added to the bot, and now the bot has its own Discord community built up around it.
The name of the chat bot is inspired by the name of an in-game item "Magic Logs", because the bot behaves like a "magical" set of logged character data.
If you would like to join the Dicord to see the bot yourself: *
*Please note that this invite link is set up such that if you do not get a role assigned to you before you log out, you will be automatically kicked when you log out. You will not be able to see any chat channels besides the rules channel until you are given a role. Instructions for obtaining a role on the server can be found in the rules channel.
Commands:
$GE
Format: $GE [Item Name]
Looks up the given item and returns its:
- Current Price
- Change in value in the last 24 hours
- Percent change in the last 30 days
- High alchemy profit
- Flavor Text
- Icon
$Flex
Format: $flex [Skill Name] [OSRS Username]
This command is only available to those who have a registered account.
To use this command, put the account you would like to compare your account to in the OSRS Username field. The bot will then direct message you and ask what skill you would like to compare. After you have provided a proper skill, it will submit the amount of difference between your account and the account provided with a bar graph.
$History
Format: $history [NONE|week|month|all]
This command is only available to those who have a registered account.
This command will display the amount of XP that you have gained since the last XP snaphot (currently taken at 4AM PST) if you do not put anything after the command. Effectively this shows you the amount of XP that you have gained in the last 24 hours. If the bot has been tracking you for long enough, then you can use the week, month, or all option to show the amount of XP gained in the last week, month or since you started tracking your stats.
$Register
Format: $Register @[Discord User]
You must have a "Mod" role to use this command
Registers a Runescape username to a Discord account. A mod may use this command on a Discord user to register their account to that particular discord server. Once you invoke the command, the bot will ask what OSRS username you would like to register to that account. If done properly, it should enable the ability to use the $flex command as well as using defaults on the $stats, $pie and $combat commands. The bot will walk you through the registration process, and will tell you when it has completed properly.
$Pie
Format: $Pie [OSRS Username]
If the [OSRS Username]
is left blank and your account is registered, then the command will use your registered username
Gets and displays the statistics for an OSRS username in pie chart form. It seperates the pie based on XP. If the username's statistics cannot be found then the bot will notify the user of this.
$Stats
Format: $Stats [OSRS Username]
If the [OSRS Username]
is left blank and your account is registered, then the command will use your registered username
Gets and displays the statistics for the OSRS username that was provided, if the username's statistics cannot be found then the bot will notify the user of this.
$Combat
Format: $Combat [OSRS Username]
If the [OSRS Username]
is left blank and your account is registered, then the command will use your registered username
Gets and displays the combat statistics for is OSRS username that was provided. If the username's statistics cannot be found then the bot will notify the user of this. The bot also displays the breakdown of how their combat lvl is calculated.
$Users
Format: $Users
Gets and displays the OSRS usernames that have been registered to the server so far.
$Leaderboard
Format: $Leaderboard [Skill Name]
Gets and displays the leaderboard for the skill provided, if the skill cannot be found then the user will be notified with a DM that that skill could not be found.
If the [Skill Name]
is left blank then the leaderboard of all skills is displayed along with the name of the person with the highest amount of XP in that skill.
Sources:
discord.py
https://github.com/Rapptz/discord.py
This is a wonderful tool that was made by "Danny" Rapptz. It allows for the communication between a bot and Discord.
Plotly
Plotly is a python library that allows the bot to make visually pleasing graphs
Beautiful Soup
https://www.crummy.com/software/BeautifulSoup/
Beautiful Soup is a python library that allows the bot to get information off of the OSRS hiscore website.
Future Plans: (In no particular order)
Weekly gain leaderboard posted every sunday(Should be completed, but may have bugs still)- Move from Sqlite3 to Postresql
- Website for the bot
- Ability to add roles by reacting to the bot with an emoji (Discord Feature)
- Improve stability so that the bot can exist on many servers. At the moment it is not stable enough to be on more than one
Adding this bot to your server:
If you would like this bot on your own discord server, email me for the link at: 4nandes@gmail.com