Jump to content

Recommended Posts

[CPT]milopugdog
Posted (edited)

Howdy all!

This is the initial release page for the stat tracking Discord bot Commodore, and will be updated as I further develop the program.

 

Future developments:

Squadron structure.

Awards.

Web service calling.

 

Firstly, I'd like to answer "What is Commodore?"

This program is a python-based statistic tracking bot for Discord that uses SQLite to store data. I wrote this program with the intention of it being used with player-made campaigns, as well as squadrons who would want to easily keep track of information for individual aircraft types. An important thing to know is that data has to be manually added into the bot's database.

 

Data that is submitted by users can then either be displayed as an embedded table as an individual:

image.png.a7038d9566b9538286284ba813d0fbcd.png

*Image 1 note: Color on the left side of table matches in-server role color. The table thumbnail will match your Discord profile picture

 

Or it can also be displayed if the user decides to be in a squadron:

image.png.5b58b04258cfe875f9d9d8c69ce5537c.png

*Image 2 note: Color on the left side of table can be customized with hexadecimal color codes. The table thumbnail will initially be transparent, but can be customized with a hyperlink to the desired image.

 

"So, when it comes to total features, what can this bot do?" You may be wondering? Well, in total:

  • Track stats in two ways, and display it in four ways
    • Track aircraft and tank stats
    • Display individual tables for aircraft and tank stats, overall individual stats (reference image 1), and overall squadron stats (reference image 2)
    • Clear stats to 0
  • Join/leave a in-bot squadron
    • Ability to add a custom color through any color wheel hexadecimal value
    • Ability to add a custom squadron image by submitting a link to any image

 

"What does it look like to use this bot in Discord?" You might be wondering again. Well, good thing I asked for you!

Here is an example of me using the bot to submit some data for aircraft:

image.png.e21e947563180348cca90070108b3982.png

*Image 3 note: Whatever you decide to report will be added to the existing total for that value. So, 1+1=2.

 

Are you interested?

You can have the bot join your Discord server using this link, and read some tips I have for using the bot below that:

https://discordapp.com/oauth2/authorize?client_id=570505861999493146&permissions=0&scope=bot

 

Getting started:

All the current commands are in the spoiler below this. A table can also be brought up in-app using !help:

Spoiler

Clear: Clears player stats

Help: Brings up help page

Profilecreate: Adds a user to the database

Report: Is used to report data

Salute: Is used to have Commodore salute you in chat

Squadcolor: Is used to add a custom color to squad table

Squadjoin: Is used to join a squadron. This is the 'creation' command as well, members will type out the name as well.

Squadleave: Is used to leave a squadron

Squadpic: I used to add a custom picture in squad table, put a hyperlink to image in chat

Squadstats: Shows squadron stats

Statst: Shows individual tank stats

Statsa: Shows individual aircraft stats

Stats: Shows overall player stats

 

 

First off, when adding this bot to your sever, I recommend making a bot channel if you don't have one. Having a chat channel spammed by bots is never fun.

Secondly, You will want to use the !profilecreate command. This will add you into the bot's database and allow you to use the rest of the commands!

Lastly, you should get used to how the reporting is formatted. There are text prompts sent by the bot. However, they are wrote to me, the creator. So they may not make sense to a user not used to it.

 

Do you have any questions, comments or feedback? I'd love to hear it!

You can either leave them in the comments of this thread, or contact me directly through:

PMing me on this forum

Joining my IL-2 BoX Discord server: https://discord.gg/UXFKX6G

PMimg me, milopugdog#6533 on Discord - please specify you're talking about the bot if you do

 

Thank you all for reading my post, and I hope you can get some use out of my little project!

Milo

 

This thread is a continuation of updates from this thread:

 
Edited by [CPT]milopugdog
Title change
  • Like 1
  • Thanks 5
  • 4 weeks later...
[CPT]milopugdog
Posted (edited)

Howdy all!

I wanted to give a quick update to what I'm doing with this program:

Earlier last week, I started working with Beautifulsoup4 to scrape statistic information from the various IL-2 server websites.

To begin this, I started off with my stats on Combat Box found through this link: http://combatbox.net/en/pilot/1294/[CPT]milopugdog/?tour=17

 

Then, I could begin inspecting the webpage's structure, and slapping something together which would grab text off the webpage.

unknown.png

 

Today, using some additional and modified code from what you see above, I put the data inside an embedded table inside Discord. Here is that result:

image.png.1dc3b5cfc09922f7aebaf0cb83e1af79.png

 

Here's another example with another fairly popular player:

image.png.fc7aa9ab2ae63c1b547f47d94b23061f.png

 

