Posted:

## General[Brawlhalla] ELO Rating & Win Glory [Discord.JS Snippet]Posted: Thu Aug 05, 2021 5:59 pm

Monument
• Challenger
Status: Offline
Joined: Mar 13, 20165Year Member
Posts: 149
Reputation Power: 7
Status: Offline
Joined: Mar 13, 20165Year Member
Posts: 149
Reputation Power: 7
 Add a nifty Brawlhalla ELO generator based on rating or win glory. ```         // Snippet Created by ro0ti#2266 (TTG Monument)         let answer = message.content.substring().split("|");         let Rating = answer[1]; // ELO         let Wins = answer[2]; // TOTAL WINS         message.reply("Rating Glory: " + GetGloryFromBestRating(Rating) + "\n" + "Wins Glory: " + GetGloryFromWins(Wins));             function GetGloryFromWins(totalwins) {             if(totalwins<=150) return 20*totalwins;             return Math.floor((10*(45*Math.pow(Math.log10(totalwins*2),2)))+245);         }                 function GetGloryFromBestRating(bestrating) {             var retval=0;             if(bestrating<1200) retval=250;             if(bestrating>=1200&&bestrating<1286) retval=10*(25+((0.872093023)*(86-(1286-bestrating))));             if(bestrating>=1286&&bestrating<1390) retval=10*(100+((0.721153846)*(104-(1390-bestrating))));             if(bestrating>=1390&&bestrating<1680) retval=10*(187+((0.389655172)*(290-(1680-bestrating))));             if(bestrating>=1680&&bestrating<2000) retval=10*(300+((0.428125)*(320-(2000-bestrating))));             if(bestrating>=2000&&bestrating<2300) retval=10*(437+((0.143333333)*(300-(2300-bestrating))));             if(bestrating>=2300) retval=10*(480+((0.05)*(400-(2700-bestrating))));             return Math.floor(retval);         }         message.delete({timeout:2000}); // 1 second = 1000 miliseconds ```
Users browsing this topic: None