[0] Show Balance in crypto + $

Every time you win a bet the script sends your desired % to the Vaulet

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         [0] Show Balance in crypto + $
// @description  Every time you win a bet the script sends your desired % to the Vaulet
// @namespace    https://greasyfork.org/de/users/444902-dauersendung
// @version      1.1
// @author       Dauersendung
// @match        https://stake.com/*
// @run-at document-start
// ==/UserScript==
function getCurrency() {
    return JSON.parse(localStorage.getItem("v2_currency")).currency;
}
function getRate(cur) {
    return JSON.parse(localStorage.getItem('v2_currency')).conversions.rates[cur];
}
function convertCurrency(cur, val) {
    return val * getRate(cur);
}
function getConversionElem() {
    var ele = document.querySelector("#conversionElem");
    if(ele == null) {
        ele = document.createElement("span");
        ele.id = "conversionElem";
        ele.innerText = "0.00$";
        document.querySelector(".styles__Wrap-rlm06o-0.bGSyHm").insertBefore(ele, null);
    }
    return ele;
}
function checkBalance() {
var curBalEle = document.querySelector(".styles__Cashier-puey40-2.dMSTdD .styles__Content-rlm06o-1.ixoRjG").innerText;
    var curBal = curBalEle.innerText;
    getConversionElem().innerText = convertCurrency(getCurrency(), curBalEle).toFixed(2) + "$";
}
window.setInterval(checkBalance, 1200);