BITSLER ROLLHUNT BOUNTY SCRIPT

1

Stan na 23-11-2021. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name BITSLER ROLLHUNT BOUNTY SCRIPT
// @name:en BITSLER ROLLHUNT BOUNTY SCRIPT
// @version 14.88228-Release
// @description 1
// @description:en 2
// @copyright 2019, ADMINBITSLERAHUESOS
// @author ADMINBITSLERAHUESOS
// @match https://www.bitsler.app/*/dice
// @match https://www.bitsler.com/*/dice
// @grant none
// @license MIT
// @namespace 1
// @require http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==



(function ()
{
    'use strict';
    window.addEventListener('load', function()
    {
            for (let i = 0; i < 10; i++)
            {
                var input = document.createElement("input");
                input.type = "text";
                input.id  = "roll"+i;
                input.size = 5;
                document.querySelector("#game-controls-box").appendChild(input);
            }
        var checkbox = document.createElement('input');
            checkbox.type = "checkbox";
            checkbox.id  = "work";
            document.querySelector("#game-controls-box").appendChild(checkbox);
        demo();
    }, false);
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
async function demo()
{
    while(true)
    {
        await sleep(1500);
            var rolls = [];
            for (let i = 0; i < 10; i++)
            {
                var roll = parseFloat(document.querySelector('#roll'+i).value);
                if(!isNaN(roll))
                {
                    rolls.push(roll);
                }
            }
            if(rolls.length>0)
            {
                var matches = document.querySelectorAll('div.di-bg > div > div.game-top > div.di-top-wrapper.clearfix > div > ul > li');
                matches.forEach(function(item, i, matches)
                {
                    var roll_id = parseFloat(item.getElementsByTagName('a')[0].href.replace(/\D/g,""));
                    var roll_number = parseFloat(item.getElementsByTagName('span')[0].innerText);
                    rolls.forEach(function(itm, j, rolls)
                    {
                        if(Math.abs(itm-roll_number)<=0.05)
                        {
                            if(document.querySelector('#work').checked)
                            {
                                if(Math.abs(itm-roll_number)==0)
                                {
                                                            for (let y = 0; y < 10; y++)
                                                            {
                                                                var roll = parseFloat(document.querySelector('#roll'+y).value);
                                                                if(!isNaN(roll))
                                                                {
                                                                    if(Math.abs(roll-roll_number)<=0.05)
                                                                    {
                                                                        document.querySelectorAll('iframe')[0].contentWindow.document.querySelector('#msg-input').value='#'+roll_id+' '+roll_number;
                                                                        console.log('#'+roll_id+' '+roll_number);
                                                                    }
                                                                }
                                                            }
                                }
                            }
                            else
                            {
                                                                                            for (let y = 0; y < 10; y++)
                                                            {
                                                                var roll = parseFloat(document.querySelector('#roll'+y).value);
                                                                if(!isNaN(roll))
                                                                {
                                                                    if(Math.abs(roll-roll_number)<=0.05)
                                                                    {
                                                                        document.querySelectorAll('iframe')[0].contentWindow.document.querySelector('#msg-input').value='#'+roll_id+' '+roll_number;
                                                                        console.log('#'+roll_id+' '+roll_number);
                                                                    }
                                                                }
                                                            }
                            }

                        }
                    });
                });
            }
    }
}
})();