forum

Bot for osu!mania

posted
Total Posts
28
Topic Starter
- Alexmal -
Well, hello there~

I made a bot that will recommend maps for you. Works similar to Tillerino, but for mania mode.
It provides map recommendations and also calculates pp values for user-given maps as well.

>>Commands list.
>>Source code (outdated)
Things you might need to know
1. Bot works nomod only. It won't calculate double time for you.
2. Recommendations work only for 4K and 7K. Maps amount is pretty small for other keys.
3. May not work for highskilled players.
4. PP calculations work only for ranked, loved, qualified and approved maps.


Future
Currently Im working on another version that, I hope, will be more useful, comfortable and better. ;) Ill finish it as soon as I have free time
Here are something I want to share with you:

Settings. No need to type !r 4 every time. Set your keys mode and use !r (more comfortable, right?). Also, you will be able to set language and turn DT mode there.

Yes, Double Time. DT recommendations will be availible now. Also, pp calcultaion will be added too, but you will need to input star rating with double time in addition.

Languages? Languages!. I will add support of custom languages, so any one who interested will be able to add one for his native language :)
Ofcourse all these settings will be saved and loaded after restart.

Also, Im gonna turn on !dif command for all key modes.

Custom calculations. For example, you want to calculate unranked map, or see what will change with different settings. Ill add that thing.

Converted maps. Today bot is angry when you try to calculate converted map. It will not anymore

For now Im not sure when will I update, but you can help me with testing. PM me if want to.


Big thanks to jakads for providing formulas.
Also, thanks to Chilly- and RedNesto for big help they are doing for me. O:

Feel free to contact me if you have any suggestions. Via forum messages or Discord (Alexmal#6621)
Ayya Novak
that's my boy!
zloypesik
Nice one
-Makishima S-
Nice work, as you said "bad code", maybe I could share some of my work experience. Might help a bit to make your code more readable and better to maintain:

Uhhhh.... code moding xD
- One class, one functionality. I recommend moving https://cryolite.s-ul.eu/gc6Xs6YC.png from Data.cs (same for Osu.cs) into another class files. It is issue often made by programmers and mentioned in S.O.L.I.D. principles of C# programming.

- Logging:

Performance wise your solution isn't good, I could recommend something like:

var logText = new StringBuilder();
logText.Append($"{variable}");
File.AppendAllText(logFilePath, logText.ToString());
logText.Clear();

This doesn't need to be disposed.

- Don't set variable type for constructor if its not needed, instead use "var" keyword. Compiler will automatically add type depends on output.
For example:
Instead of
Random rand = new Random();
use
var rand = new Random();

- Resources should be either manually disposed or used within "using" statement (which take care of disposing automatically) + closed (Data.cs,Line:19 StreamReader is not closed, nor disposed).

- Usage of arrays is last thing to do. NET. gives enough tools to avoid them (IEnumerable, List, Manually created Linked list, Dictionary etc)

- In the future consider making a XML/JSON/Text config file where user could put his API key instead of hard coding it.

- You can return values directly without implementing additional variable at some points.

- Naming, naming and one more time naming - use one solid convention which you follow for whole project. Using undertable in normal variables in same time with method props is a big no no. Pascal casing for methods, camel casing for variables, if you are new to programming, I could recommend sticking with globally used naming convention.

That is all to make this code looking way better. Wish it helps you maintain future projects, with time you will gain a lot of experience where you will notice that something can be made easier.

Have fun, coding is life, you will like it if you sit more and code every day. 8-)

When I come back to home, will check it in mono if it works (eventually contribute in it for linux server functionality).
Topic Starter
- Alexmal -

[Taiga] wrote:

Nice work, as you said "bad code", maybe I could share some of my work experience. Might help a bit to make your code more readable and better to maintain:

Uhhhh.... code moding xD
- One class, one functionality. I recommend moving https://cryolite.s-ul.eu/gc6Xs6YC.png from Data.cs (same for Osu.cs) into another class files. It is issue often made by programmers and mentioned in S.O.L.I.D. principles of C# programming.

