eBonus.gg Helper

Automate tasks on eBonus.gg

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         eBonus.gg Helper
// @namespace    Julian
// @version      0.3
// @description  Automate tasks on eBonus.gg
// @author       Julian
// @include      *://ebonus.gg*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

const safeguard_refresh = 6; //minutes

setTimeout(function() {
    console.log("reached");
    //$(document).on("DOMSubtreeModified", function () {
    var coinswatcher = setInterval(function() {
        if ($(".coins_popup").length > 0) {
            clearInterval(coinswatcher);
            console.log("clicked");
            $(".coins_popup").click();
        }
    }, 1000);
    //});
    if (location.href.indexOf("/earn-coins/watch") > -1) {
        $.ajax({ type: "POST", url: "/earn-coins/watch/yt", data: { started: 'true' } });
        paused = false;
        started = true;
        var vidlength = $("div.col_video > script").text().split("time >= ")[1].split(" ")[0];
        var watcher = setInterval(function() {
            $.ajax({ type: "POST", url: "/earn-coins/watch/yt", data: { paused: 'true', time: vidlength }, success: function(data) {
                console.log(data.done);
                if (data.done == "true") {
                    done = true;
                    clearInterval(watcher);
                    location.href = "https://ebonus.gg/earn-coins/watch";
                }
            }});
        }, 2000);
    }
}, 5000);

setTimeout(function() {
    location.reload();
}, safeguard_refresh * 60000);