Auto login, auto attack at max energy and refresh every minute
目前為
// ==UserScript==
// @name TrueBonus Auto Attack + Refresh
// @namespace https://truebonus.ru/
// @version 1.1
// @description Auto login, auto attack at max energy and refresh every minute
// @author Rubystance
// @license MIT
// @match https://truebonus.ru/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const EMAIL = "YOUR_EMAIL_HERE";
const MAX_ENERGY_TEXT = "Attack (20)";
const REFRESH_TIME = 60000; // 1 minute
function waitFor(selector, callback, interval = 300) {
const timer = setInterval(() => {
const el = document.querySelector(selector);
if (el) {
clearInterval(timer);
callback(el);
}
}, interval);
}
function autoRefresh() {
setTimeout(() => {
location.reload();
}, REFRESH_TIME);
}
// Login / Register page
if (location.pathname === "/" || location.pathname === "/index.php") {
waitFor('input[name="email"]', (input) => {
const form = input.closest('form');
const button = form?.querySelector('button[type="submit"]');
input.focus();
input.value = EMAIL;
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
if (button) {
setTimeout(() => button.click(), 500);
}
});
}
// Dashboard
if (location.pathname === "/dashboard") {
waitFor('#attack-btn', (attackBtn) => {
const tryAttack = () => {
if (
attackBtn.innerText.includes(MAX_ENERGY_TEXT) &&
!attackBtn.disabled
) {
attackBtn.click();
}
};
// Initial attempt
tryAttack();
// Real-time observer
const observer = new MutationObserver(tryAttack);
observer.observe(attackBtn, {
childList: true,
subtree: true,
characterData: true,
attributes: true
});
// Force refresh every minute
autoRefresh();
});
}
})();