[0] Show Balance in crypto + $

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);