forum

osu!PPBot - Annonce in game PP changes (Now easy to use!)

posted
Total Posts
8
Topic Starter
Arnold0
Hi,

So I've decided I needed to change that thing a lot. Because hosting it yourself needed a setup that was annoying and would make users went to just pass because it was too annoying. So here is the new version, now self hosted by me only that you can use simply by sending a command in game!

But first, what is osu!PPBot ? It is a simple bot that will send you a message when you gained PP!

And how does it works ? After sending !getPP to me (Arnold0) in game, the bot will now query the osu!API every minute and check if your amount of PP changed. It is the case ? The bot justs sends you a message saying you how many PP you won, your new PP value, your amount of rank gained/lost and new rank as well! And it will keep doing so as long as you are playing (It will consider you are playing as long as your PP or Playcount increases), and up to 60 minutes after you stop playing. If you didn't play for 45 minutes, the bot will even inform you you have 15 minutes left, and the same for 5 minutes, to make sure it will continue retrieving the data from the API if you want to. You can reset the timer back to 60 minutes by playing a ranked map or sending !getPP again. If you do not play nor send commands for 60 minutes, the bot will just stop retrieving data for you, until you send !getpp again which will restart it.
You can use this with any game mode by sending !mode std/taiko/ctb/mania.

TL:DR Just send !getPP (!mode taiko/ctb/mania for non std players) and just play, send the command again if you are warned you timer will run out soon and you plan to keep playing. You'll get how many PP you won up to 1 minute after you finished your PP awarding play.

Why are you waiting up to 1 minute before sending the PP change ?
It's simple : I do not want to send too many requests to the osu! API, as doing so could get my access to the API blocked. So I execute the code querying the API only once per minute per user. Of corse I cannot send you a message saying your PP changed when I don't know it changed yet.

The bot says me it cannot retreive data from the API and then fails saying me to try again...
It is likely to be caused by the fact your account is innactive or because you have no PP in the gamemode you are trying to use the bot. Please remember that the default mode is osu!std. You need to type !mode std/taiko/ctb/mania if you are playing a different gamemode than what is currently selected by the bot.

I realy hope that will be usefull and you'll enjoy using it ;)

Screenshoot :


Old original version below :
SPOILER
This is what this originally was before I changed it to something multi user that I host. I recommand you to use the new versiopn by sending me a !getPP in game. This is still here for people who wants, for exemple if the currect version crashes or is offline

Hi,

So I few days ago, I remeber seeing someone asking if there was something to announce how many PP you won like mikuia does when you live stream, but without needing to live stream/use twitch chat.
I don't know if something similar already exist, but I decided I would give it a shot as it is pretty simple to do.

So here I am, with my small program to do exactly that.
Here is the result once you get it running and play some maps :

(The error in the word "amont" has been changed but I didn't bother taking a different screenshot)
It does check the osu! API every 10 seconds, and if your PP amont changed, then it informs you by sending a message in game! ;)

But before that, you'll need to get some informations and fill a configuration file for the program to work (I hope you can understand I cannot insert my osu! IRC password and API Key inside the program, especialy since JAVA code can be quite easily decompilled.)
How to set this up ?
You will need to get your IRC password first, you can get it on this page : https://osu.ppy.sh/p/irc
Once you have your IRC password, keep it safe. Never share it with other people!
You'll also need to get an osu! API key. It is needed so my program can send requests to the osu! API to poll for your rank and PP ammont. You can get it here : https://osu.ppy.sh/p/api
As your IRC password, that key is private and should remain secret, never share it with other people as well.

Now that you have both, you will need to fill the config file. Extract the archive from the bottom of this post somewhere on your computer, and open the file config.txt
You only have 4 things to enter in it.

The config file format looks like that :
// Some comments
// Some more comments
parameterName|ParameterValue.
You can delete the comments if you realy want to (Even if there is no point in doing so)
You must not change the parameterName nor remove the | or it will not work.
You must have no spaces in between the ParameterName, the | and the value
After the osuUser| you should add you osu! username. If your user name contains spaces, replace them with underscores.
After the osuPassword| you should add your osu! IRC password. Do not put your osu! account password, or it will not work.
After the apiKey| you should add your API key that you got before.
After the mode| you must add a number in between 0 and 4 to chose the gamemode you want to use this with. 0 Is for osu! (STD), 1 is for Taiko, 2 is for Catch the Beat and 3 is for osu!Mania.
After the config file is filled it should look something similar to this this :

Once you have done that, you can start the program using Startosu!PPChangeBot.bat. Do not start it using the .jar file. Starting with the .jar file might work, but the program will be stuck in background and you will be unable to close it unless using task manager.
After you've openned it, and if you entered all informations correctly, you should receive a message from yourself in game stating that the bot is connected and a second one with your current PPs and Rank.
You can now play and everytimes your PP changes it will be annonced in the game with the amont of PP you got and the new value for your PPs and rank if it changed.

It doesn't work...
  1. If you are getting an error saying something similar to "java isn't recognised as a valid file or command" then it means you do not have a Java Runtime Environement (JRE) on your PC. Download a JAVA JRE online, restart your computer and try again. You can get JRE from here : https://www.java.com/en/download/
  2. If the program doesn't work stating that the config file is incomplete or invalid, it means one of the parameters is missing or blank. Please fill every parameters and try again.
  3. If the program doesn't work stating that an error occured, it means the data returned by the API was invalid. It might be because your internet is having issues, or you entered an invalid osu! username or key in the config file.
  4. If the program crash with a wierd stack trace stating "Could not log into the IRC server: :cho.ppy.sh 464 Nickname :Bad authentication token." it means either your osu! username or osu! password was not valid. Please check your osu! username is correct and you did insert your osu! IRC password correctly. (Remeber that you have to use your osu IRC password, this is not the same password as what you use to log in in the game client!)
  5. If you gain PP but the program doesn't announce it after 10 seconds, it might be because it got disconnected form bancho. If it is the case, restarting it should be enough.

