Created
May 26, 2026 08:32
-
-
Save Dan-Q/9a416677e33cae424fa135f1cbb2162c to your computer and use it in GitHub Desktop.
Userscript to automatically perform a daily check, upon visiting the Melonland Forum, for your daily Swap Credit Welfare and claims it it available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Melonland Swap Credit Collector | |
| // @namespace swap-credit-collector.melonland.me.danq | |
| // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFF0lEQVRYR+2Wa0yTVxiAn7YUFLxw80p07bwQx21CcCibl0RdNrNpGCRk6JwbuuGdH9Op0+gfIolblpmJIpM5SRwSo0w02czATM0GIlTuVFqpOBEpVKRFoLflfINOBQPiFrPE59fp957znuec837nq8zpdDp5jsheCPzvdkCUjN1ul6rGzc3tmavnqXZAdI2Ofh29XocYVVVVhZ+frys+FAYtIFY9ftw47jY3I3O0U1yqo6amlg0bkjCZTK5+j9ObXiaT9Tx5lEEJiC5iu4WE027mamkNNlsEZWXpJCcnY7F0uPo+jOjfe0yiLZfLeyL/MKCACKemprJlyxZw2igrv4XRqKau7g/Onk0hcPo09n35lat/L0ajkY3rVcS27mZlwS7ausxDE/Bwd6ezq6tn2/VUVITS3X2YCxcukZV1tN+kYrXbtyuJeSmRqHWHMZvNeHl5ueIP80QB8VitVqPTiYJzotFogHBKSn7EYKgk62gmfzY20dXdjUKhwOFwuM5ZSNddCkM1u4SpU6ei1Wp7svalXwHxaPHiNzl3Lg+lvJOrmhYqK1V0dPxE6t6NJCxfweTJkwgJCSUj4wi3bzewLyGU/Ku1LIrXQmMI0R/+TFllFQEBAa68/dFHQGyfu1IprcxN1kFxqZabNyMwGtPRanWMHTsOb+8R+PqOR61+F43me2YPq8DSfp+4vZnkbPuIqKQMDh46zOrVH7vyPok+AnFxcRQUFODp6cm2bduZMeMTqqtzuXz5JOXlZaxfvx4fH1+Cg6OprLjIodTtJMXM4UD+cX7YP4EprzYSovYnflEEs9/fQVRUlCt3f/QrMH16IIGBM4gIX0ZY2ChmvRbFpk3JtLW1smDBfNraptHUdI63XzZSlH+ZjqAsPK6tJHrzQSlHUVoikbNm4fT0YMpbu9HpdT3Z+94HfQQSEpazdGkMFouZuW/MJTBwCis+2EJk5GSGDx9OWFgCPt4GCouaCHpwnJmJadT9sgT1wjOoVGru3TPR+t5LyNauk/LdMT9g4vzNUlssLjs7W2r30kdAoJDLsdntaLV3OXbsCPHxazGZyvHxCUEmcyKXd9PY2IxOF0JtrSeTPZaBtVsau2rDKkY23+rJBFarldHzNvOgy0psbCw5OTmumKBfAZvNxhh/f1pNJm7o9Vg6xmC1jsR7tB67Q0l7+yS6un5HockkekOmNKYwLVEq4PCICOlusNtsuCmVQxMQdHZ2cv16HcHBQdTUtKBUWmhvD0CpdBD0ih1391FMmDgRg6GehoabhIWG0m62cCZ1BQ6bTcqxcF6U1PZb+NnTCwhESLyS3VYren09bW0qwmc6wGEBxSiw30dX30JJSQVXrlwkNzeXmpoa13il+H44HK7fTy0gENuakpLCzp07pQmdyJEpRuB0ONDfMGAyqcnL28OePbsfuQ0Fvan9/fyk4xRFeOLEiZ7o3wwoIKiuruXib/msXvMpMpzgtHK3+R5l5e2Ul5+lXn+dr7/Z3+cVGwyDEkhPz8DdXUly8mZajQ3cqG+i8c5oTp9O5cCBbzGbLUOaXDCggDiCJUveISZmKVu3fk7ZtRKMLSqKizNJSlojVflQJxcMKOCmUHAo/TsiI8PpsEykVPMrzc21FBYWkZd35pkmFwwo4OU5jDN55/D2XoBKdY9du3aSlpYm3RXPOrlgQAFR2Tt2fMGcObMxGCycP5/NqVMn+/0jMhQGFBA83uXfWHkvgxL4L3kh8Nx34C/YJ7u/K+7vAQAAAABJRU5ErkJggg== | |
| // @version 1.0.0 | |
| // | |
| // @match https://forum.melonland.net/* | |
| // @grant none | |
| // | |
| // @author Dan Q | |
| // @description Don't forget to collect your Swap Credit Welfare! Automatically attempts to collect it on your first visit to the Melonland Forum on any given day. Tells you via popup the result! | |
| // ==/UserScript== | |
| (()=>{ | |
| const today = (new Date()).toISOString().substr(0,10); | |
| if(today == localStorage.getItem('ml-swap-credit-collected-on')) return; | |
| localStorage.setItem('ml-swap-credit-collected-on', today); | |
| fetch('https://forum.melonland.net/index.php?action=artifact', {}, {credentials: 'include'}).then(r=>r.text()).then(html=>{ | |
| const parser = new DOMParser(); | |
| const doc = parser.parseFromString(html, 'text/html'); | |
| const wheel = doc.getElementById('wheel'); | |
| if(!wheel) return; | |
| const script = wheel.parentElement.querySelector('script'); | |
| if(!script) return; | |
| const js = script.innerText; | |
| const button = document.createElement('button'); | |
| button.id = 'wheel_button'; | |
| button.innerText = '_'; | |
| button.style.display = 'none'; | |
| document.body.appendChild(button); | |
| eval(js); | |
| button.click(); | |
| function checkResult(){ | |
| if(button.innerText == '_') { | |
| setTimeout(checkResult, 200); | |
| return; | |
| } | |
| alert(`Swap Credit Welfare Collector says: ` + button.innerText); | |
| } | |
| setTimeout(checkResult, 200); | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment