From 91b22c31ec4a8b7ba27f12934c4e17ba0fee95f7 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Sun, 15 Jun 2025 14:04:24 +0300 Subject: [PATCH] Support higher level daily cases and level cases, close out the tab after opening --- SkinraveDailyCaseOpener.user.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/SkinraveDailyCaseOpener.user.js b/SkinraveDailyCaseOpener.user.js index f945809..0235dc0 100644 --- a/SkinraveDailyCaseOpener.user.js +++ b/SkinraveDailyCaseOpener.user.js @@ -1,12 +1,13 @@ // ==UserScript== // @name Skinrave Daily Case Opener // @namespace https://pube.tk -// @version 2025-06-03 +// @version 2025-06-15 // @description Opens daily cases // @author Abhorrent_Anger -// @match https://skinrave.gg/en/cs2/case-opening/daily-case +// @match https://skinrave.gg/en/cs2/case-opening/daily-* +// @match https://skinrave.gg/en/cs2/case-opening/*-reward // @icon https://www.google.com/s2/favicons?sz=64&domain=skinrave.gg -// @grant none +// @grant window.close // @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 @@ -15,16 +16,19 @@ const RECHECK_TIMER = 60000; const INITIAL_TIMER = 2000; const MAIN_WINDOW_SELECTOR = "div.flex.overflow-y-auto.overflow-x-hidden"; -const OPEN_BUTTON_SELECTOR = '#case-daily-case div[data-testid="case-opening-control-panel"] button:not(:disabled)'; +const OPEN_BUTTON_SELECTOR = 'div[data-testid="case-opening-control-panel"] button:not(:disabled)'; function openDailyCase() { let openButton = $(OPEN_BUTTON_SELECTOR); if (openButton.length == 0) { console.log('No daily cases to open'); - return false; } - openButton.click(); - console.log('Attempted to open a daily case'); + else { + openButton.click(); + console.log('Attempted to open a daily case'); + } + console.log('Attempting to close out the tab...'); + setTimeout(window.close, INITIAL_TIMER); } function runRoutines() {