From 4bcc17231d31d867e4c28c5c405fac8bd51cbb91 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Tue, 3 Jun 2025 10:15:47 +0300 Subject: [PATCH] Fix rakeback and add ticket collection --- SkinraveRakebackCollector.user.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/SkinraveRakebackCollector.user.js b/SkinraveRakebackCollector.user.js index d572f39..5279188 100644 --- a/SkinraveRakebackCollector.user.js +++ b/SkinraveRakebackCollector.user.js @@ -2,7 +2,7 @@ // @name Skinrave Rakeback Collector // @namespace https://pube.tk // @version 2025-06-03 -// @description Claims rakebacks +// @description Claims rewards // @author Abhorrent_Anger // @match https://skinrave.gg/en/rewards // @icon https://www.google.com/s2/favicons?sz=64&domain=skinrave.gg @@ -16,9 +16,16 @@ const RECHECK_TIMER = 60000; const INITIAL_TIMER = 2000; const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden"; const RAKEBACK_AMOUNT_SELECTOR = 'div[data-testid="rakeback-amount"]'; +const TICKET_SELECTOR = 'div[data-testid="reward-ticket-claim-button"] button:not(:disabled)' const EMPTY_CLAIM = 'Claim 0.00 T'; function runRoutines() { + collectRakeback(); + collectTickets(); + setTimeout(runRoutines, RECHECK_TIMER); +} + +function collectRakeback() { $(RAKEBACK_AMOUNT_SELECTOR).each(function () { let button = $(this).parent().children('button').eq(0); if (button.text() == EMPTY_CLAIM) { @@ -28,7 +35,16 @@ function runRoutines() { button.click(); console.log('Attempted to claim a rakeback'); }); - setTimeout(runRoutines, RECHECK_TIMER); +} + +function collectTickets() { + let ticketButton = $(TICKET_SELECTOR); + if (ticketButton.length == 0) { + console.log('No tickets to collect'); + return false; + } + ticketButton.click(); + console.log('Attempted to collect tickets'); } waitForKeyElements(MAIN_WINDOW_SELECTOR, () => {