Greasy Fork

来自缓存

Greasy Fork is available in English.

Gleam.io 胜率显示

展示胜率。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name			Gleam.io Winning Chance
// @name:ja			Gleam.io かちのチャンス
// @name:zh-TW			Gleam.io 勝率顯示
// @name:zh-CN			Gleam.io 胜率显示
// @license			CC-BY-NC-SA-4.0
// @namespace			Gleam.io
// @version			1.2
// @description			Let's show the odds of winning.
// @description:ja		勝算を示そう。
// @description:zh-TW		展示勝率。
// @description:zh-CN		展示胜率。
// @author			Royalgamer06 & albertopasqualetto & Misha
// @icon			https://gleam.io/assets/content/logo-icon-d03a2d45d7b2b59f244530b3e64cf310afee9825ea81a7de0a98877bb0f9b8ca.svg
// @match			*gleam.io/*
// @grant			none
// @supportURL			https://github.com/Mishasama/UserScript/issues
// @homepageURL			https://github.com/Mishasama/UserScript/raw/master/Misha's%20US/Gleam.io%20Winning%20Chance
// @contributionURL		https://ko-fi.com/mishasama
// @contributionAmount		1$
// @compatible			edge
// @compatible			chrome
// ==/UserScript==

$(document).ready(function() {
    if (document.getElementById("current-entries") !== null) {
        $('.span4.blue-square.ng-scope').after('<div class="span4 green-square ng-scope"> <span class="square-describe mont"> <span class="status small"> <span class="current ng-binding" id="winning_chance">NaN</span> </span> <span class="description ng-binding">Winning Chance</span> </span> </div>');
        var elems = document.querySelectorAll("div.square-row.row-fluid.center.ng-scope > .span4");

        for (var i = 0; i < elems.length; i++) {
            elems[i].setAttribute("style", "width:25%;");
        }

        var gleam = setInterval(function() {
            if (document.querySelector(".status.ng-binding") !== null) {
                var own = parseInt(document.querySelector(".status.ng-binding").innerHTML);
		var total = parseInt(document.querySelector(".current.ng-binding").textContent.replace(/[,.]/,''));
                var chance = Math.round(100000 * own / total ) / 1000;
                document.getElementById("winning_chance").innerHTML = chance + "%";
		console.log("[Gleam W.C.] Your winning chance is " + chance + "%!");
                clearInterval(gleam);
            }
        }, 500);
    }
})();