Fix rakeback and add ticket collection
This commit is contained in:
parent
3ddf4630d1
commit
4bcc17231d
@ -2,7 +2,7 @@
|
|||||||
// @name Skinrave Rakeback Collector
|
// @name Skinrave Rakeback Collector
|
||||||
// @namespace https://pube.tk
|
// @namespace https://pube.tk
|
||||||
// @version 2025-06-03
|
// @version 2025-06-03
|
||||||
// @description Claims rakebacks
|
// @description Claims rewards
|
||||||
// @author Abhorrent_Anger
|
// @author Abhorrent_Anger
|
||||||
// @match https://skinrave.gg/en/rewards
|
// @match https://skinrave.gg/en/rewards
|
||||||
// @icon https://www.google.com/s2/favicons?sz=64&domain=skinrave.gg
|
// @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 INITIAL_TIMER = 2000;
|
||||||
const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden";
|
const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden";
|
||||||
const RAKEBACK_AMOUNT_SELECTOR = 'div[data-testid="rakeback-amount"]';
|
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';
|
const EMPTY_CLAIM = 'Claim 0.00 T';
|
||||||
|
|
||||||
function runRoutines() {
|
function runRoutines() {
|
||||||
|
collectRakeback();
|
||||||
|
collectTickets();
|
||||||
|
setTimeout(runRoutines, RECHECK_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
|
function collectRakeback() {
|
||||||
$(RAKEBACK_AMOUNT_SELECTOR).each(function () {
|
$(RAKEBACK_AMOUNT_SELECTOR).each(function () {
|
||||||
let button = $(this).parent().children('button').eq(0);
|
let button = $(this).parent().children('button').eq(0);
|
||||||
if (button.text() == EMPTY_CLAIM) {
|
if (button.text() == EMPTY_CLAIM) {
|
||||||
@ -28,7 +35,16 @@ function runRoutines() {
|
|||||||
button.click();
|
button.click();
|
||||||
console.log('Attempted to claim a rakeback');
|
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, () => {
|
waitForKeyElements(MAIN_WINDOW_SELECTOR, () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user