Skip to content

Instantly share code, notes, and snippets.

@douxxtech
Created July 7, 2025 16:43
Show Gist options
  • Select an option

  • Save douxxtech/2266d231e93ee48703ff4ad3ea0f4dc7 to your computer and use it in GitHub Desktop.

Select an option

Save douxxtech/2266d231e93ee48703ff4ad3ea0f4dc7 to your computer and use it in GitHub Desktop.
Simple script to "farm" noskid.today's achievements to get a high-score certificate

Achievements unlocker for NoSkid

NoSkid recently added in an update NoSkid Achievements that allows to increment by a lot your score on noskid certiifcates. image

But there is an issue: Those achievemnts are a pain to complete, so i made a simple script to unlock them all!

Warning

This script actually takes 2 HOURS to complete, cuz an achievement is obteined by having noskid opened for 2 hours.

Simply paste this script in your webtools console, and let it run.

class AchievementUnlocker{constructor(){this.baseUrl="https://noskid.today/api/achievement/",this.userId=null,this.achievements=[],this.concurrentLimit=10,this.activeRequests=0,this.completedCount=0,this.failedCount=0,this.queue=[],this.startTime=new Date}async run(){this.logGlobal("Starting Achievement Unlocker..."),this.logGlobal("Fetching achievements...");try{var e=await(await this.fetchWithRetry(this.baseUrl+"?action=get")).json();if(!e.status)throw new Error(e.message||"Failed to fetch achievements");this.userId=e.data.userId,this.achievements=e.data.achievements,this.logGlobal(`Found ${this.achievements.length} achievements`),this.logGlobal("User ID: "+this.userId),this.queue=[...this.achievements],await this.processQueue(),this.injectUser(),this.logGlobal("All achievements processed!"),this.logGlobal(`Completed: ${this.completedCount}, Failed: `+this.failedCount),this.logGlobal(`Total time: ${((new Date-this.startTime)/1e3).toFixed(2)}s`)}catch(e){this.logGlobal("Error in main process: "+e.message,!0)}}async fetchWithRetry(t,i=3,s=1e3){try{return await fetch(t,{credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json"}})}catch(e){if(0<i)return this.logGlobal(`Retrying (${i} left)...`,!1,"#FFC107"),await new Promise(e=>setTimeout(e,s)),this.fetchWithRetry(t,i-1,2*s);throw e}}async processQueue(){for(;0<this.queue.length||0<this.activeRequests;)if(0<this.queue.length&&this.activeRequests<this.concurrentLimit){let t=this.queue.shift();this.activeRequests++,this.processAchievement(t).catch(e=>{this.log(t.name,"Error: "+e.message,!0)}).finally(()=>this.activeRequests--)}else await new Promise(e=>setTimeout(e,100))}async processAchievement(t){var{name:t,percent:e,description:i}=t;this.log(t,`Processing (${e}%) - `+i,!1,"#795548");try{var s=await this.tryMarkDone(t);s.success?(this.log(t,"✅ Success",!1,"#4CAF50"),this.completedCount++):s.requiresTiming?(this.log(t,`[W] Requires ${s.timeRequired}s, starting...`,!1,"#FFC107"),await this.handleTimedAchievement(t,s.timeRequired)?(this.completedCount++,this.log(t,"✅ Completed with timer",!1,"#4CAF50")):(this.failedCount++,this.log(t,"❌ Timed achievement failed",!0))):(this.log(t,"❌ Failed to complete",!0),this.failedCount++)}catch(e){this.failedCount++,this.log(t,"Exception: "+e.message,!0)}}async tryMarkDone(t){try{var e=`${this.baseUrl}?action=done&id=${this.userId}&name=`+encodeURIComponent(t),i=await(await this.fetchWithRetry(e)).json();if(i.status)return{success:!0};if(i.message&&i.message.includes("time validation failed")){var s=i.message.match(/Minimum time: (\d+) seconds/);if(s)return{success:!1,requiresTiming:!0,timeRequired:parseInt(s[1])}}return{success:!1,requiresTiming:!1}}catch(e){return this.log(t,"Error in tryMarkDone: "+e.message,!0),{success:!1,requiresTiming:!1}}}async handleTimedAchievement(t,i){try{var e=`${this.baseUrl}?action=start&id=${this.userId}&name=`+encodeURIComponent(t),s=await(await this.fetchWithRetry(e)).json();if(!s.status)throw new Error(s.message||"Failed to start achievement");for(let e=i;0<=e;e--)this.log(t,`Waiting ${e}s...`),await new Promise(e=>setTimeout(e,1e3));return await new Promise(e=>setTimeout(e,1e3)),(await this.tryMarkDone(t)).success}catch(e){return this.log(t,"handleTimedAchievement error: "+e.message,!0),!1}}injectUser(){try{localStorage.setItem("achievementsUser",this.userId),this.logGlobal("Injected user ID into localStorage: "+this.userId,!1,"#9C27B0")}catch(e){this.logGlobal("Error injecting user ID",!0)}}log(e,t,i=!1,s=i?"#F44336":"#2196F3"){var a=(new Date).toTimeString().split(" ")[0];console.log(`%c[${e}] - ${a} | `+t,`color: ${s}; font-weight: `+(i?"bold":"normal"))}logGlobal(e,t=!1,i=t?"#F44336":"#607D8B"){var s=(new Date).toTimeString().split(" ")[0];console.log(`%c[GLOBAL] - ${s} | `+e,`color: ${i}; font-weight: `+(t?"bold":"normal"))}}console.log("%cInitializing Achievement Unlocker...","color: #4CAF50; font-weight: bold");let unlocker=new AchievementUnlocker;unlocker.run().catch(e=>console.error(e));

smack smack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment