LOLBeans.io Idler

Get LOLBeans colors and accessories while doing absolutely nothing

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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); }
});