I'm tired of your long message, just give the link plz!
Ok here it is : https://arnold0.com/osu/osu!PPChangeBot.zip
Archive containing my project files for paranoid people : https://arnold0.com/osu/osuppbot.rar (Do not download this unless you want to check the source code)
You can compile the content of the second file using eclipse. I'm a bad devlopper, so my code is probably extreamly ugly. I do not care as long as it works, so if you only want to post something to say that my code is badly made then refrain from doing so. I'm putting this here just in case people want to verify that I'm not trying to store people API keys or passwords.

I hope this will be usefull, have fun playing ;)
TheHiddenKitten
This, so far as I've used it, is good.
just to showcase another screenshot,


(The error in the word "amont" has been changed but I didn't bother taking a different screenshot)
The word you want, is spelled 'amount'. (the only meaning of 'amont' i know of, is uphill, in french)
Topic Starter
Arnold0
old
Hi,

So I've noticed some problems when using this, so here is some bugfixes :

- The word amount has been changed again (Not fixed in the "source code" link as it was a last minute change and I was lazy to rezip the source code files for a 3 character change.
- The program no longer freezes when trying to poll the API and having connection issues.
- The program no longer stops when the API doesn't respond or API response is invalid, it will warn you instead that API polling has failed and will keep running unless the very first polling failed (As the 1st one failing might be because of missconfiguration)
- The program no longer stop working when it gets disconnected from bancho. (It might however take up to 5 minutes before detecting it has been disconnected. It will then try to reconnect every 30 seconds untill it succeds).



New version links :
Runnable file : https://arnold0.com/osu/osuppchangebotv002.zip
Source code : https://arnold0.com/osu/osuppbot002.rar
Tutorial in the first post still applies.
Edit : Check first post instead of using this
tkilele
Started it up, will be using it for tonight at least and will let you know if there's something in the need of fixing.

After testing: Played for two hours didn't com across anything weird, just noticed how bad I am, and that from 2 hours of playing only gained 9pp to my total PP count.
Topic Starter
Arnold0
I've changed the way this works, and i'm now hosting it myself on a server. Read first post for details.
PS : I'm not the best dev in the world, it has been tested by me and two other players with no problems, but I don't realy know how it will react to more people.
Topic Starter
Arnold0
Wed Jan 18 17:34:59 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:34:59 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:34:59 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!mania !!
Wed Jan 18 17:34:59 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:36:19 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:36:19 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!mania !!
Wed Jan 18 17:36:19 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:36:19 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:37:29 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:37:29 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:37:29 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!mania !!
Wed Jan 18 17:37:29 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:38:30 CET 2017 > Timer of user jasonf0302 was set back to 60 because his playcount changed. Previous value : 56
Wed Jan 18 17:38:30 CET 2017 > Timer of user CarlSagan42 was set back to 60 because his playcount changed. Previous value : 56
Wed Jan 18 17:38:30 CET 2017 > Timer of user LukenSkyne was set back to 60 because his playcount changed. Previous value : 43
Wed Jan 18 17:39:40 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:39:40 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:39:40 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:39:40 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!mania !!
Wed Jan 18 17:40:40 CET 2017 > Timer of user jasonf0302 was set back to 60 because his playcount changed. Previous value : 58
Wed Jan 18 17:40:40 CET 2017 > Timer of user CarlSagan42 was set back to 60 because his playcount changed. Previous value : 58
Wed Jan 18 17:41:46 CET 2017 > User Nerthar issued !mode command
Wed Jan 18 17:41:46 CET 2017 > Mode from Nerthar was changed. Old value : 3, new value : 0. (Timer was set back to 60)
Wed Jan 18 17:42:00 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:42:00 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:42:00 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!std !!
Wed Jan 18 17:42:00 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:43:20 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:43:20 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!std !!
Wed Jan 18 17:43:20 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:43:20 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:44:30 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:44:30 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!std !!
Wed Jan 18 17:44:30 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:44:30 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
Wed Jan 18 17:45:50 CET 2017 > WARNING - Retrieving data from the API failed for user LukenSkyne, mode : osu!std !!
Wed Jan 18 17:45:50 CET 2017 > WARNING - Retrieving data from the API failed for user Nerthar, mode : osu!std !!
Wed Jan 18 17:45:50 CET 2017 > WARNING - Retrieving data from the API failed for user jasonf0302, mode : osu!std !!
Wed Jan 18 17:45:50 CET 2017 > WARNING - Retrieving data from the API failed for user CarlSagan42, mode : osu!std !!
I don't know if that's because of something in my code or if the API is slow (or not responding) but annonces will probably not work or be very delayed if that continues.

EDIT : Seams to have stopped for now.
SlowLogicBoy
Bancho was acting up at that time so...

By the way love this bot!
-Kanzaki
Cool stuff here but is there a way you to add a feature i just thought about which is that it also shows how much pp does the map you just did worths (the pp value on the profile->top ranks)


Please sign in to reply.

New reply