Selector fix

This commit is contained in:
Abhorrent_Anger 2025-06-03 10:07:58 +03:00
parent 78318dc87b
commit 3ddf4630d1

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Skinrave Rakeback Collector
// @namespace https://pube.tk
// @version 2025-03-11
// @version 2025-06-03
// @description Claims rakebacks
// @author Abhorrent_Anger
// @match https://skinrave.gg/en/rewards
@ -15,16 +15,17 @@
const RECHECK_TIMER = 60000;
const INITIAL_TIMER = 2000;
const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden";
const CLAIM_SELECTOR = 'body > div.flex.overflow-y-auto.overflow-x-hidden div.gap-4 div.flex-wrap div.flex-col button:not(:disabled)';
const RAKEBACK_AMOUNT_SELECTOR = 'div[data-testid="rakeback-amount"]';
const EMPTY_CLAIM = 'Claim 0.00 T';
function runRoutines() {
$(CLAIM_SELECTOR).each(function () {
if ($(this).text() == EMPTY_CLAIM) {
$(RAKEBACK_AMOUNT_SELECTOR).each(function () {
let button = $(this).parent().children('button').eq(0);
if (button.text() == EMPTY_CLAIM) {
console.log('Skipped an empty rakeback');
return;
}
$(this).click();
button.click();
console.log('Attempted to claim a rakeback');
});
setTimeout(runRoutines, RECHECK_TIMER);