LOLBeans.io Idler

Get LOLBeans colors and accessories while doing absolutely nothing

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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