// ==UserScript== // @name Stake.com Vault Script // @description Sends a percentage of your profits to the vault // @description Updated to make it run on all official mirrors // @description If stake.com is blocked by your country, is lagging or has a bad performance, try one of their mirrorsites // @description Find all official mirrors at --> https://playstake.io/ // @description Tips through Stake appreciated: @nyaWon (https://stake.com/?modal=user&name=nyaWon) // @description My ref: stake.com/?c=564e5749df // @description Based on @Dauersendung script which is outdated // @description Tested with crypto display only (don't use USD, EUR, JPY, BRL, CAD, CNY, IDR, INR, KRW, MXN, PHP, RUB view) // @description Setup percentage to be saved at SAVE_AMOUNT (at the beginning of the script) // @description Running it in more than one tab might cause duplicated deposits to the vault // @version 1.5 // @author Christoph Hummel // @match https://stake.com/* // @match https://stake.bet/* // @match https://stake.games/* // @match https://staketr.com/* // @match https://staketr2.com/* // @match https://staketr3.com/* // @match https://staketr4.com/* // @match https://stake.bz/* // @run-at document-end // @namespace Stake.com Vault Script // @downloadURL https://update.greasyfork.icu/scripts/408276/Stakecom%20Vault%20Script.user.js // @updateURL https://update.greasyfork.icu/scripts/408276/Stakecom%20Vault%20Script.meta.js // ==/UserScript== (function() { const SAVE_AMOUNT = 0.10 //Percentage of the winnings, in decimal (Examples: 50% => 0.50, 75% => 0.75, 15% => 0.15, 10% => 0.10) const DISPLAY_VAULT_TOTAL = true; // If true it will display the VAULT TOTAL. If false it will display the SUM of deposits made since opened function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i r.json()).then((response) => { updateCurrency(); let balance = response.data.user.balances.find(x => x.vault.currency == activeCurrency); if(balance) { this._element.innerText = balance.vault.amount.toFixed(8); } }); } update(amount) { console.log('updating'); if (DISPLAY_VAULT_TOTAL) { this._element.innerText = amount.toFixed(8); } else { this._element.innerText = (parseFloat(this._element.innerText) + amount).toFixed(8); } } reset() { console.log('reseting'); if (DISPLAY_VAULT_TOTAL) { this.setVaultBalance(); } else { this._element.innerText = "0.00000000"; } } } let wing; function init(){ if (document.readyState === 'complete') { var oldBal = document.querySelector(balanceSelector).innerText; var curBalEle = document.querySelector(balanceSelector).innerText; wing = new Wing(); function tresor() { oldBal = curBalEle if (oldBal = curBalEle) { function checkBalance() { var curBalEle = document.querySelector(balanceSelector); if(updateCurrency()) { // if currency was changed return wing.reset(); oldBal = document.querySelector(balanceSelector).innerText; curBalEle = document.querySelector(balanceSelector).innerText; return; } if(document.querySelectorAll(balanceSelector).length > 0) { curBalEle = document.querySelector(balanceSelector).innerText; if(curBalEle != '') { if (curBalEle > oldBal) { var depositAmount = ((curBalEle - oldBal) * SAVE_AMOUNT); if (depositAmount >= 1e-8) { oldBal = (parseFloat(curBalEle) - parseFloat(depositAmount)).toFixed(8); stakeApi.depositToVault(activeCurrency, depositAmount).then((r) => r.json()).then((response) => { if (DISPLAY_VAULT_TOTAL) { try { let cvd = response.data.createVaultDeposit; let balanceObject = cvd.user.balances.find(x => x.vault.currency == cvd.currency); wing.update(balanceObject.vault.amount); } catch (err) { console.log('Error trying to read vault balance'); wing.update(depositAmount); } } else { wing.update(depositAmount); } }); } } } } } window.setInterval(checkBalance, 751); //timerspeed read send to tresor } else { tresor(); //if different balance run func tresor } } var myTimer = setTimeout(tresor, 5500); } else { setTimeout(init, 5000); } }; init(); })();