- Logging:

Performance wise your solution isn't good, I could recommend something like:


var logText = new StringBuilder();
logText.Append($"{variable}");
File.AppendAllText(logFilePath, logText.ToString());
logText.Clear();


This doesn't need to be disposed.

- Don't set variable type for constructor if its not needed, instead use "var" keyword. Compiler will automatically add type depends on output.
For example:
Instead of
Random rand = new Random();
use
var rand = new Random();

- Resources should be either manually disposed or used within "using" statement (which take care of disposing automatically) + closed (Data.cs,Line:19 StreamReader is not closed, nor disposed).

- Usage of arrays is last thing to do. NET. gives enough tools to avoid them (IEnumerable, List, Manually created Linked list, Dictionary etc)

- In the future consider making a XML/JSON/Text config file where user could put his API key instead of hard coding it.

- You can return values directly without implementing additional variable at some points.

- Naming, naming and one more time naming - use one solid convention which you follow for whole project. Using undertable in normal variables in same time with method props is a big no no. Pascal casing for methods, camel casing for variables, if you are new to programming, I could recommend sticking with globally used naming convention.

That is all to make this code looking way better. Wish it helps you maintain future projects, with time you will gain a lot of experience where you will notice that something can be made easier.

Have fun, coding is life, you will like it if you sit more and code every day. 8-)


When I come back to home, will check it in mono if it works (eventually contribute in it for linux server functionality).


Awoo, thanks for help~ I'll take a look tonight. :)

Tried to build it on elementary. Used xbuild and monodevelop and it was fine but one thing: logging xD Date worked different there.
Edgar_Figaro
used it a bit and it seems really nice, one suggested I'd have for you though is not making the !acc command case sensitive. if you do !ACC it currently does not work, must be in lowercase
Topic Starter
- Alexmal -

Edgar_Figaro wrote:

used it a bit and it seems really nice, one suggested I'd have for you though is not making the !acc command case sensitive. if you do !ACC it currently does not work, must be in lowercase


Should work now, thanks! x3
RyrverF
LOVE
Jun Maeda
Great job
Kizuna


I'm triggered xd

the !r 4 does not work for me :thinking:

Also, mania have a poor ranked listings compared to STD, so i highly suggest to add pending and graveyarded map. it will be WAY MORE interesting with this feature.
Topic Starter
- Alexmal -
Well, Im surprised it worked for your pp amount xD (even like this)

Not really good time. Im rewriting !r algorithm atm and the process goes really slow. (University problems /shrug)

That's not easy with graveyard maps. I need to download everymap the bot will use.

Anyway, thanks for report. ^^
powaful3000
This is very good i like very much
Caj
cool thx
abraker
DT recommendation can't come soon enough tho I have a feeling it still won't help me find maps that are good to DT on
Jahrein
Bot is offline -_- wut?
TomoridropMoeta
how to install this?
pixlr_old_1
does this relate with the songs tags?
im too lazy to read the code.

suggestion: calculate where the objects are placed and a similar type of mapping style for example you play a map with a lot of stacks and you get a high accuracy i think it should recommend you more maps like that.
Topic Starter
- Alexmal -
Can't connect to IRC server since yesterday, bot is offline until the problem is solved.
Currently waiting for a response from osu! support.

UPD: Well, looks like it works for now.
-[K_E_N]-
Great Bot for Mania: D
fineline
seems about right for people like me who like mania
-[K_E_N]-
if I agree with fineline to support that bot that all maniacs will know how to use them well
Gnomed
Bot broke?
Cristinamumu
muito obg te amo
Xx_akus_xX
bot was dead ?
Topic Starter
- Alexmal -

Xx_akus_xX wrote:

bot was dead ?
Yeah and I was cycling in another city. Couldn't figure it out earlier.
irfaniskandar12
bot gone?
Smash69420ontt
any tuts for installing this?
-OffRGBGam3rYT-
Yea I tried using it, and it dont work.
Please sign in to reply.

New reply