Greasy Fork is available in English.

Alternative pp data scaling

Shows alternatively scaled pp data on osu!

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Alternative pp data scaling
// @namespace   http://osu.ppy.sh/u/Kert
// @description Shows alternatively scaled pp data on osu!
// @include     http*://osu.ppy.sh/u/*
// @include     http*://osu.ppy.sh/p/pp*
// @grant       none
// @version     1.1
// ==/UserScript==

// Super mega sophisticated formula
// Thanks to FullTablet http://osu.ppy.sh/u/Full_Tablet
function GetScaledPP(pp){
    // 20 = 1 / (1 - 0.95)
    // the magic number is mathematically justified due to how pp weightnings work
    return pp / 20;
}

// Profile pages
function ProfileProc(){
    // ensure the needed element loaded
    var a = null;
    while(a === null){
        a = document.getElementsByClassName("profileStatLine")[0].getElementsByTagName("b")[0].getElementsByTagName("a")[0];
    }

    var all = document.getElementsByClassName("profileStatLine")[0].getElementsByTagName("b")[0].innerHTML;
    var link = document.getElementsByClassName("profileStatLine")[0].getElementsByTagName("b")[0].getElementsByTagName("a")[0].outerHTML;

    var text = '';
    for (var i = link.length+2; i < all.length; i++){
        text += all[i];
    }
    // skip non-players
    if(text != "-"){   
        var arr = text.split('pp');
        var pp = arr[0].replace(",", "");
        var scaled = GetScaledPP(pp);
        var rounded = Math.round(scaled);
        var res = link + ": [" + rounded + "] " + arr[0] + "pp" + arr[1];
        document.getElementsByClassName("profileStatLine")[0].getElementsByTagName("b")[0].innerHTML = res;
        document.getElementsByClassName("profileStatLine")[0].getElementsByTagName("b")[0].setAttribute("title", "Scaled pp: [" + scaled +"]");
    }
}

// Performance ranking page
function PerformanceProc(){
    var tables = document.getElementsByClassName("beatmapListing")[0].getElementsByTagName("tr");
    for(var i = 1; i < tables.length; i++){
        var curTable =  document.getElementsByClassName("beatmapListing")[0].getElementsByTagName("tr")[i];
        var old = curTable.getElementsByTagName("td")[4].getElementsByTagName("span")[0].innerHTML;
        var arr = old.split('pp');
        var pp = arr[0].replace(",", "");
        var scaled = GetScaledPP(pp);
        var rounded = Math.round(scaled);
        var res = "[" + rounded + "] " + arr[0] + "pp";
        curTable.getElementsByTagName("td")[4].getElementsByTagName("span")[0].innerHTML = res;
        curTable.getElementsByTagName("td")[4].setAttribute("title", "Scaled pp: [" + scaled +"]");
    }   
}

window.addEventListener("load", function(e) {
    // Selecting which function to use
    if(document.URL.match(/http.:\/\/osu\.ppy\.sh\/u\//i))
        ProfileProc();
    else
        PerformanceProc();
}, false);