LOLBeans.io Idler

Get LOLBeans colors and accessories while doing absolutely nothing

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

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

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          LOLBeans.io Idler
// @description   Get LOLBeans colors and accessories while doing absolutely nothing
// @author        https://github.com/abbydiode
// @version       2021.02.09a
// @match         https://lolbeans.io/*
// @require       https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
// @namespace https://greasyfork.org/users/875843
// ==/UserScript==

function startIdler() {
    let idleTime = sessionStorage.idleTime ?? 0;
    let playButton = $('#btn-play')[0];
    console.log('LOLBeans Idler Started');
    sessionStorage.idling = true;
    playButton.click();

    setInterval(() => {
        sessionStorage.idleTime = ++idleTime;
        $('#idle-info')[0].textContent = 'You\'ve idled for ' + idleTime + ' seconds';

        $('.continue-btn.visible')[0].click();
        $('.new-game-btn.visible')[0].click();
    }, 1000);
}

function loadUI() {
    $('#btn-play').after('<button id="btn-idle" class="cta" style="font-size:large;margin-top: 16px;">Start Idling</button>');
    $('#btn-idle').click(() => startIdler());
    $('#death-screen-quit-btn').click(() => {
        console.log('LOLBeans Idler Stopped');
        sessionStorage.idling = false;
    		sessionStorage.idleTime = 0;
        location.reload();
    });
    let idleTime = 0;
    $('#fps').after('<div id="idle-info" style="font-family: Arial; position: absolute; bottom: 22px; left: 16px; z-index: 100; font-size: 12px; color: #fff; background-color: rgba(0,0,0,.2);">Idler Disabled</div>')
}

$(() => {
    loadUI();
    if (sessionStorage.idling === "true") { setTimeout(() => startIdler(), 1000); }
});