commit 2ed51f9fdc6b61fbf6bd4e0aaa3b2e0f38457d31 Author: Abhorrent_Anger Date: Thu Jan 30 19:45:04 2025 +0200 Initial commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7a3094a --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. + +DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2cfafaa --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# SkinraveRewardTicketHandler + +## Requirements +* [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) (Chrome) +* [Greasemonkey](https://addons.mozilla.org/en-us/firefox/addon/greasemonkey/) (Firefox) + +## Installation +1. Ensure that you have either Tampermonkey or Greasemonkey installed. +2. Download the script [`SkinraveRewardTicketHandler.user.js`](SkinraveRewardTicketHandler.user.js?raw=true). +3. Confirm that you want to install the script. +4. The script should now be installed and ready to use. Open the [Reward Ticket](https://skinrave.gg/en/reward-tickets) page. \ No newline at end of file diff --git a/SkinraveRewardTicketHandler.user.js b/SkinraveRewardTicketHandler.user.js new file mode 100644 index 0000000..301a84c --- /dev/null +++ b/SkinraveRewardTicketHandler.user.js @@ -0,0 +1,45 @@ +// ==UserScript== +// @name Skinrave Reward Ticket Handler +// @namespace http://tampermonkey.net/ +// @version 2025-01-29 +// @description Claims tickets and tries to join minutely roulettes with the minimum bet +// @author Abhorrent_Anger +// @match https://skinrave.gg/en/reward-tickets +// @icon https://www.google.com/s2/favicons?sz=64&domain=skinrave.gg +// @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 REJOIN_TIMER = 70000; +const INITIAL_TIMER = 2000; +const CLAIM_BUTTON_SELECTOR = "div.flex.justify-end.items-center.gap-2.h-full button:not(:disabled)"; +const TICKET_BALANCE_SELECTOR = "div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > span:nth-child(2) > span:nth-child(1)"; +const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden"; +const MIN_SELECTOR = "body > div.flex.overflow-y-auto.overflow-x-hidden > div.w-full.flex > div.w-full.max-w-full > main > main > div button:nth-child(8)"; +const JOIN_GAME_SELECTOR = "body > div.flex.overflow-y-auto.overflow-x-hidden > div.w-full.flex > div.w-full.max-w-full > main > main > div button.max-w-full:not(:disabled)"; +const MINUTE_SELECTOR = "body > div:contains('minute')"; + +function clickClaimButton() { + $(CLAIM_BUTTON_SELECTOR).click(); +} + +function clickJoinButton() { + if ($(TICKET_BALANCE_SELECTOR).text() == '0.00' || $(MINUTE_SELECTOR).length == 0) { + return false; + } + $(MIN_SELECTOR).click(); + $(JOIN_GAME_SELECTOR).click(); + console.log('Attempted to Join the Game'); +} + +function runRoutines() { + clickClaimButton(); + clickJoinButton(); + setTimeout(runRoutines, REJOIN_TIMER); +} + +waitForKeyElements(MAIN_WINDOW_SELECTOR, () => { + setTimeout(runRoutines, INITIAL_TIMER); +});