73 lines
2.0 KiB
JavaScript
73 lines
2.0 KiB
JavaScript
// ==UserScript==
|
|
// @name Rulka Pro Fortune Wheel Spinner
|
|
// @namespace https://pube.tk
|
|
// @match https://rulka.pro/fortune*
|
|
// @icon https://www.google.com/s2/favicons?sz=64&domain=rulka.pro
|
|
// @version 2026-03-13
|
|
// @author Abhorrent_Anger
|
|
// @description Claims free daily spins
|
|
// @grant none
|
|
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
|
|
// @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.3/waitForKeyElements.js
|
|
// @run-at document-end
|
|
// ==/UserScript==
|
|
|
|
const INITIAL_TIMER = 4000;
|
|
const RECHECK_TIMER = 12 * 60 * 60 * 1000;
|
|
const RELOAD_TIMER = 24 * 60 * 60 * 1000;
|
|
const ROLLER_TIMEOUT = 10 * 1000;
|
|
const COLLECT_TIMEOUT = 5 * 1000;
|
|
const MAIN_WINDOW_SELECTOR = ".content";
|
|
const FREE_SPIN_BUTTON = '.wheel .slot .load span.i-picon\:ammo';
|
|
const ROLLER_RIGHT = '.roller.right';
|
|
const COLLECT_HAND = '.wheel-container .center span';
|
|
|
|
function clickFreeSpin() {
|
|
$(FREE_SPIN_BUTTON).click();
|
|
console.log('Waiting for the roller button...');
|
|
setTimeout(clickRollerRight, ROLLER_TIMEOUT);
|
|
}
|
|
|
|
function clickRollerRight() {
|
|
$(ROLLER_RIGHT).click();
|
|
console.log('Waiting for the collection button...');
|
|
setTimeout(clickCollect, COLLECT_TIMEOUT);
|
|
}
|
|
|
|
function clickCollect() {
|
|
$(COLLECT_HAND).click();
|
|
console.log('Waiting for the OK button...');
|
|
setTimeout(clickOK, COLLECT_TIMEOUT);
|
|
}
|
|
|
|
function clickOK() {
|
|
$(COLLECT_HAND).click();
|
|
console.log('Clicked the OK button...');
|
|
}
|
|
|
|
function runRoutines() {
|
|
console.log('Checking for free spin claims...');
|
|
clickFreeSpin();
|
|
setTimeout(runRoutines, RECHECK_TIMER);
|
|
}
|
|
|
|
function setupReload() {
|
|
console.log('Sleeping for '+RELOAD_TIMER+' seconds...');
|
|
setTimeout(reload, RELOAD_TIMER);
|
|
}
|
|
|
|
function getCooldown() {
|
|
let time = 0;
|
|
time += ($(MINUTE_SELECTOR).text() * 60 * 1000) + 60 * 1000;
|
|
return time;
|
|
}
|
|
|
|
function reload() {
|
|
console.log('Reloading...');
|
|
location.reload();
|
|
}
|
|
|
|
waitForKeyElements(MAIN_WINDOW_SELECTOR, () => {
|
|
setTimeout(runRoutines, INITIAL_TIMER);
|
|
setTimeout(setupReload, RECHECK_TIMER);
|
|
}); |