网易BUFF价格比例插件---CSGO版

try to take over the world! --Written by Pronax

目前为 2020-08-29 提交的版本。查看 最新版本

// ==UserScript==
// @name         网易BUFF价格比例插件---CSGO版
// @namespace    http://pronax.wtf/
// @version      1.0.9
// @description  try to take over the world! --Written by Pronax
// @copyright    2020, Pronax
// @author       Pronax
// @license MIT
// @match        https://buff.163.com/market/goods*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.pronax_buff_scale_plugin_load = function (){
        // 检测商品是否加载完成
        if ($("#market-selling-list").length == 0) {
            setTimeout(pronax_buff_scale_plugin_load, 50);
            return;
        }

        // 税后价格
        function waxPrice(price,status){
            let temp_a = price.innerText.split(" ")[1];
            return status?temp_a.substring(0,temp_a.length-2):temp_a;
        }

        // 保留2位小数
        function roundToTwo(num,status){
            return status?Math.round((num*100)+0.5)/100:Math.round((num*100))/100;
        }

        var price_list = $(".f_Strong");
        var isLogined = $(".f_Strong")[0].getAttribute("id")=="navbar-cash-amount";
        var basic_price = roundToTwo(waxPrice(price_list[isLogined?1:0],true)/1.15,true);

        for (let i = isLogined?2:1; i < price_list.length; i++) {
            let thisEle = price_list[i];
            let scale = roundToTwo(waxPrice(thisEle)/basic_price);
            if(i==(isLogined?2:1)){
                $(".f_Strong .hide-usd")[0].innerText = basic_price;
                $(price_list[isLogined?1:0]).append($("<big style='color: red;margin-left: 6px'>"+scale+"</big>"));
            }
            let target_scale = $(thisEle.parentNode).next()[0];
            $(target_scale).append($("<b>"+scale+"</b>"));
        }
    }

    pronax_buff_scale_plugin_load();

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址