The command only works for stats on Combat Box for this month currently, but I'm going to add the ability to use other servers, and look at past months in the future!

 

Until next time,

Milo

Edited by [CPT]milopugdog
Grammar
  • Jason_Williams pinned this topic
  • 2 weeks later...
[CPT]milopugdog
Posted (edited)

Howdy, all!

I wanted to give a run down of an update of the bot I just finished working on.

Here are all the changes:

Stat Table:

-Current air and ground streak are now included

-Link to player's profile is now in the table description

-Table side bar color now changes depending on a player's favorite coalition

--Red for allies, blue for axis, and black for none

 

Usage:

-Servers Combat Box, The Unprofessionals, and KOTA are currently supported.

--Combat box command: !combox (in-game username here)

--The Unprofessionals command: !unprofstats (in-game username here)

--KOTA command: !kotastats (in-game username here)

 

Other:
-Command descriptions have been added in !help table

 

Some pretty pictures of the new tables:

image.png.d050ed4e68c8bbf0d5bb0fc39a2ff450.png

image.png.df8a24ff0a0d326d80b74b0e926d27dc.png

image.png.77980b73a602d3716cc0b5b97ba4e1ef.png

 

And once again, if you are interested in my bot, you can add it to your Discord server! It works no matter how big or small, and doesn't require any special permissions. You can add it to your server by clicking HERE

Edited by [CPT]milopugdog
[CPT]milopugdog
Posted

Howdy, all!
I wanted to give some some quick updates for some changes I made this week:

Stat table:

-Action Dogfight and Tanks added as a server

--Usage is !efrontstats (username)

-Hyperlink to a players profile can be accessed through clicking the stat table's header:

image.png.eb5e9e269bd3379f4c152bda2852a466.png

 

Other:

-Fixed bug for all servers where the top 20 players would have stat tables created in chat if there is no username variable entered with a command.

What would happen before:

image.thumb.png.2c4108763e59f66e28cb0458cadf07be.png

 

What happens now:

image.png.0f1e184843041fd48d1499832e70a6df.png

-Added inclusion for the automatic syncing of tours with stat websites for table data, and the automatic changing of the Tour variable in the stats table.

--i.e. the bot will always request stats for a server's current tour.

 

I'm hoping to finish a new command for looking at a player's last sortie this week, but we will have to see what happens!

image.png.0ba07269f78b45f260ad57281cb71dd6.png

 

Until next time,

Milo

  • Upvote 1
[CPT]milopugdog
Posted

Howdy, all!

Another week, and another week of additions. I put a bit of work in to get both of these new functions together and working without kinks for today.

 

Firstly, from last week, the last sortie command is now working for all supported servers.

Usage for all of them remains the same as the usual stat command, only with lastsortie replacing stats

Ex: !comboxlastsortie

      !unproflastsortie

      !kotalastsortie

 

Here is an example of the information that is displayed in that table:

image.png.b0850fd815dc28cf201154dc13d7ba8b.png

 

Also, the command !registeruser (username) has now been added

What this command does is allows for a user to register their in-game username to their Discord profile.

Previously, if a player wanted to view their own profile's stats, it would look like the following:

image.png.b6ac407f88e8b79a4567edd71d08c7df.png

 

But with this addition, it is as simple as:

image.png.0472cdb21d9e6a58181b7d3a13d2ae1c.png

 

To do this, you need to use the !registeruser (username) command, and replace (username) with your in-game name:

image.png.db3b922b3726a98b189321528c2c9fc8.png

 

and then you're good to go! If you end up changing your username, or mistype it, simply enter the command again and it will be overwritten.

 

IF you haven't used the !registeruser command, and try to call a table like you have, you will get the following:

image.png.18ebffda884eee1d1c8f9305d894bc4f.png

 

AND of course, if you wish to look up someone else's stats, and you have registered your username, you can continue to use the command as it was previously:

image.png.8d8d9f946c7345124b1ff019b8c83657.png

 

This function works for all servers the bot supports, and also with the normal stat table and last sortie commands.

 

IMPORTANT NOTE: Registering a username is transserver. Meaning if you register a username on my IL-2 GB Discord, then go to DerSheriff's Discord or the Combat Box Discord, you will not have to re-register.

 

And that's all I have for this week!

Until next time,

Milo

 

  • Like 1
  • 3 weeks later...
[CPT]milopugdog
Posted

Howdy, all! It's been a few weeks since the last update.

Due to some time constraints on my end, I haven't been able to push out the squadron table update yet, but I have most the code written now, and it's just missing some variables and extra tidbits that will tie it all together into a functioning command that's up to par with the rest of the bot.

 

