forked from bribes/FaavJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsmc@v1.5.min.js
6 lines (6 loc) · 11 KB
/
jsmc@v1.5.min.js
1
2
3
4
5
6
/* WARNING */
/* THIS IS A OUTDATED VERSION OF JSMC */
/* copyright (c) Faav 2021 */
/* JSMC v1.5 / MIT License / https://github.com/withdrew/jsmc */
console.warn("This site is running on a outdated version of JSMC!");
function getLevel(e){const s=[1e5,15e4,25e4,5e5,75e4,1e6,125e4,15e5,2e6,25e5,25e5,25e5,25e5,25e5,3e6];let r=0;for(let a=0;a<=1e3;a+=1){let l=0;if(e-(l=a>=s.length?s[s.length-1]:s[a])<0)return Math.round(100*(r+e/l))/100;r+=1,e-=l}return 1e3}function getSkyLevel(e){var s=[0,20,70,150,250,500,1e3,2e3,3500,6e3,1e4,15e3];let r=0;if(e>=15e3)r=(e-15e3)/1e4+12;else for(i=0;i<s.length;i++)if(e<s[i]){r=i+(e-s[i-1])/(s[i]-s[i-1]);break}return r}function roundNumber(e,s){return Math.round(e*Math.pow(10,s))/Math.pow(10,s)}async function jsmc(e){await fetch("https://api.gapple.pw/blocked/"+e).then(e=>e.json()).then(s=>{player=new Object({}),player.status=s.status,"blocked"==player.status&&!1===/^[a-zA-Z0-9_]{3,16}$/.test(e)&&(player.status="invalid"),fetch("https://api.gapple.pw/status/"+e).then(e=>e.json()).then(s=>{player.type=s.status,fetch("https://playerdb.co/api/player/minecraft/"+e).then(e=>e.json()).then(e=>{player.error=!1,player.username=e.data.player.username,player.uuid=e.data.player.id,player.id=e.data.player.raw_id,player.name_history=e.data.player.meta.name_history,player.icon=`https://crafatar.com/avatars/${player.id}?overlay`,player.avatar=`https://crafatar.com/renders/body/${player.id}?overlay`,player.head=`https://crafatar.com/renders/head/${player.id}?overlay`,player.skin=`https://crafatar.com/skins/${player.id}`,player.cosmetics=new Object({}),player.cosmetics.cape=new Object({}),player.cosmetics.cape.official=`https://crafatar.com/capes/${player.id}`,player.cosmetics.cape.optifine=`https://api.gapple.pw/cors/optifine/${player.username}`,player.cosmetics.cape.labymod=`https://api.gapple.pw/cors/labymod/cape/${player.id}`,player.cosmetics.bandana=new Object({}),player.cosmetics.bandana.labymod=`https://api.gapple.pw/cors/labymod/bandana/${player.id}`,player.servers=new Object({}),fetch("https://api.hypixel.net/player?key=63f20355-92d7-42d7-a2a5-6457160aa4eb&uuid="+player.id).then(e=>e.json()).then(e=>{player.servers.hypixel=new Object({}),player.servers.hypixel.success=e.success,null!==e.player&&(player.servers.hypixel.rank=e.player.rank,player.servers.hypixel.newPackageRank=e.player.newPackageRank,player.servers.hypixel.monthlyPackageRank=e.player.monthlyPackageRank,player.servers.hypixel.firstLogin=e.player.firstLogin,player.servers.hypixel.lastLogin=e.player.lastLogin,player.servers.hypixel.lastLogout=e.player.lastLogout,player.servers.hypixel.networkExp=e.player.networkExp,player.servers.hypixel.networkLevel=roundNumber(Math.sqrt(2*player.servers.hypixel.networkExp+30625)/50-2.5,2),player.servers.hypixel.karma=e.player.karma,player.servers.hypixel.skywars=new Object({}),player.servers.hypixel.skywars.games_played=e.player.stats.SkyWars.games_played_skywars,player.servers.hypixel.skywars.exp=e.player.stats.SkyWars.skywars_experience),player.servers.hypixel.skywars.level=roundNumber(getSkyLevel(player.servers.hypixel.skywars.exp),2),player.servers.hypixel.skywars.levelFormatted=e.player.stats.SkyWars.levelFormatted,player.servers.hypixel.skywars.win_streak=e.player.stats.SkyWars.win_streak,player.servers.hypixel.skywars.wins=e.player.stats.SkyWars.wins,player.servers.hypixel.skywars.losses=e.player.stats.SkyWars.losses,player.servers.hypixel.skywars.kills=e.player.stats.SkyWars.kills,player.servers.hypixel.skywars.deaths=e.player.stats.SkyWars.deaths,player.servers.hypixel.skywars.assists=e.player.stats.SkyWars.assists,player.servers.hypixel.skywars.kd=roundNumber(player.servers.hypixel.skywars.kills/player.servers.hypixel.skywars.deaths,2),player.servers.hypixel.skywars.wl=roundNumber(player.servers.hypixel.skywars.wins/player.servers.hypixel.skywars.losses,2),player.servers.hypixel.skywars.coins=e.player.stats.SkyWars.coins,player.servers.hypixel.skywars.time_played=e.player.stats.SkyWars.time_played,player.servers.hypixel.skywars.souls=e.player.stats.SkyWars.souls,player.servers.hypixel.skywars.quits=e.player.stats.SkyWars.quits,player.servers.hypixel.skywars.solo=new Object({}),player.servers.hypixel.skywars.solo.games_played=e.player.stats.SkyWars.games_solo,player.servers.hypixel.skywars.solo.wins=e.player.stats.SkyWars.wins_solo,player.servers.hypixel.skywars.solo.losses=e.player.stats.SkyWars.losses_solo,player.servers.hypixel.skywars.solo.kills=e.player.stats.SkyWars.kills_solo,player.servers.hypixel.skywars.solo.deaths=e.player.stats.SkyWars.deaths_solo,player.servers.hypixel.skywars.solo.time_played=e.player.stats.SkyWars.time_played_solo,player.servers.hypixel.skywars.solo.kd=roundNumber(player.servers.hypixel.skywars.solo.kills/player.servers.hypixel.skywars.solo.deaths,2),player.servers.hypixel.skywars.solo.wl=roundNumber(player.servers.hypixel.skywars.solo.wins/player.servers.hypixel.skywars.solo.losses,2),player.servers.hypixel.skywars.solo.normal=new Object({}),player.servers.hypixel.skywars.solo.normal.wins=e.player.stats.SkyWars.wins_solo_normal,player.servers.hypixel.skywars.solo.normal.losses=e.player.stats.SkyWars.losses_solo_normal,player.servers.hypixel.skywars.solo.normal.games_played=player.servers.hypixel.skywars.solo.normal.wins+player.servers.hypixel.skywars.solo.normal.losses,player.servers.hypixel.skywars.solo.normal.kills=e.player.stats.SkyWars.kills_solo_normal,player.servers.hypixel.skywars.solo.normal.deaths=e.player.stats.SkyWars.deaths_solo_normal,player.servers.hypixel.skywars.solo.normal.kd=roundNumber(player.servers.hypixel.skywars.solo.normal.kills/player.servers.hypixel.skywars.solo.normal.deaths,2),player.servers.hypixel.skywars.solo.normal.wl=roundNumber(player.servers.hypixel.skywars.solo.normal.wins/player.servers.hypixel.skywars.solo.normal.losses,2),player.servers.hypixel.skywars.solo.insane=new Object({}),player.servers.hypixel.skywars.solo.insane.wins=e.player.stats.SkyWars.wins_solo_insane,player.servers.hypixel.skywars.solo.insane.losses=e.player.stats.SkyWars.losses_solo_insane,player.servers.hypixel.skywars.solo.insane.games_played=player.servers.hypixel.skywars.solo.insane.wins+player.servers.hypixel.skywars.solo.insane.losses,player.servers.hypixel.skywars.solo.insane.kills=e.player.stats.SkyWars.kills_solo_insane,player.servers.hypixel.skywars.solo.insane.deaths=e.player.stats.SkyWars.deaths_solo_insane,player.servers.hypixel.skywars.solo.insane.kd=roundNumber(player.servers.hypixel.skywars.solo.insane.kills/player.servers.hypixel.skywars.solo.insane.deaths,2),player.servers.hypixel.skywars.solo.insane.wl=roundNumber(player.servers.hypixel.skywars.solo.insane.wins/player.servers.hypixel.skywars.solo.insane.losses,2),player.servers.hypixel.skywars.doubles=new Object({}),player.servers.hypixel.skywars.doubles.games_played=e.player.stats.SkyWars.games_team,player.servers.hypixel.skywars.doubles.wins=e.player.stats.SkyWars.wins_team,player.servers.hypixel.skywars.doubles.losses=e.player.stats.SkyWars.losses_team,player.servers.hypixel.skywars.doubles.kills=e.player.stats.SkyWars.kills_team,player.servers.hypixel.skywars.doubles.deaths=e.player.stats.SkyWars.deaths_team,player.servers.hypixel.skywars.doubles.time_played=e.player.stats.SkyWars.time_played_team,player.servers.hypixel.skywars.doubles.kd=roundNumber(player.servers.hypixel.skywars.doubles.kills/player.servers.hypixel.skywars.doubles.deaths,2),player.servers.hypixel.skywars.doubles.wl=roundNumber(player.servers.hypixel.skywars.doubles.wins/player.servers.hypixel.skywars.doubles.losses,2),player.servers.hypixel.skywars.doubles.normal=new Object({}),player.servers.hypixel.skywars.doubles.normal.wins=e.player.stats.SkyWars.wins_team_normal,player.servers.hypixel.skywars.doubles.normal.losses=e.player.stats.SkyWars.losses_team_normal,player.servers.hypixel.skywars.doubles.normal.games_played=player.servers.hypixel.skywars.doubles.normal.wins+player.servers.hypixel.skywars.doubles.normal.losses,player.servers.hypixel.skywars.doubles.normal.kills=e.player.stats.SkyWars.kills_team_normal,player.servers.hypixel.skywars.doubles.normal.deaths=e.player.stats.SkyWars.deaths_team_normal,player.servers.hypixel.skywars.doubles.normal.kd=roundNumber(player.servers.hypixel.skywars.doubles.normal.kills/player.servers.hypixel.skywars.doubles.normal.deaths,2),player.servers.hypixel.skywars.doubles.normal.wl=roundNumber(player.servers.hypixel.skywars.doubles.normal.wins/player.servers.hypixel.skywars.doubles.normal.losses,2),player.servers.hypixel.skywars.doubles.insane=new Object({}),player.servers.hypixel.skywars.doubles.insane.wins=e.player.stats.SkyWars.wins_team_insane,player.servers.hypixel.skywars.doubles.insane.losses=e.player.stats.SkyWars.losses_team_insane,player.servers.hypixel.skywars.doubles.insane.games_played=player.servers.hypixel.skywars.doubles.insane.wins+player.servers.hypixel.skywars.doubles.insane.losses,player.servers.hypixel.skywars.doubles.insane.kills=e.player.stats.SkyWars.kills_team_insane,player.servers.hypixel.skywars.doubles.insane.deaths=e.player.stats.SkyWars.deaths_team_insane,player.servers.hypixel.skywars.doubles.insane.kd=roundNumber(player.servers.hypixel.skywars.doubles.insane.kills/player.servers.hypixel.skywars.doubles.insane.deaths,2),player.servers.hypixel.skywars.doubles.insane.wl=roundNumber(player.servers.hypixel.skywars.doubles.insane.wins/player.servers.hypixel.skywars.doubles.insane.losses,2),fetch("https://api.hypixel.net/status?key=63f20355-92d7-42d7-a2a5-6457160aa4eb&uuid="+player.id).then(e=>e.json()).then(e=>{player.servers.hypixel.online=e.session.online}),fetch("https://api.hypixel.net/guild?key=63f20355-92d7-42d7-a2a5-6457160aa4eb&player="+player.id).then(e=>e.json()).then(e=>{player.servers.hypixel.guild=new Object({}),player.servers.hypixel.guild.success=e.success,null!==e.guild&&(player.servers.hypixel.guild.id=e.guild._id,player.servers.hypixel.guild.name=e.guild.name,player.servers.hypixel.guild.createdAt=e.guild.created,player.servers.hypixel.guild.members=e.guild.members,player.servers.hypixel.guild.ranks=e.guild.ranks,player.servers.hypixel.guild.exp=e.guild.exp,player.servers.hypixel.guild.level=roundNumber(getLevel(player.servers.hypixel.guild.exp),0),player.servers.hypixel.guild.tag=e.guild.tag,player.servers.hypixel.guild.tagColor=e.guild.tagColor,player.servers.hypixel.guild.coins=e.guild.coins,player.servers.hypixel.guild.coinsEver=e.guild.coinsEver,player.servers.hypixel.guild.expByGameType=e.guild.guildExpByGameType),player.servers.hypixel.friends=new Object({}),fetch("https://api.hypixel.net/friends?key=63f20355-92d7-42d7-a2a5-6457160aa4eb&uuid="+player.id).then(e=>e.json()).then(e=>{for(var s="",r="",a=0;a<e.records.length;a++)e.records[a].uuidSender!==e.uuid&&(s+=e.records[a].uuidSender+","),e.records[a].uuidReceiver!==e.uuid&&(s+=e.records[a].uuidReceiver+","),r+=e.records[a].started+",";for(var l=s.slice(0,-1).split(","),y=[],p=l.length-1;p>=0;p--)y.push(l[p]);var i=r.slice(0,-1).split(","),o=[];for(p=i.length-1;p>=0;p--)o.push(i[p]);player.servers.hypixel.friends.uuid=JSON.parse(JSON.stringify(y)),player.servers.hypixel.friends.timestamp=JSON.parse(JSON.stringify(o))}),code()})}).catch(e=>player.error=!0)})})})}