From c13989ac843ddf15505c997f097f10e994751c95 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Fri, 8 Aug 2025 21:20:02 +0300 Subject: [PATCH] Initial commit --- EasySkinsCoinClaimer.user.js | 56 ++++++++++++++++++++++++++++++++++++ README.md | 12 +++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 EasySkinsCoinClaimer.user.js diff --git a/EasySkinsCoinClaimer.user.js b/EasySkinsCoinClaimer.user.js new file mode 100644 index 0000000..e10cc68 --- /dev/null +++ b/EasySkinsCoinClaimer.user.js @@ -0,0 +1,56 @@ +// ==UserScript== +// @name Easy Skins Coin Claimer +// @namespace https://pube.tk +// @version 2025-08-08 +// @description Claims free coins on the info page +// @author Abhorrent_Anger +// @match https://easyskins.com/info/* +// @icon https://www.google.com/s2/favicons?sz=64&domain=easyskins.com +// @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 INITIAL_TIMER = 2000; +const RECHECK_TIMER = 1000; +const RELOAD_TIMER = 30 * 60 * 1000; +const MAIN_WINDOW_SELECTOR = ".content"; +const REWARD_SIDEBAR_BUTTON_SELECTOR = '.menu-item__icon.free-coins'; +const REWARD_MODAL_SELECTOR = '.free-coins-modal'; +const FREE_COINS_BUTTON_ENABLED = 'button.button-get-daily-bonus:not(:disabled)'; +const FREE_COINS_BUTTON = 'button.button-get-daily-bonus'; + +function checkFreeCoins() { + $(REWARD_SIDEBAR_BUTTON_SELECTOR).click(); + $(FREE_COINS_BUTTON).click(); +} + +function getCooldown() { + let time = 0; + time += $(FREE_COINS_BUTTON + ' .seconds').text() * 1000; + time += $(FREE_COINS_BUTTON + ' .minutes').text() * 60 * 1000; + time += $(FREE_COINS_BUTTON + ' .hours').text() * 60 * 60 * 1000; + return time; +} + +function runRoutines() { + console.log('Checking for free coin claims'); + checkFreeCoins(); + setTimeout(recheck, RECHECK_TIMER); +} + +function recheck() { + let reload_timer = Math.max(RELOAD_TIMER, getCooldown()); + console.log('Sleeping for '+reload_timer+' seconds...'); + setTimeout(reload, reload_timer); +} + +function reload() { + console.log('Reloading...'); + location.reload(); +} + +waitForKeyElements(MAIN_WINDOW_SELECTOR, () => { + setTimeout(runRoutines, INITIAL_TIMER); +}); \ No newline at end of file diff --git a/README.md b/README.md index 35c810d..bef2118 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # EasySkinsCoinClaimer -Userscript for claiming free coins on the info page \ No newline at end of file +Userscript for claiming free coins on the info page. + +## Requirements +* [Violentmonkey](https://chromewebstore.google.com/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag) (Chrome) +* [Violentmonkey](https://addons.mozilla.org/en-US/firefox/addon/violentmonkey/) (Firefox) + +## Installation +1. Ensure that you have Violentmonkey or other userscript extension installed. +2. Download the script [`EasySkinsCoinClaimer.user.js`](EasySkinsCoinClaimer.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 [INFO](https://easyskins.com/info/) page. \ No newline at end of file