Today, I would like to explain the inner workings of the bot a little bit, specifically, the !registeruser command because that changed how the back end of the bot works entirely. Before this command, the bot would search for a user depending entirely on their input after every command. However, with the addition of this command, it shifted gears to looking for user input, and stored values. To accommodate for this, a database would have to be created, and for every user that enters a command, a profile created so a critical if statement would function properly:

image.thumb.png.eed10d5b013fb1a706517ba4924e8cb2.png

This section is ran every time a command is used, and is what determines whether or not the bot will use direct player input through discord, or search for a submitted username in the database. And also if someone did not give the bot input, and have no username in the database, what to do.

 

Now, I would like to show what this database looks like, and information I store to make it work:

database.PNG.db0b95010bae0829230b188a9396c7af.PNG

 

In order for this database to properly work for identification, I decided to store a user's Discord username, server of use, as well as their user id. The first time you use any multiplayer related command, a row is created with your information. When a user submits a username with !registeruser, it is stored in the username column, with "no" being the default. The Uses column is to track just that; times a user calls a command, a squadron column for future use, and also an existence column which I won't go into why it is there.

One reason I wanted to write this post is that I wanted to be extremely clear that in order for this program to work as it is, I am gathering this kind of information from users. Ultimately, I cannot and will not do anything with it, since it is simply for identification.

 

I hope this gives you a slight insight into what happens behind the scenes whenever you call a command, and I hope my honesty about this situation doesn't discourage anyone from using this program.

 

Until next time,

Milo

  • 1 month later...
[CPT]milopugdog
Posted (edited)

Howdy all!

It's been a long while, but I've got some good developments happening on the bot.

 

 -A bunch of new servers have been added to bot's list, the total list of supported servers is now:

--Action dogfight and tanks, Combat Box, Jasta 5's FC Flugspark, Finnish Virtual Pilots, Knights of The Air, The Unprofessionals, and Wings of Liberty.

 

-The squadron stats command is finally completed. You can call this command using, for example, !comboxsquad (squadron name).

Just like with the other stats commands, you can register a squadname so you do not have to type it in every time.

This will create a table looking like this:

image.png.30fa661f235431cbd3f52487d48740e1.png

This command is currently available for:

Combat Box

Finnish Virtual Pilots

Wings of Liberty

 

Other servers had no squadrons registered, so I did not add an options for those servers.

 

-A troubleshooting command with solutions common issues has been added, which can be used by entering !troubleshoot.

 

-The bot has been changed to utilize Discord's cogs system. This means that commands are now categorized in the help menu. Along with this, I have went through and updated descriptions for every command available.

image.thumb.png.fd3e89ea2c1b8744944465936eb38e4e.png

 

This updated help page also allows you to view specific information regarding categories, or specific commands:

image.thumb.png.d94be2e530c6c56db7294418a5cae1d3.png

image.thumb.png.e2b9ee821171330d8e11d77b6118032c.png

 

Until next time,

Milo

 

Edited by [CPT]milopugdog
  • 1 month later...
[CPT]milopugdog
Posted (edited)

Howdy all!

I'd like to take a moment to list another group of changes and developments happening with this program.

 

Firstly, I'd like to point out a few quality of life changes:

1. Looping the bot by entering a character, or word very common in usernames is no longer possible

i.e. no more this:

image.thumb.png.6535c58dd9441ebe5f1842d6e691e025.png

2. The bot now creates a stat table for you back one tour until you play the server during the current tour. This wasn't an issue, but folks would be a little confused why their stats wouldn't come up when a server's tour would roll over. This new table doesn't look any different, but it creates situations where two month's stats can be present at the same time for different users.

3. When a player has not entered a valid username, not played on a server for two months, or never played on the server, the bot will now give you an error message to help troubleshoot.

Here is what it looks like:

image.png.32f0d7dae9f89161187ff8fb0bda752e.png

 

The final thing I want to touch on is a completely new function I'm working on.

This function is a squadron registry that should make it easier for squads to get themselves advertised, and people to find applicable groups to fly with.

Currently, I'm only taking entries for the database, which an example of how information is entered looks like this:

image.thumb.png.abc00359bf54c15af42b6f27b89d597b.png

 

I know it doesn't look like much, but I'm planning on making it more intuitive as I develop the idea more.

Eventually, I plan on adding search functions, and a squadron home area for viewing applications, etc.

Something sort of like in what you see in War Thunder  that one other flight sim nobody likes to talk about.

 

Anyways, that's all I have for now!

Until next time,

Milo

 

Edited by [CPT]milopugdog
  • 2 months later...
[CPT]milopugdog
Posted

Howdy all!

 

