Fix rakeback and add ticket collection

This commit is contained in:
Abhorrent_Anger 2025-06-03 10:15:47 +03:00
parent 3ddf4630d1
commit 4bcc17231d

View File

@ -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, () => {