RandomSeedChanger["stake.com"]

Change SeedPair with a customizable-random Interval on Stake.com

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         RandomSeedChanger["stake.com"]
// @description  Change SeedPair with a customizable-random Interval on Stake.com
// @match        https://stake.com/*
// @author       Rain_Bot | rainbot.ch
// @namespace    https://greasyfork.org/users/710212
// @version      5.2rev7
// @license      Open Source
// @run-at       document-end
// ==/UserScript==

var minInterval = prompt("Set Your minimum interval in Minutes", 10); //set your minimum interval in minutes
var maxInterval = prompt("Set Your maximum interval in Minutes", 30); //set your maximum interval in minutes

function getRandom(min, max) {
    return Math.random() * (max - min) + min;
}

function rotateSeedPair() {
    function getCookie(cname) {
        var name = cname + "=";
        var decodedCookie = decodeURIComponent(document.cookie);
        var ca = decodedCookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1);
            }
            if (c.indexOf(name) === 0) {
                return c.substring(name.length, c.length);
            }
        }
        return "";
    }

    function generateSeed(length) {
        let result = "";
        const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        const expectedPackages = new Uint32Array(length);
        window.crypto.getRandomValues(expectedPackages);
        for (const expectedPackage of expectedPackages) {
            result += characters.charAt(expectedPackage % characters.length);
        }
        return result;
    }
    fetch("https://api.stake.com/graphql", {
        "method": "POST",
        "headers": {
            "Content-Type": "application/json",
            "x-access-token": getCookie("session")
        },
        "body": "{\"query\":\"mutation RotateSeedPair($seed: String!) {\\n  rotateSeedPair(seed: $seed) {\\n    clientSeed {\\n      user {\\n        id\\n        activeClientSeed {\\n          id\\n          seed\\n          __typename\\n        }\\n        activeServerSeed {\\n          id\\n          nonce\\n          seedHash\\n          nextSeedHash\\n          __typename\\n        }\\n        __typename\\n      }\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n\",\"variables\":{\"seed\":\"" + generateSeed(32) + "\"},\"operationName\":\"RotateSeedPair\"}"
    }).then((FieldOperation) => {
        return FieldOperation.json();
    }).then((data) => {
        console.log("Active Client Seed\n" + data.data.rotateSeedPair.clientSeed.user.activeClientSeed.seed);
        console.log("Active Server Seed (Hashed)\n" + data.data.rotateSeedPair.clientSeed.user.activeServerSeed.seedHash);
        console.log(data);
    });
}

function init() {
    var interval = Math.floor(getRandom(minInterval * 6e1 * 1e3, maxInterval * 6e1 * 1e3));
    console.log("\n\n\nSeed Change @ " + new Date().toLocaleTimeString());
    rotateSeedPair();
    setTimeout(() => {console.log("Next Swap in " + (interval / 1e3 / 6e1).toFixed(2) + " minutes");}, 1337);
    setTimeout(() => {init();}, interval);
}

window.onload = function loadpage() {
    if (document.readyState === 'complete') {
        console.clear();
        console.log('Pageload:\t' + '%c' + document.readyState.toUpperCase(), 'color:green');
        init();
    }
};