It's been a good while since I've posted anything here, but I'm back in, and we're bringing some good news!

 

I've been working the past few days putting together a new build for the bot. While it won't all be immediately obvious, it does include some very nice and important changes in the long run under the hood.

 

Here are the changes:

1. Date timestamp added to all tables in YYYY-MM-DD format.

2. The bot will now submit information from a server's previous tour if you have not played in the current one.

image.png.816b8ef9095f18cb32c56b788be26995.png

 

2. A check with feedback if a website's domain cannot be connected to:

image.png.3d555cb1a655da16fcc5262136cbab21.png

 

3. Ability to use the bot's commands in DMs

-DM Commodore#6944 to use

 

4. Changing from identifying a user by their username to their userID

-You can change your actual Discord name all you want and the bot will still be able to identify you.

 

5. Database unique variable change from username to userID

-This prevents duplicate profiles being automatically created.

 

As mentioned, these changes do not mean that much from a user's standpoint, but it required a bit of rewriting old code, and transferring of database information.

Next update hopefully I will be able to report larger changes; mainly a complete rewrite of singleplayer stat submitting!

 

Until then,

Milo

 

 

  • 4 months later...
[CPT]milopugdog
Posted

Howdy all!

It's been a good while.

 

I'm back to working off the bot after some creativity block, and I've made a small addition and have a small roadmap of things I want to do:

1. Tank stats are finally working! These work for Finnish Virtual Pilots and Action Dogfight and Tanks

Their respective commands are the normal calls with tank after the server name. So, !finntankstats and !efronttankstats

They also feature rearranged tables for the vehicles, and I left in the air section for those AAA M4 tankers, and soon to be added SPAA trucks. :)

image.png.09e507f18ee877441a8c0327d4d06ba8.png

image.png.b2a23262402f8f86417a70d81d7c8844.png

 

Second is my roadmap:

1. New help table:

the Discord default table is too long with our current arrangement of repeating commands. Ideally, the bot will DM this to someone so chat does not get cluttered

 

2. Server status table:

This is something a little more ambitious, as I don't even know if everything I'm aiming to achieve is possible, but we'll see. Essentially, I want to put everything important in the homepage of a server's site, for example Finnish VP's: http://stats.virtualpilots.fi:8000/en/ in a table that will update every 15 minutes automatically, or also when someone reacts with a certain emoji.

 

Until next time,

Milo

 

   

 

  • Thanks 1
  • 4 months later...
-332FG-Stravinsky
Posted (edited)

Hi Milo,

 

In our discord group we're starting a competition of air kills and we thought it'd be more useful to use a bot to track stats.

 

Is there any way to then display all the users of a squad in a leaderboard format, say have some kind of command being !board[squadname][AK]?

 

Edited by -332FG-Stravinsky
[CPT]milopugdog
Posted
On 5/26/2021 at 12:32 PM, -332FG-Stravinsky said:

Hi Milo,

 

In our discord group we're starting a competition of air kills and we thought it'd be more useful to use a bot to track stats.

 

Is there any way to then display all the users of a squad in a leaderboard format, say have some kind of command being !board[squadname][AK]?

 

Hey, sorry I didn't respond sooner, I've been completely swamped with work!

 

From what I'm getting from your message, you're looking to do manually submitted stat tracking?

-332FG-Stravinsky
Posted

Well I thought of implementing your bot in our discord text channel dedicated for the competition.

The goal is: first pilot to get to a kills streak of 26 without dying.

 

According to your bot, it seems like every pilot could then make their claims and reports to track their progression. They could also clear their stats if they died. But I'd like to know if there would be a way to then display a ranking of said pilots sorted by kills reported. Like a leaderboard that could be summoned by a command.

[CPT]milopugdog
Posted
5 hours ago, -332FG-Stravinsky said:

Well I thought of implementing your bot in our discord text channel dedicated for the competition.

The goal is: first pilot to get to a kills streak of 26 without dying.

 

According to your bot, it seems like every pilot could then make their claims and reports to track their progression. They could also clear their stats if they died. But I'd like to know if there would be a way to then display a ranking of said pilots sorted by kills reported. Like a leaderboard that could be summoned by a command.

No there isn't something like that currently. When do you plan on having the competition?

I could revamp the manual stat system and include a leaderboard if there's enough time.

-332FG-Stravinsky
Posted

Competition is on right now, but no where near the end.

 

Okay well, I was just asking, cuz I think that'd be a nice feature :)

 

 

  • 5 months later...
[CPT]milopugdog
Posted

hey everyone!

The bot will be suffering from an outage because I'm moving across the US. I'm not certain when I'll be able to get it set back up, but will when I can.

  • LukeFF unpinned this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...