diff --git a/EasyMod.js b/EasyMod.js index aaf1622..407a89b 100644 --- a/EasyMod.js +++ b/EasyMod.js @@ -1,8 +1,8 @@ /* This is EasyMod.js By BonesYT (start: 19:48 03/01/2022 DD/MM/YYYY) (release: 11:58 04/01/2022 DD/MM/YYYY) - (update: 11:28 02/02/2022 DD/MM/YYYY) <-- edit this as well when modding - Last modded by: (no one) + (update: 17:04 04/02/2022 DD/MM/YYYY) <-- edit this as well when modding + Last modded by: BinaryCrown EasyMod.js basically adds functions to strings, numbers, etc. Please don't copy! @@ -27,7 +27,7 @@ var EasyObj = { modders: [ // All people that modified/forked this "BinaryCrown" ], - lastBy: "BonesYT", // Last edited by + lastBy: "BinaryCrown", // Last edited by a: { // All adds proto: {}, // Added prototype functions lists static: {}, // Added static values lists @@ -47,26 +47,31 @@ var EasyObj = { isDefined: (n)=>{ return this[n] !== undefined }, + ifnDef: (n,e,p)=>{ + if (this[n] === undefined) {return null;} + e(...p); + }, get: (n)=>{ return this[n] }, + switchGet: (n,v,e,p)=>{ + for (let j = 0; j < v.length; j++) { + if (this[n] === v[j]) {e(...p[j])} + } + }, createMethod: (target, name, func)=>{ //f(Number, 'test', ()=>{//code here}) - var a = target - if (typeof a != 'function') a = this[target] + let a = (typeof target !== 'function') ? this[target] : target a.prototype[name] = func }, - isConst(varname) { // - var zzzz + isConst(varname) { try { eval(varname.toString()) try { - eval(`zzzz = ${varname}`) - eval(`${varname} = 'Replaced'`) - eval(`${varname} = zzzz`) - return false + eval(`${varname} = _`) } catch { return true } + return false } catch { throw ReferenceError('[EasyMod.js] 0: ' + varname + ' is not defined') } @@ -74,7 +79,7 @@ var EasyObj = { protoOf: (type)=>{ this[type].prototype }, - waitUntil(u=()=>{}, f=()=>{}, delay=10) { //wait until u returns true then run f. + waitUntil(u=()=>{}, f=()=>{}, delay=10) { // wait until u returns true then run f. var a = 0, i, b = ()=>{ if (u(a)) { @@ -2707,4 +2712,4 @@ delete config // not really necessary lol Object.prototype.type = 'object' Symbol.prototype.type = 'symbol' -})() // 70.4% from 2k to 3k! (if modding update this lol) \ No newline at end of file +})() // 70.4% from 2k to 3k! (if modding update this lol) diff --git a/EasyMod.min.js b/EasyMod.min.js index 127cfe0..f78329b 100644 --- a/EasyMod.min.js +++ b/EasyMod.min.js @@ -1,2 +1,2 @@ /*Uglified by https://www.uglifyjs.net/*/ -var config={keycompress:false,isNode:false,allowsetint:true};var EasyObj={info:{version:"8",createdBy:"BonesYT",modders:["BinaryCrown"],lastBy:"BonesYT",a:{proto:{},"static":{},changed:["Number","Boolean","String","BigInt","Function","Array","Object","Date","ImageData","Math"],totalAdds:undefined},from:"https://github.com/BonesYT/EasyMod.js",issues:"https://github.com/BonesYT/EasyMod.js/issues",isMin:true},define:(t,e)=>{this[t]=e},undefine:t=>{delete this[t]},isDefined:t=>{return this[t]!==undefined},get:t=>{return this[t]},createMethod:(t,e,r)=>{var n=t;if(typeof n!="function")n=this[t];n.prototype[e]=r},isConst(varname){var zzzz;try{eval(varname.toString());try{eval(`zzzz = ${varname}`);eval(`${varname} = 'Replaced'`);eval(`${varname} = zzzz`);return false}catch{return true}}catch{throw ReferenceError("[EasyMod.js] 0: "+varname+" is not defined")}},protoOf:t=>{this[t].prototype},waitUntil(t=()=>{},e=()=>{},r=10){var n=0,i,s=()=>{if(t(n)){e(n);clearInterval(i)}n++},i=setInterval(s,r)},repeatUntil(t=()=>{},e=()=>{},r=()=>{},n=10){var i=0;while(!t(i)){e(i)}r()},key:{id:{code:{},key:{},num:{},any:false},press:t=>{if(t=="any"|t==-1)return EasyObj.key.id.any;return EasyObj.key.id.code[t]|EasyObj.key.id.key[t]|EasyObj.key.id.num[t]},compressed:config.keycompress},mouse:{ldown:false,mdown:false,rdown:false,down:false,sdown:false,scr:0,scrs:0},addEL(t,e,...r){var n=[t,e];n.push.apply(n,r);document.addEventListener.apply(document,n)},setDef(...t){return t.reduce((t,e)=>{return t==undefined?e:t},undefined)},stc:{abseq:(t,e)=>{if(typeof t==typeof e){switch(typeof t){case"number":return t==e;break;case"string":return t==e;break;case"boolean":return t==e;break;case"bigint":return t==e;break;case"undefined":return true;break;case"object":return t.stringify()==e.stringify();break;case"function":return t.toString()==e.toString();break;case"symbol":return t.toString()==e.toString();break}}else{return false}},gt(t,e){return typeof t==typeof e?t>e:false},gte(t,e){return typeof t==typeof e?t>=e:false},lt(t,e){return typeof t==typeof e?t{}){if(t.localName!="button")throw TypeError("[EasyMod.js] Element tag is not button");if(!(typeof e=="function"))throw TypeError("[EasyMod.js] onclick needs to be an function");t.addEventListener("click",e)},setGetElementById(t="$"){this[t]=function(t){return document.getElementById(t)}},canv:{canvasMsePos(t,e){if(t.localName!="canvas")throw TypeError("[EasyMod.js] Element tag is not canvas");if(!typeof e=="object")throw TypeError("[EasyMod.js] Target needs to be an object");e.mouse={m:{x:0,y:0},l:{x:0,y:0}};t.addEventListener("mousemove",t=>{e.mouse.m.x=t.offsetX,e.mouse.m.y=t.offsetY});t.addEventListener("mousedown",t=>{e.mouse.l.x=t.offsetX,e.mouse.l.y=t.offsetY})},progbar(t,e=0,r=4,n=4,i=128,s=32,a=4,o="#ffffff",u="#999999",h="#444444",f=0){if(t.localName!="canvas")throw TypeError("[EasyMod.js] Element tag is not canvas");var c=t.getContext("2d");c.fillStyle=h;c.fillRect(r-a,n-a,i+a*2,s+a*2);c.fillStyle=u;c.fillRect(r,n,i,s);c.fillStyle=o;switch(f){case 0:c.fillRect(r,n,i*e,s);break;case 1:c.fillRect(r,n,i,s*e);break;case 2:c.fillRect(r+i*(1-e),n,i*e,s);break;case 3:c.fillRect(r,n+s*(1-e),i,s*e);break}},rect(t,e=0,r=0,n=128,i=128,s="#000000",a=0,o="#222222"){if(t.localName!="canvas")throw TypeError("[EasyMod.js] Element tag is not canvas");var u=t.getContext("2d");u.fillStyle=s;u.strokeStyle=o;u.lineWidth=a;u.fillRect(e,r,n,i);if(a)u.strokeRect(e,r,n,i)},circle(t,e=0,r=0,n=16,i="#000000",s=0,a="#222222"){if(t.localName!="canvas")throw TypeError("[EasyMod.js] Element tag is not canvas");var o=t.getContext("2d");o.fillStyle=i;o.strokeStyle=a;o.lineWidth=s;o.beginPath();o.arc(e,r,n,0,Math.PI*2);o.fill();if(s)o.stroke();o.closePath()}},effect(t,e=1,r=document.querySelector("html")){r.style.filter=`${t}(${e})`},setinner(t,e){if(!(typeof t=="object"&t.toString().includes("HTML")))throw TypeError("[EasyMod.js] Target has to be an HTML element");t.innerHTML=e}},eval(t,e=true){return new Function("thisObj",(e?"return ":"")+t)(this)},playaudio(t,e=1,r=1,n=()=>{}){var i=new Audio(t);i.volume=e;i.playbackRate=r;i.onload=n;i.play()},set:{"var"(t,e,r){r[t]=e},"const"(t,e,r){Object.defineProperty(r,t,{value:e,writable:false,enumerable:true,configurable:true})}},time:0,toReadme:{part(t){return`# ${t}\n${EasyObj.info.a.proto[t].length==0?"":"* "+EasyObj.info.a.proto[t].sort().join(", ")+"\n"}${EasyObj.info.a["static"][t].length==0?"":"* static: "+EasyObj.info.a["static"][t].sort().join(", ")+"\n"}`},full(){var r="# Extra Methods and statics\n",n=EasyObj.toReadme.part;EasyObj.info.a.proto.forEach((t,e)=>{r+=n(e)});r+="\n"+EasyObj.toReadme.easyobj();return r},easyobj(){return`# EasyObj\n* EasyObj is an object with abilities.\n* ${Object.keys(EasyObj).join(", ")}`}},aver(...t){return t.sum()/t.length},clipb:{info:"",allow:false},type(t,...e){switch(t){case"number":return Number(e[0]);case"boolean":return Boolean(e[0]);case"string":return String(e[0]);case"bigint":return BigInt(e[0]);case"object":return Object(e[0]);case"symbol":return Symbol(e[0]);case"function":return Function.apply(null,e);case"array":return Array.apply(null,e);case"undefined":return undefined}},errors:["Error","RangeError","ReferenceError","SyntaxErrror","TypeError","URIError","EvalError"],prt:{s:["{","[","(",'"',"'","`"],e:["}","]",")",'"',"'","`"]},random:undefined,isNode:config.isNode,setint:config.allowsetint};delete config;(function(){var add=EasyObj.info.a;function AddObj(t,e={},r={},n){EasyObj.info.a.proto[n]=Object.keys(e);EasyObj.info.a["static"][n]=Object.keys(r);if(t.prototype)Object.assign(t.prototype,e);Object.assign(t,r)}add.changed.forEach(t=>{add.proto[t]=[];add["static"][t]=[]});var P={};var S={};P.add=function(t){return this+t};P.sub=function(t){return this-t};P.inc=function(){return this+1};P.dec=function(){return this-1};P.mul=function(t){return this*t};P.div=function(t){return this/t};P.pow=function(t){return this**t};P.and=function(t){return this&t};P.or=function(t){return this|t};P.xor=function(t){return this^t};P.mod=function(t){return this%t};P.inv=function(t=1){return t/this};P.doub=function(){return this*2};P.half=function(){return this/2};P.trip=function(){return this*3};P.thir=function(){return this/3};P.sqr=function(){return this**2};P.sqrt=function(){return this**.5};P.cb=function(){return this**3};P.cbrt=function(){return this**(1/3)};P.bas=function(t){return t**this};P.nrot=function(t){return this**(1/t)};P.nrotr=function(t){return t**(1/this)};P.neg=function(t=0){return t-this};P.log=function(){return Math.log(this)};P.log10=function(){return Math.log10(this)};P.log2=function(){return Math.log2(this)};P.logb=function(t){return Math.log(this)/Math.log(t)};P.logbr=function(t){return Math.log(t)/Math.log(this)};P.floor=function(t=1){return Math.floor(this/t)*t};P.round=function(t=1){return Math.round(this/t)*t};P.ceil=function(t=1){return Math.ceil(this/t)*t};P.random=function(t=0){return Math.random()*(this-t)+t};P.randomn=function(){return this.random(-this)};P.clz32=function(){return Math.clz32(this)};P.max=function(...t){t.unshift(this);return Math.max.apply(null,t)};P.min=function(...t){t.unshift(this);return Math.min.apply(null,t)};P.sin=function(t=false){return Math.sin(this/(t?Math.degrad:1))};P.cos=function(t=false){return Math.cos(this/(t?Math.degrad:1))};P.tan=function(t=false){return Math.tan(this/(t?Math.degrad:1))};P.asin=function(){return Math.asin(this)};P.acos=function(){return Math.acos(this)};P.atan=function(){return Math.atan(this)};P.atan2=function(){return Math.atan2(this)};P.sinh=function(){return Math.sinh(this)};P.cosh=function(){return Math.cosh(this)};P.tanh=function(){return Math.tanh(this)};P.asinh=function(){return Math.asinh(this)};P.acosh=function(){return Math.acosh(this)};P.atanh=function(){return Math.atanh(this)};P.sign=function(){return Math.sign(this)};P.abs=function(){return Math.abs(this)};P.absn=function(){return Math.abs(this)*-1};P.trunc=function(){return Math.trunc(this)};P.log1p=function(){return Math.log1p(this)};P.fround=function(){return Math.fround(this)};P.hypot=function(...t){t.unshift(this);return Math.hypot.apply(null,t)};P.imul=function(t){return Math.imul(this,t)};P.gt=function(t){return this>t};P.gte=function(t){return this>=t};P.lt=function(t){return this=0:this>0};P.isNeg=function(t){return t?this<=0:this<0};P.isalt=function(t=1){return this.abs().lt(t)};P.dti=function(t){var e=this%1;while(e%1>(t||1e-5)){e*=10}return e};P.dtil=function(){return this.dti().log10().floor().add(1)};P.join=function(t){if(this%1!=0&t%1!=0){t=t.dti().add(t.floor().mul(10**t.dtil()))}return String(this)+String(t)};P.low=function(t=0){var e=this.floor();var r=e%1;while(!(Math.floor(e%10)!=0|e<10)){e/=10}return e+(t?r:0)};P.infs=function(){return Math.log10(this)/Math.log10(Number.MAX_VALUE)};P.toDate=function(){return new Date(this)};P.toTimeStr=function(t=false){var e=this%1e3,r=Math.floor(this/1e3)%60,n=Math.floor(this/6e4)%60,i=Math.floor(this/36e5)%24,s=Math.floor(this/864e5)%365,a=Math.floor(this/31536e6),o=[];e=e==1?e+" millisecond ":e+" milliseconds";r=r==1?r+" second":r+" seconds";n=n==1?n+" minute":n+" minutes";i=i==1?i+" hour":i+" hours";s=s==1?s+" day":s+" days";a=a==1?a+" year":a+" years";if(t)o.push(e);if(this>=1e3|!t)o.push(r);if(this>=6e4)o.push(n);if(this>=36e5)o.push(i);if(this>=864e5)o.push(s);if(this>=31536e6)o.push(a);o[o.length-1]=o[o.length-1].trim();return o.join(", ")};P.toTimeStr2=function(t=false,e=false){if(isNaN(this))return null;var r=this%1e3,n=Math.floor(this/1e3)%60,i=Math.floor(this/6e4)%60,s=Math.floor(this/36e5)%(e?24:Infinity),a=Math.floor(this/864e5)%365,o=Math.floor(this/31536e6);var u="";if(t)u+="."+r.toString().padStart(3,"0");u=":"+n.toString().padStart(2,"0")+u;u=":"+i.toString().padStart(2,"0")+u;u=(e?":":"")+s.toString().padStart(2,"0")+u;if(e){u=":"+a.toString().padStart(3,"0")+u;u=o+u}return u};P.reverse=function(){var t=this.toString();t=t.reverse();t=t.number();return isNaN(t)?null:t};P.fitDim=function(t=2){return this.nrot(t).floor().pow(t)};P.signMul=function(t=1){return this.sign().mul(t)};P.sfloor=function(t=1){return t==0?this+0:this.div(t).floatFix().floor().mul(t)};P.sround=function(t=1){return t==0?this+0:this.div(t).floatFix().round().mul(t)};P.sceil=function(t=1){return t==0?this+0:this.div(t).floatFix().ceil().mul(t)};P.toRGB=function(t=false){var e=[this.div(65536).floor()%256,this.div(256).floor()%256,this.floor()%256];if(t)e.push(this.div(16777216).floor()%256);return e};P.dist=function(t){return(this-t).abs()};P.split=function(t=""){var e=this.toString().split(t);return e.map(t=>{return isNaN(Number(t))?t:Number(t)})};P.reverseGroups=function(t){var e=this.split();e=e.reverseGroups(t);return e.joinNum()};P.radtodeg=function(){return this*Math.degrad};P.degtorad=function(){return this/Math.degrad};P.hasDec=function(){return this%1!=0};P.limz=function(){return this.max(0)};P.location=function(t,e){return(this-t)/(e-t)};P.ellip2=function(){return Math.PI*this**2};P.ellip3=function(){return 4/3*Math.PI*this**3};P.divabs=function(t){var e=[this,t];if(t>this)e.reverse();return e[0]/e[1]};P.getdec=function(){return this%1};P.separate=function(t=false){var e=[Math.floor(this),this%1];if(t)e.reverse();return e};P.loga=function(){var t=this.abs(),e=t<1?t:t/t.lfloor(10),r=t.log10().floor();c=r.log10().floor(),o=[this.sign()];r=r/r.lfloor(10);e=e>=10?e/10:e;r=r>=10?r/10:r;o.push(e);if(t>=10)o.push(r);if(t>=1e10)o.push(c);return o};P.toStringFix=function(t=.01,e=6,r=-6){if(this.isNeg()&this.isInf())return"-Infinity";if(this.isInf())return"Infinity";if(this.isNaN())return"NaN";if(this.isz())return"0";var n=this.abs(),i=this.abs().min(1).lfloor(10),s;if(n>=10**e|n<=10**r){s=n.div(n.lfloor(10)).sfloor(t).floatFix()+"e"+n.log10().floor()}else{s=n.sfloor(t*i).floatFix()}return(this.isNeg()?"-":"")+s};P.modabs=function(t){var e=this.abs().mod(t);return(this.isNeg()?t-e:e)%t};P.toLocaleString2=function(){return this.toLocaleString().split("").exclude(",").join("")};P.divf=function(t){return(this/t).floor()};P.mix=function(t){return(this+t)/2};P.divisors=function(){var t=[];for(var e=0;e=t:b>t)?r+1:r};P.sthres=function(t=1,e=1,r=true){return this.div(t).thres(e,r)*t};P.lthres=function(t=10,e=1,r=true){return this.logb(t).floatFix().thres(e,r).bas(t)};P.fromCharCode=function(){return String.fromCharCode(this)};P.triareaIsos=function(t,e){return t*e/2};P.triareaEqui=function(t){return.75.sqrt()*t**2};P.rs=function(t){return this>>t};P.ls=function(t){return this<>>t};P.digitAt=function(t){return(this.abs()%10**(t+1)/10**t).floatFix(7).floor()%10};P.toStringWrite=function(t=true,e=false){if(this.isNeg()&this.isInf())return"-∞";if(this.isInf())return"∞";var r=this.isNeg(),n=this.abs().log10().floor(),i=this.abs().dti();f=i.log10().floor();var s="0".repeat(n.max(0)+1).map((t,e)=>{return this.abs().toNumber().digitAt(n-e).toString()});if(t)s=s.putevery(e?".":",",4,s.length%3,0);var a="0".repeat(f.max(0)+1).map((t,e)=>{return i.toNumber().digitAt(f.max(0)-e).toString()});return(r?"-":"")+s+(a=="0"?"":(e?",":".")+a)};P.sdi=function(t=true){return[this.sign(),t?this.modabs(1):(this%1).abs(),this.floor()]};P.to0x=function(){return"0x"+this.toString(16)};S.DIST=Math.log10(Number.MAX_SAFE_INTEGER)/Math.log10(Number.MAX_VALUE);S.BIT32=2**31-1;S.BIT64=2**63-1;AddObj(Number,P,S,"Number");P={},S={};P.ifelse=function(t,e){return this?t:e};P.not=function(){return!this};P.and=function(t){return Boolean(this&t)};P.or=function(t){return Boolean(this|t)};P.xor=function(t){return Boolean(this^t)};P.pon=function(){return this?1:-1};S.muland=(...t)=>{var e=true;t.forEach(t=>{e=e.and(t)});return e};S.mulor=(...t)=>{var e=false;t.forEach(t=>{e=e.or(t)});return e};AddObj(Boolean,P,S,"Boolean");P={},S={};P.replaceAt=function(t,e){return this.substr(0,t)+e+this.substr(t+e.length)};P.befj=function(...t){t.push(this);t=t.join("");return t};P.html=function(t,e){return`<${t}${e==undefined?"":" "+e}>${this}`};P.html2=function(t,e){return`<${this}${e==undefined?"":" "+e}>${t}`};P.reverse=function(){var t=this;t=t.split("");t.reverse();return t.join("")};P.del=function(t){return this.substr(0,t)+this.substr(t+1,this.length-t-1)};P.fitEnd=function(t,e=""){t=Math.max(t,0);var r=this;if(r.lengtht){while(r.length!=t){r=r.slice(0,-1)}}return r+""};P.fitStart=function(t,e=""){t=Math.max(t,0);var r=this;if(r.lengtht){while(r.length!=t){r=r.slice(1)}}return r+""};P.loopIncludes=function(t,e=2){return this.repeat(e).includes(t)};P.heading=function(t,e="",r=""){t=Number(t||1).min(6).max(1).floor();return`${this}`};P.change=function(t){var e=this;for(var r=0;r{return t.replaceAt(0,t[0].toUpperCase())});return t.join(" ")};P.argSplit=function(t,e,r,n){var i=[],s="",a=false,o=false,u=this;for(var h=0;h{return String.fromCharCode(t.charCodeAt()+r)})};P.bigintFix=function(){if(this.last()=="n"){a=this.removeside(true)}else a=this;return BigInt(a)};P.trimSplit=function(t){var e=this.split(t);return e.map(t=>{return t.trim()})};P.trimSplitJoin=function(t){var e=this.trimSplit(t);return e.join(t)};P.reverseGroups=function(t){return this.split("").reverseGroups(t).join("")};P.removeSplit=function(t,e,r,n=false){var i=this.split(t);if(n){return i.splice(e,r).join(t)}else{i.splice(e,r);return i.join(t)}};P.last=function(){return this[this.length-1]};P.unstreq=function(t){return this.toLowerCase()==t.toLowerCase()};P.removeside=function(t=true){return t?this.del(this.length-1):this.del(0)};P.fractal=function(t,e){var r=this.replaceAll("$r",e);for(var n=0;n{n=this.split("").indexOf(t);r.push(e?n==-1?this.length:n:n)});return r.min()}else{var r=this.split("").indexOf(t);return e?r==-1?this.length:r:r}};P.findLast=function(t,e=false){if(Array.isArray(t)){var r=[],n;t.forEach(t=>{n=this.split("").reverse().indexOf(t).neg(this.length).sub(1);r.push(e?n==-1?this.length:n:n)});return r.max()}else{var r=this.split("").reverse().indexOf(t).neg(this.length).sub(1);return e?r==-1?this.length:r:r}};P.cutFirst=function(t,e=0){if(typeof t=="string"|Array.isArray(t)){t=e?this.findLast(t,1):this.findFirst(t,1)}return this.substr(t,this.length-t)};P.cutLast=function(t,e=0){if(typeof t=="string"|Array.isArray(t)){t=this.length-(e?this.findLast(t,1):this.findFirst(t,1))}return this.substr(0,this.length-t)};P.until=function(t=0,e="",r=0,n=0){if(typeof t=="string"){t=this.findFirst(t)}var i=this.substr(t+(n>=2?1:0)),s=this.length-i.length;c=i.findFirst(e,1)+s,d=i.substr(0,i.findFirst(e,1)+(n==1?1:0));return r?d:c};P.untilPrt=function(t=0,e="{",r="}",n,i=0,s=true,a="\\"){if(typeof t=="string"){t=this.findFirst(t)}if(e!=r&!Array.isArray(e)&!Array.isArray(r)){e=[e];r=[r]}var o="",u=t;while(!e.includes(this[u])&this[u]!=undefined){o+=this[u];u++}var h=u;var f=[0].repeat(e.length),c="";while(!(f.sum()==0&u!=h|this[u]==undefined)){if(e==r&this[u]==e){if(f[0]==0)f[0]=1;else if(this.detectRepeats(a,u,true)%2==0)f[0]=0}else{if(e.includes(this[u])&r.includes(this[u])){if(s){if(c==this[u]){if(this.detectRepeats(a,u,true)%2==0){c="";f[e.indexOf(this[u])]=0}}else{if(c=="")c=this[u];f[e.indexOf(this[u])]=1}}else{f[e.indexOf(this[u])]=1-f[e.indexOf(this[u])]}}else{if(e.includes(this[u])&c=="")f[e.indexOf(this[u])]++;if(r.includes(this[u])&c=="")f[r.indexOf(this[u])]--}}o+=this[u];u++}if(i!=1)o=o.cutLast(1);if(i==2)o=o.substr(1);return n?o:u-1};P.untilStrav=function(t='"',e="\\"){var r=t;if(!t.isArray())t=[t];t=this.findFirst(t,1);var n=this.whichFirst.apply(this,[0].concat(r));var i=t,s="";while(!(this[i]==n&this.detectRepeats(e,i,true)%2==0&i!=t)&this[i]!=undefined){s+=this[i];i++}return s};P.hasFirst=function(t,e=0,r){if(!Array.isArray(t))t=[t];var n=false,i="",s=this.cutFirst(e);t.forEach(t=>{if(s.substr(0,t.length)==t){n=true;if(i=="")i=t}});return r?[n,i]:n};P.untilSplit=function(t,e='"',r='"'){if(!Array.isArray(e))e=[e];if(!Array.isArray(r))r=[r];var n="",i=[],s=true;for(var a=0;a{return t.length}).sum()+this.length;return r.substr(t.modabs(n),this.length)};P.exclude=function(...e){var r=this;e.forEach(t=>{r=r.replaceAll(e,"")});return r};P.put=function(t=0,e){return this.substr(0,t)+e+this.substr(t)};P.delmul=function(t=0,e=1){return this.substr(0,t)+this.substr(t+e)};P.detectRepeats=function(t,e,r=false){if(t=="")return 0;var n=0,i=e;if(r)i-=t.length;while(this.hasFirst(t,i)){i+=t.length*(r?-1:1);n++}return n};P.merge=function(...t){var e=t.map(t=>{return t.length}).sum()+this.length,r="",n=[this].concat(t);for(var i=0;i{r=r.replaceAt(t,e)});return r};P.allowIf=function(r=()=>{}){var n="";this.forEach((t,e)=>{if(r(t,e))n+=t});return n};P.findCount=function(t,e=false,r=false){if(t=="")return r?[]:0;var n=r?[]:0;for(var i=0;i{return Math.random(){return t.isUpperCase()?t.toLowerCase():t.toUpperCase()})};P.isLetter=function(t=0){return!(!this.isUpperCase(t)&!this.isLowerCase(t))};P.whichFirst=function(e=0,...t){var r;for(var n=0;n{if(this.hasFirst(t,n))r=e?[t,n]:t});if(r)return r}return-1};P.toSymbol=function(t=false){if(this.hasFirst("Symbol(")&this.last()==")"){return Symbol(this.substr(7).cutLast(1))}else{return t?null:Symbol()}};P.detectType=function(t=false){var e;if(this=="NaN")e=NaN;else if(this=="undefined")e=undefined;else if(this=="null")e=null;else if(this=="false")e=false;else if(this=="true")e=true;else{e=Number(this);if(isNaN(e)){try{e=this.bigintFix()}catch{e=this.toSymbol(true);if(!e)try{e=this.parse()}catch{e=this+""}}}}return t?e.type:e};P.evalWorks=function(){try{Function(this);return true}catch{return false}};P.error=function(t=0,e=true){if(typeof t=="string")t=EasyObj.errors.indexOf(t);var r;switch(t){case 0:r=Error(this);break;case 1:r=RangeError(this);break;case 2:r=ReferenceError(this);break;case 3:r=SyntaxError(this);break;case 4:r=TypeError(this);break;case 5:r=URIError(this);break;case 6:r=EvalError(this);break}if(e){throw r}else{return r}};P.eqlength=function(t){return this.length==t.length};P.putevery=function(t,e,r,n=true){var i=this+"",s=r;while(s{r=r.map(t=>{return t.split(e)}).flat()});return r.flat()};P.setLocStr=function(t){localStorage.setItem(t,this)};P.setCookie=function(t,e,r=false){var n=e?"; expires="+(new Date).add(e).toUTCString():"",i=t+"="+(this.toString()||"")+n+"; path=/";if(r)return i;else document.cookie=i};P.toHTML=function(t=true){var e=new DOMParser;var r=e.parseFromString(this,"text/html");var n=r.body;if(t)return n.querySelector("*");return n};P.toHexCode=function(e=8,t=""){if(e!==8&e!==16)"[EasyMod.js] Incorrect UTF type".error(4);return this.split("").map(t=>{return t.charCodeAt().toString(16).padStart(e/4,"0")}).join(t)};P.splitEvery=function(t=1,e=0){var r=[],n="";for(var i=0;i{return t.parseInt().fromCharCode()}).join("")};S.progress=(t,e,r="|",n=".")=>{var i=(t*e).floor().max(0).min(t),s=t-i,a="";for(var o=0;ot};P.gte=function(t){return this>=t};P.lt=function(t){return this=0:this>0};P.isNeg=function(t){return t?this<=0:this<0};P.comp=function(t){return(this-BigInt(t)).sign()};AddObj(BigInt,P,S,"BigInt");P={},S={};P.iterate=function(t,e){if(t==0){return e}else{return this(this.iterate(t-1,e))}};P.getArgs=function(){if(this.toString()[0]!="f"&this.toString()[0]!="(")return this.toString().cutLast([" ","="]);return this.toString().untilPrt("(","(",")",1,2).untilSplitPrt(",",EasyObj.prt.s,EasyObj.prt.e).mapTrim().map(t=>{return t.cutLast([" ","="])})};P.getArgsAll=function(){if(this.toString()[0]!="f"&this.toString()[0]!="(")return this.toString().cutLast([" ","="]);return this.toString().untilPrt("(","(",")",1,2).untilSplitPrt(",",EasyObj.prt.s,EasyObj.prt.e).mapTrim()};P.getCmd=function(t){if(this.toString()[0]!="f"&this.toString()[0]!="("){var e=this.toString().substr(this.toString().untilPrt(0,"(",")",1,1)+1).cutFirst(["=","{"]),r=false;while([" ","=",">"].includes(e[0])){e=e.cutFirst(1)}if(e[0]!="{")r=true;var n=e.untilPrt(0,EasyObj.prt.s,EasyObj.prt.e,1,r?1:2);if(t>=1)n=n.split("\n");if(t>=2&t<4)n=n.mapTrim();if(t>=3)i=i.exclude("");return n}else{var n=this.toString().untilPrt(0,"(",")",1,1),r=false,e=this.toString().cutFirst(n.length);while([" ","=",">"].includes(e[0])){e=e.cutFirst(1)}if(e[0]!="{")r=true;var i=e.untilPrt(0,EasyObj.prt.s,EasyObj.prt.e,1,r?1:2);if(t>=1)i=i.split("\n");if(t>=2&t<4)i=i.mapTrim();if(t>=3)i=i.exclude("");return i}};P.addLine=function(...t){var e=this.getCommand();e=e.concat.apply(e,t);e=e.join("\n");return e.func()};P.arrayCall=function(t=this,e){return this.apply(t,e)};P.reverseCall=function(...t){t.reverse();return this.arrayCall(t)};P.iteration=function(t,e,r=true){var n=[],i=t;for(var s=0;s{return eval(v)});this.apply(This,args)};P["void"]=function(){return void this()};P.trycatch=function(t,e=false){try{if(e){this();return true}else{return this()}}catch(r){t(r);return e?undefined:false}};AddObj(Function,P,S,"Function");P={},S={};P.pus=function(t){return this.push(t)};P.con=function(e){for(let t in e){this.push(t)}return this};P.befj=function(...t){t.push.apply(t,this);return t};P.fitEnd=function(t,e="",r){t=Math.max(t,0);var n=this;if(n.lengtht&!r){while(n.length!=t){n.pop()}}return n};P.fitStart=function(t,e="",r){t=Math.max(t,0);var n=this;if(n.lengtht&!r){while(n.length!=t){n.shift()}}return n};P.valueMap=function(n){var i=r=>{Object.keys(r).forEach((t,e)=>{if(typeof r[t]=="object"){i(r[t])}else{r[t]=n(r[t],t)}})};var t=this;i(t);return t};P.sum=function(t=0){return this.reduce((t,e)=>{return t+e},0)+t};P.sub=function(t=0,e=false){var r=e?this.reverse():this;b=r.spliceReturn(0,1);return b.reduce((t,e)=>{return t-e},r[0])-t};P.prod=function(t=1){return this.reduce((t,e)=>{return t*e},1)*t};P.quot=function(t=1,e=false){var r=e?this.reverse():this;b=r.spliceReturn(0,1);return b.reduce((t,e)=>{return t/e},r[0])/t};P.pow=function(t=1,e=false){var r=e?this.reverse():this;b=r.spliceReturn(0,1);return b.reduce((t,e)=>{return t**e},r[0])**t};P.gate=function(){var e=0;var r=false;this.forEach(t=>{if(t){if(!r)e++}else{r=true}});return e};P.onlyAllow=function(e=false,...t){var r=[];t.forEach(t=>{if(e){if(this.includes(t))r.push(t)}else{r.push(this[t])}});return r};P.stringify=function(){return JSON.stringify(this)};P.detectRepeats=function(r=false,n=false){var i=[],s=0,a=0,o=this[0];this.forEach((t,e)=>{if(t!=o){if(n&r){i.push(e-1)}else{i.push(r?a:s)}s=0;a=e;o=t}s++});if(n&r){i.push(this.length-1)}else{i.push(r?a:s)}return i};P.getIndexes=function(...t){var e=[];t.forEach(t=>{e.push(this.indexOf(t))});return e};P.max=function(t=false){var e=Math.max.apply(null,this);if(t){e=this.indexOf(e)}return e};P.min=function(t=false){var e=Math.min.apply(null,this);if(t){e=this.indexOf(e)}return e};P.split=function(n,t=true,r=true){var i=[],s=[],a=false;if(t){this.forEach((t,e)=>{a=false;if(r?t===n:t==n){i.push(s);s=[];a=true}if(!a)s.push(t)})}else{this.forEach((t,e,r)=>{if(e%n==0&!(e==0)){i.push(s);s=[]}s.push(t)})}i.push(s);return i};P.joinArray=function(r=[]){var t=this.reduce((t,e)=>{return t.concat(e,r)},[]);if(!(r.length==0&Array.isArray(r)))t.pop();return t};P.reverseGroups=function(t){var e=this.split(t,false);e=e.reverse();return e.joinArray()};P.lastIndexOf=function(t){return this.length-1-this.reverse().indexOf(t)};P.detect=function(r,n=true){var i=[];this.forEach((t,e)=>{if(n?t===r:t==r)i.push(e)});return i};P.spliceReturn=function(t,e){var r=this.stringify().parse();r.splice(t,e);return r};P.toRGB=function(){var t=t.flat(),e=t[0].floor()*65536+t[1].floor()*256+t[2].floor()};P.compare=function(r,n=false){if(this.length==r.length){var i=true;this.forEach((t,e)=>{if(n?t!==r[e]:t!=r[e])i=false});return i}else{return false}};P.repeat=function(t){var e=this;for(var r=0;r{r[e.toString()]=t})}else{r=Object.assign({},this)}return r};P.joinNum=function(t=""){return Number(this.join(t))};P.mapSum=function(r){return this.map((t,e)=>{return t+r[e]})};P.mapProd=function(r){return this.map((t,e)=>{return t*r[e]})};P.mapSub=function(r){return this.map((t,e)=>{return t-r[e]})};P.mapQuot=function(r){return this.map((t,e)=>{return t/r[e]})};P.toSave=function(){return this.stringify().btoa()};P.toFunctCmd=function(t="anonymous",e=false,...r){var n=`function ${t}(${r.join(",")}) {${this.map(t=>{return"\t"+t}).join(";\n")}}`;if(e){return n}else{return new Function}};P.toFunctArgs=function(t="anonymous",e,r=false){var n=`function ${t}(${this.join(",")}) {\n${e}\n}`;if(r){return n}else{return new Function}};P.joinFunct=function(){return new Function(`[${this.toString()}].forEach((v,i)=>{v(i)})`)};P.onchange=function(t,e){var r=this();setInterval(()=>{if(r!=this()){t(this,r,this());r=this()}},e||1e3/30)};P.loga=function(){var t=this[1],e=this[2]||0,r=this[3]||0,n=e*10**r,i=t*10**n;return i*this[0]};P.joinb=function(){return this.join("")};P.numToStr=function(){return this.map(t=>{return String.fromCharCode(t)}).join("")};P.mapTrim=function(e=0){return this.map(t=>{switch(e){case 0:return t.trim();case 1:return t.trimStart();case 2:return t.trimEnd()}})};P.last=function(){return this[this.length-1]};P.indexOfAll=function(r){var n=[];this.forEach((t,e)=>{if(t===r)n.push(e)});return n};P.exclude=function(...e){var r=[];this.forEach(t=>{if(!e.includes(t))r.push(t)});return r};P.defaultAll=function(){return this.map(t=>{return t["default"]()})};P.allowIf=function(r=()=>{}){var n=[];this.forEach((t,e)=>{if(r(t,e))n.push(t)});return n};P.sortNum=function(t=false){this.sort((t,e)=>{return t-e});if(t)this.reverse();return this};P.allowProb=function(r,n=false,t=false){if(t){var i=n?this.getKeys().map(t=>{return Number(t)}):this.clone(),e=Math.ceil(this.length*(1-r));for(var s=0;s{if(Math.random(){return t+this[i]}))}r=e}return e};P.removeRepeats=function(){return this.onlyAllow.apply(this,[0].concat(this.detectRepeats(1)))};P.grad=function(t){if(t==this.length)return this[this.length];var e=t%1,r=t.floor();return this[r]*(1-e)+this[r+1]*e};S.fromto=(t=1,e=10,r=1)=>{var n=[];for(var i=t;i{var n=[],i;for(var s=0;s{},e=1,r=16,n=1,i=1,s=[])=>{var a;switch(e){case 1:a=[0].repeat(r);break;case 2:a=[[0].repeat(n)].repeat(r).clone();break;case 3:a=[[[0].repeat(i)].repeat(n)].repeat(r).clone();break}for(var o=0;o<(e<3?1:i);o++){for(var u=0;u<(e<2?1:n);u++){for(var h=0;h{Object.keys(r).forEach((t,e)=>{if(typeof r[t]=="object"){i(r[t])}else{r[t]=n(r[t],t)}})};var t=this;i(t);return t};P.gate=function(){var e=0;var r=false;Object.keys(this).forEach(t=>{if(this[t]){if(!r)e++}else{r=true}});return e};P.onlyAllow=function(...t){var e={};t.forEach(t=>{e[t]=this[t]});return e};P.propNames=function(t=true){return t?Object.keys(this):keys(this)};P.stringify=function(){return JSON.stringify(this)};P.path=function(...t){var e=this;t.forEach(t=>{e=e[t]});return e};P.sharechd=function(e){Object.keys(this).forEach(t=>{e[t]=this[t]})};P.removechd=function(...t){if(t.compare([])){t=Object.keys(this)}t.forEach(t=>{delete this[t]})};P.toSave=function(){return this.stringify().btoa()};P.getLength=function(){return Object.keys(this).length};P.forEach=function(t){for(var e=0;e{e.push(this[t])});return e}};P.reverse=function(){var e={};Object.keys(this).reverse().forEach(t=>{e[t]=this[t]});return e};P.sort=function(){var e={};Object.keys(this).sort().forEach(t=>{e[t]=this[t]});return e};P.allowSyntax=function(e=0){var t=Object.keys(this),r;if(e==0){r={}}else{r=[]}t.forEach(t=>{try{new Function(`z.${t}`);switch(e){case 0:r[t]=this[t];break;case 1:r.push(t);break;case 2:r.push(this[t]);break;case 3:r.push(true)}}catch{if(e==3){r.push(false)}}});return r};P.rename=function(t,e){if(t!==e){this[e]=this[t];delete this[t]}};P.mapName=function(n){var t=Object.keys(this),e=this.stringify().parse();t.forEach((t,e,r)=>{r.rename(t,n(t,e,r,this))});return e};P.getKeys=function(){return Object.keys(this)};P.includes=function(t,e=false){if(e){return this.toArray().includes(t)}else{return this.keys().includes(t)}};P.hasProp=function(r,t=-1){t=t==-1?r.getLength():t;var n=0;this.forEach((t,e)=>{if(r.includes(e))n++});return n>=t};P.merge=function(t){return Object.assign(this,t)};P.assignTo=function(t){return Object.assign(t,this)};P.clone=function(t=0){switch(t){case 0:return this.stringify().parse();case 1:return{...this};case 2:return Object.assign({},this)}};P.dupli=function(t,e){this[e]=this[t]};P.allowIf=function(r=()=>{}){var n={};this.propNames().forEach((t,e)=>{if(r(this[t],t,e))n[t]=this[t]});return n};P.clonepr=function(t,e){this[e]=this[t]};P.switchType=function(t,e,r=true){if(e){if(self[t]==undefined){throw TypeError("[EasyMod.js] 1: type is invalid")}else{try{if(!r)throw Error(" is not a constructor");return new self[t](this)}catch(n){n=n.toString();if(n.includes(" is not a constructor")){try{return self[t](this)}catch(n){throw Error(n)}}else{throw Error(n)}}}}else{switch(t){case"number":return Number(this);break;case"string":return String(this);break;case"boolean":return Boolean(this);break;case"bigint":return BigInt(this);break;case"object":return Object(this);break;case"array":return Array(this);break;case"symbol":return Symbol(this);break;case"undefined":return undefined;break}throw TypeError("[EasyMod.js] 1: type is invalid")}};P.getType=function(){return typeof this};P.truefy=function(){if(this.type=="object"){this.__proto__.sharechd(this)}else{var t={index:this};this.__proto__.sharechd(t);return t}};P.effect=function(t){return t(this,typeof this)};P.isType=function(t){return t==this.type};P.toNumber=function(){return Number(this)};P.toBigInt=function(){return BigInt(this)};P["default"]=function(){switch(this.type){case"number":return 0;case"string":return"";case"bigint":return 0n;case"boolean":return false;case"function":return function(){};case"object":if(Array.isArray(this)){return[]}else return{}}};P.isArray=function(){return Array.isArray(this)};P.unnew=function(t=true){switch(this.type){case"number":return this+0;case"string":return this+"";case"bigint":return this+0n;case"boolean":return Number(this)?true:false;case"object":return t?this.clone(1):this}return this};P.newfy=function(){return Object(this)};P.effect=function(t){return t(this)};P.ciu=function(t=0){return this??t};P.eq=function(t){return this.unnew()==t.unnew()};P.ex=function(t){return this.unnew()===t.unnew()};P.eqn=function(t){return this.unnew()!=t.unnew()};P.exn=function(t){return this.unnew()!==t.unnew()};P.isArray=function(){return Array.isArray(this)};AddObj(Object,P,S,"Object");P={},S={};P.since=function(t){t=new Date(t);return this.getTime()-t.getTime()};P.daysSinceYear=function(t){return(this.getTime()-new Date("year "+t).getTime())/864e5};P.add=function(t){t=new Date(t);return new Date(this.getTime()+t.getTime())};P.sub=function(t){t=new Date(t);return new Date(this.getTime()-t.getTime())};P.getAbsDay=function(){var t=this.getDate(),e=this.getMonth(),r=[31,28,31,30,31,30,31,31,30,31,30,31];m=r.splice(0,e).sum();return t+m-1};P.toTimeStr=function(t=false){var e=this.getMilliseconds(),r=this.getSeconds(),n=this.getMinutes(),i=this.getHours(),s=this.getAbsDay(),a=this.getFullYear(),o=[];if((e!=0|r==0)&t)o.push(e+" milliseconds");if(r!=0)o.push(r+" seconds");if(n!=0)o.push(n+" minutes");if(i!=0)o.push(i+" hours");if(s!=0)o.push(s+" days");if(a!=0)o.push(a+" years");return o.join(", ")};AddObj(Date,P,S,"Date");P={},S={};P.arrayfy=function(){var t=this.data;var e=Array(4),r=[e].repeat(this.height),n=[r].repeat(this.width);t.forEach((t,e)=>{n[(e/(4*this.height)).floor()][(e/4%this.height).floor()][e%4]=t});return n};P.editpx=function(t=0,e=0,r=[0,0,0,0],n){var i=this.data;var s=typeof r=="number"?[r.div(65536).floor()%256,r.div(256).floor()%256,r.floor()%256,n?r.div(16777216).floor()%256:255]:[r[0].floor().max(0).min(255),r[1].floor().max(0).min(255),r[2].floor().max(0).min(255),r[3].floor().max(0).min(255)];i[(t+e*this.width)*4+0]=s[0];i[(t+e*this.width)*4+1]=s[1];i[(t+e*this.width)*4+2]=s[2];i[(t+e*this.width)*4+3]=s[3]};P.getpx=function(t,e,r=true){var n=[data[(t+e*this.width)*4+0],data[(t+e*this.width)*4+1],data[(t+e*this.width)*4+2]];if(r)n.push(data[(t+e*this.width)*4+3]);return n};P.formula=function(t=()=>{},e){var r=this.data;for(var n=0;n{if(typeof t!="object"|typeof r!="object")throw TypeError("[EasyMod.js] Both X and Y values needs to be object or array");if(t.length==r.length){var n=[];t.forEach((t,e)=>{n.push([t,r[e]])});n=n.map(t=>{return(t[0]-t[1])**2});return n.sum().sqrt()}else{return NaN}};S.chanceTotal=(...t)=>{return t.reduce((t,e)=>{return t+1/e},0)};S.average=(...t)=>{return t.sum()/t.length};S.averagelog=(...t)=>{return t.prod().nrot(t.length)};S.maxuntil=(t,e)=>{var r=e/t.max();return t.map(t=>{return t*r})};S.minuntil=(t,e)=>{var r=e/t.min();return t.map(t=>{return t*r})};S.maxindex=(...t)=>{return t.indexOf(Math.max.apply(null,t))};S.minindex=(...t)=>{return t.indexOf(Math.min.apply(null,t))};S.closest=(t,e,r)=>{var n=t.map(t=>(t-e).abs());return r?Math.minindex.apply(null,n):t[Math.minindex.apply(null,n)]};S.farthest=(t,e,r)=>{var n=t.map(t=>(t-e).abs());return r?Math.maxindex.apply(null,n):t[Math.maxindex.apply(null,n)]};S.isIns1=(t,e=0,r=1)=>{return!!(t>=e&t{return!!(t>=r&e>=n&t{return!!(t>=n&e>=i&r>=s&t{return!!((n%2==0?t>=e:t>e)&(n/2<1?t<=e:t{return e-t+e};S.findNext3=(t,e,r)=>{return r*3-e*3+t};AddObj(Math,P,S,"Math");if(!EasyObj.isNode){document.addEventListener("keydown",t=>{EasyObj.key.id.code[t.code]=true;EasyObj.key.id.key[t.key]=true;EasyObj.key.id.num[t.keyCode]=true;EasyObj.key.id.any=true});document.addEventListener("keyup",t=>{if(EasyObj.key.compressed){delete EasyObj.key.id.code[t.code];delete EasyObj.key.id.key[t.key];delete EasyObj.key.id.num[t.keyCode]}else{EasyObj.key.id.code[t.code]=false;EasyObj.key.id.key[t.key]=false;EasyObj.key.id.num[t.keyCode]=false}EasyObj.key.id.any=false});document.addEventListener("mousedown",()=>EasyObj.mouseDown=true);document.addEventListener("mouseup",()=>EasyObj.mouseDown=false);document.addEventListener("mousemove",t=>{EasyObj.doc.msePos.x=t.x;EasyObj.doc.msePos.y=t.y});document.addEventListener("mousedown",t=>{EasyObj.doc.lmsePos.x=t.x;EasyObj.doc.lmsePos.y=t.y});document.addEventListener("wheel",t=>{EasyObj.mouse.scr=t.deltaY;y=EasyObj.mouse.scrs=EasyObj.mouse.scr.sign()});document.addEventListener("mousedown",t=>{switch(t.which){case 1:EasyObj.mouse.ldown=true;EasyObj.mouse.sdown=true;break;case 2:EasyObj.mouse.mdown=true;break;case 3:EasyObj.mouse.rdown=true;EasyObj.mouse.sdown=true;break}EasyObj.mouse.down=true});document.addEventListener("mouseup",t=>{switch(t.which){case 1:EasyObj.mouse.ldown=false;EasyObj.mouse.sdown=false;break;case 2:EasyObj.mouse.mdown=false;break;case 3:EasyObj.mouse.rdown=false;EasyObj.mouse.sdown=false;break}EasyObj.mouse.down=false})}if(!EasyObj.isNode&EasyObj.setint)setInterval(async()=>{try{if(EasyObj.clipb.allow){await navigator.clipboard.read().then(async t=>{try{await t[0].getType("text/plain").then(t=>{t.text().then(t=>EasyObj.clipb.info=t)})}catch{EasyObj.clipb.info=null}})}}catch{}},25);if(EasyObj.setint)setInterval(()=>{EasyObj.random=Math.random()},10);var addm=0;add.proto.forEach(t=>{addm+=t.length});add["static"].forEach(t=>{addm+=t.length});add.totalAdds=addm;var time=Date.now();if(EasyObj.setint)setInterval(()=>{EasyObj.time=Date.now()-time},10);Number.prototype.type="number";Boolean.prototype.type="boolean";String.prototype.type="string";BigInt.prototype.type="bigint";Object.prototype.type="object";Symbol.prototype.type="symbol"})(); \ No newline at end of file +var config={keycompress:false,isNode:false,allowsetint:true};var EasyObj={info:{version:'8',createdBy:"BonesYT",modders:["BinaryCrown"],lastBy:"BinaryCrown",a:{proto:{},"static":{},changed:['Number','Boolean','String','BigInt','Function','Array','Object','Date','ImageData','Math'],totalAdds:undefined},from:'https://github.com/BonesYT/EasyMod.js',issues:'https://github.com/BonesYT/EasyMod.js/issues',isMin:true},define:(n,v)=>{this[n]=v},undefine:n=>{delete this[n]},isDefined:n=>{return this[n]!==undefined},ifnDef:(n,e,p)=>{if(this[n]===undefined){return null}e(...p)},get:n=>{return this[n]},switchGet:(n,v,e,p)=>{for(let j=0;j{let a=typeof target!=='function'?this[target]:target;a.prototype[name]=func},isConst(varname){try{eval(varname.toString());try{eval(`${varname} = _`)}catch{return true}return false}catch{throw ReferenceError('[EasyMod.js] 0: '+varname+' is not defined')}},protoOf:type=>{this[type].prototype},waitUntil(u=()=>{},f=()=>{},delay=10){var a=0,i,b=()=>{if(u(a)){f(a);clearInterval(i)}a++},i=setInterval(b,delay)},repeatUntil(u=()=>{},f=()=>{},end=()=>{},delay=10){var a=0;while(!u(a)){f(a)}end()},key:{id:{code:{},key:{},num:{},any:false},press:key=>{if(key=='any'|key==-1)return EasyObj.key.id.any;return EasyObj.key.id.code[key]|EasyObj.key.id.key[key]|EasyObj.key.id.num[key]},compressed:config.keycompress},mouse:{ldown:false,mdown:false,rdown:false,down:false,sdown:false,scr:0,scrs:0},addEL(type,func,...options){var a=[type,func];a.push.apply(a,options);document.addEventListener.apply(document,a)},setDef(...inputs){return inputs.reduce((p,c)=>{return p==undefined?c:p},undefined)},stc:{abseq:(x,y)=>{if(typeof x==typeof y){switch(typeof x){case'number':return x==y;break;case'string':return x==y;break;case'boolean':return x==y;break;case'bigint':return x==y;break;case'undefined':return true;break;case'object':return x.stringify()==y.stringify();break;case'function':return x.toString()==y.toString();break;case'symbol':return x.toString()==y.toString();break}}else{return false}},gt(x,y){return typeof x==typeof y?x>y:false},gte(x,y){return typeof x==typeof y?x>=y:false},lt(x,y){return typeof x==typeof y?x{}){if(node.localName!='button')throw TypeError('[EasyMod.js] Element tag is not button');if(!(typeof f=='function'))throw TypeError('[EasyMod.js] onclick needs to be an function');node.addEventListener('click',f)},setGetElementById(name='$'){this[name]=function(e){return document.getElementById(e)}},canv:{canvasMsePos(node,objTarget){if(node.localName!='canvas')throw TypeError('[EasyMod.js] Element tag is not canvas');if(!typeof objTarget=='object')throw TypeError('[EasyMod.js] Target needs to be an object');objTarget.mouse={m:{x:0,y:0},l:{x:0,y:0}};node.addEventListener('mousemove',e=>{objTarget.mouse.m.x=e.offsetX,objTarget.mouse.m.y=e.offsetY});node.addEventListener('mousedown',e=>{objTarget.mouse.l.x=e.offsetX,objTarget.mouse.l.y=e.offsetY})},progbar(node,progress=0,x=4,y=4,width=128,height=32,outwidth=4,fullstyle='#ffffff',emptystyle='#999999',outstyle='#444444',dir=0){if(node.localName!='canvas')throw TypeError('[EasyMod.js] Element tag is not canvas');var ctx=node.getContext('2d');ctx.fillStyle=outstyle;ctx.fillRect(x-outwidth,y-outwidth,width+outwidth*2,height+outwidth*2);ctx.fillStyle=emptystyle;ctx.fillRect(x,y,width,height);ctx.fillStyle=fullstyle;switch(dir){case 0:ctx.fillRect(x,y,width*progress,height);break;case 1:ctx.fillRect(x,y,width,height*progress);break;case 2:ctx.fillRect(x+width*(1-progress),y,width*progress,height);break;case 3:ctx.fillRect(x,y+height*(1-progress),width,height*progress);break}},rect(node,x=0,y=0,w=128,h=128,style='#000000',outwidth=0,outstyle='#222222'){if(node.localName!='canvas')throw TypeError('[EasyMod.js] Element tag is not canvas');var ctx=node.getContext('2d');ctx.fillStyle=style;ctx.strokeStyle=outstyle;ctx.lineWidth=outwidth;ctx.fillRect(x,y,w,h);if(outwidth)ctx.strokeRect(x,y,w,h)},circle(node,x=0,y=0,r=16,style='#000000',outwidth=0,outstyle='#222222'){if(node.localName!='canvas')throw TypeError('[EasyMod.js] Element tag is not canvas');var ctx=node.getContext('2d');ctx.fillStyle=style;ctx.strokeStyle=outstyle;ctx.lineWidth=outwidth;ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fill();if(outwidth)ctx.stroke();ctx.closePath()}},effect(name,value=1,target=document.querySelector('html')){target.style.filter=`${name}(${value})`},setinner(target,innerHTML){if(!(typeof target=='object'&target.toString().includes('HTML')))throw TypeError('[EasyMod.js] Target has to be an HTML element');target.innerHTML=innerHTML}},eval(code,isReturn=true){return new Function('thisObj',(isReturn?'return ':'')+code)(this)},playaudio(src,volume=1,speed=1,onload=()=>{}){var a=new Audio(src);a.volume=volume;a.playbackRate=speed;a.onload=onload;a.play()},set:{"var"(name,value,This){This[name]=value},"const"(name,value,This){Object.defineProperty(This,name,{value:value,writable:false,enumerable:true,configurable:true})}},time:0,toReadme:{part(id){return`# ${id}\n${EasyObj.info.a.proto[id].length==0?'':'* '+EasyObj.info.a.proto[id].sort().join(', ')+'\n'}${EasyObj.info.a["static"][id].length==0?'':'* static: '+EasyObj.info.a["static"][id].sort().join(', ')+'\n'}`},full(){var a='# Extra Methods and statics\n',b=EasyObj.toReadme.part;EasyObj.info.a.proto.forEach((v,i)=>{a+=b(i)});a+='\n'+EasyObj.toReadme.easyobj();return a},easyobj(){return`# EasyObj\n* EasyObj is an object with abilities.\n* ${Object.keys(EasyObj).join(', ')}`}},aver(...i){return i.sum()/i.length},clipb:{info:'',allow:false},type(type,...values){switch(type){case'number':return Number(values[0]);case'boolean':return Boolean(values[0]);case'string':return String(values[0]);case'bigint':return BigInt(values[0]);case'object':return Object(values[0]);case'symbol':return Symbol(values[0]);case'function':return Function.apply(null,values);case'array':return Array.apply(null,values);case'undefined':return undefined}},errors:['Error','RangeError','ReferenceError','SyntaxErrror','TypeError','URIError','EvalError'],prt:{s:['{','[','(','"',"'",'`'],e:['}',']',')','"',"'",'`']},random:undefined,isNode:config.isNode,setint:config.allowsetint};delete config;(function(){var add=EasyObj.info.a;function AddObj(target,proto={},static={},name){EasyObj.info.a.proto[name]=Object.keys(proto);EasyObj.info.a["static"][name]=Object.keys(static);if(target.prototype)Object.assign(target.prototype,proto);Object.assign(target,static)}add.changed.forEach(v=>{add.proto[v]=[];add["static"][v]=[]});var P={};var S={};P.add=function(i){return this+i};P.sub=function(i){return this-i};P.inc=function(){return this+1};P.dec=function(){return this-1};P.mul=function(i){return this*i};P.div=function(i){return this/i};P.pow=function(i){return this**i};P.and=function(i){return this&i};P.or=function(i){return this|i};P.xor=function(i){return this^i};P.mod=function(i){return this%i};P.inv=function(i=1){return i/this};P.doub=function(){return this*2};P.half=function(){return this/2};P.trip=function(){return this*3};P.thir=function(){return this/3};P.sqr=function(){return this**2};P.sqrt=function(){return this**.5};P.cb=function(){return this**3};P.cbrt=function(){return this**(1/3)};P.bas=function(i){return i**this};P.nrot=function(i){return this**(1/i)};P.nrotr=function(i){return i**(1/this)};P.neg=function(i=0){return i-this};P.log=function(){return Math.log(this)};P.log10=function(){return Math.log10(this)};P.log2=function(){return Math.log2(this)};P.logb=function(i){return Math.log(this)/Math.log(i)};P.logbr=function(i){return Math.log(i)/Math.log(this)};P.floor=function(i=1){return Math.floor(this/i)*i};P.round=function(i=1){return Math.round(this/i)*i};P.ceil=function(i=1){return Math.ceil(this/i)*i};P.random=function(i=0){return Math.random()*(this-i)+i};P.randomn=function(){return this.random(-this)};P.clz32=function(){return Math.clz32(this)};P.max=function(...i){i.unshift(this);return Math.max.apply(null,i)};P.min=function(...i){i.unshift(this);return Math.min.apply(null,i)};P.sin=function(isDeg=false){return Math.sin(this/(isDeg?Math.degrad:1))};P.cos=function(isDeg=false){return Math.cos(this/(isDeg?Math.degrad:1))};P.tan=function(isDeg=false){return Math.tan(this/(isDeg?Math.degrad:1))};P.asin=function(){return Math.asin(this)};P.acos=function(){return Math.acos(this)};P.atan=function(){return Math.atan(this)};P.atan2=function(){return Math.atan2(this)};P.sinh=function(){return Math.sinh(this)};P.cosh=function(){return Math.cosh(this)};P.tanh=function(){return Math.tanh(this)};P.asinh=function(){return Math.asinh(this)};P.acosh=function(){return Math.acosh(this)};P.atanh=function(){return Math.atanh(this)};P.sign=function(){return Math.sign(this)};P.abs=function(){return Math.abs(this)};P.absn=function(){return Math.abs(this)*-1};P.trunc=function(){return Math.trunc(this)};P.log1p=function(){return Math.log1p(this)};P.fround=function(){return Math.fround(this)};P.hypot=function(...i){i.unshift(this);return Math.hypot.apply(null,i)};P.imul=function(i){return Math.imul(this,i)};P.gt=function(i){return this>i};P.gte=function(i){return this>=i};P.lt=function(i){return this=0:this>0};P.isNeg=function(e){return e?this<=0:this<0};P.isalt=function(i=1){return this.abs().lt(i)};P.dti=function(i){var dec=this%1;while(dec%1>(i||1e-5)){dec*=10}return dec};P.dtil=function(){return this.dti().log10().floor().add(1)};P.join=function(i){if(this%1!=0&i%1!=0){i=i.dti().add(i.floor().mul(10**i.dtil()))}return String(this)+String(i)};P.low=function(e=0){var a=this.floor();var b=a%1;while(!(Math.floor(a%10)!=0|a<10)){a/=10}return a+(e?b:0)};P.infs=function(){return Math.log10(this)/Math.log10(Number.MAX_VALUE)};P.toDate=function(){return new Date(this)};P.toTimeStr=function(hasMS=false){var a=this%1e3,b=Math.floor(this/1e3)%60,c=Math.floor(this/6e4)%60,d=Math.floor(this/36e5)%24,e=Math.floor(this/864e5)%365,f=Math.floor(this/31536e6),r=[];a=a==1?a+' millisecond ':a+' milliseconds';b=b==1?b+' second':b+' seconds';c=c==1?c+' minute':c+' minutes';d=d==1?d+' hour':d+' hours';e=e==1?e+' day':e+' days';f=f==1?f+' year':f+' years';if(hasMS)r.push(a);if(this>=1e3|!hasMS)r.push(b);if(this>=6e4)r.push(c);if(this>=36e5)r.push(d);if(this>=864e5)r.push(e);if(this>=31536e6)r.push(f);r[r.length-1]=r[r.length-1].trim();return r.join(', ')};P.toTimeStr2=function(hasMS=false,hasDays=false){if(isNaN(this))return null;var a=this%1e3,b=Math.floor(this/1e3)%60,c=Math.floor(this/6e4)%60,d=Math.floor(this/36e5)%(hasDays?24:Infinity),e=Math.floor(this/864e5)%365,f=Math.floor(this/31536e6);var r='';if(hasMS)r+='.'+a.toString().padStart(3,'0');r=':'+b.toString().padStart(2,'0')+r;r=':'+c.toString().padStart(2,'0')+r;r=(hasDays?':':'')+d.toString().padStart(2,'0')+r;if(hasDays){r=':'+e.toString().padStart(3,'0')+r;r=f+r}return r};P.reverse=function(){var a=this.toString();a=a.reverse();a=a.number();return isNaN(a)?null:a};P.fitDim=function(dim=2){return this.nrot(dim).floor().pow(dim)};P.signMul=function(mul=1){return this.sign().mul(mul)};P.sfloor=function(step=1){return step==0?this+0:this.div(step).floatFix().floor().mul(step)};P.sround=function(step=1){return step==0?this+0:this.div(step).floatFix().round().mul(step)};P.sceil=function(step=1){return step==0?this+0:this.div(step).floatFix().ceil().mul(step)};P.toRGB=function(hasAlpha=false){var a=[this.div(65536).floor()%256,this.div(256).floor()%256,this.floor()%256];if(hasAlpha)a.push(this.div(16777216).floor()%256);return a};P.dist=function(i){return(this-i).abs()};P.split=function(by=''){var a=this.toString().split(by);return a.map(v=>{return isNaN(Number(v))?v:Number(v)})};P.reverseGroups=function(groupSize){var a=this.split();a=a.reverseGroups(groupSize);return a.joinNum()};P.radtodeg=function(){return this*Math.degrad};P.degtorad=function(){return this/Math.degrad};P.hasDec=function(){return this%1!=0};P.limz=function(){return this.max(0)};P.location=function(from,to){return(this-from)/(to-from)};P.ellip2=function(){return Math.PI*this**2};P.ellip3=function(){return 4/3*Math.PI*this**3};P.divabs=function(i){var a=[this,i];if(i>this)a.reverse();return a[0]/a[1]};P.getdec=function(){return this%1};P.separate=function(rev=false){var a=[Math.floor(this),this%1];if(rev)a.reverse();return a};P.loga=function(){var t=this.abs(),a=t<1?t:t/t.lfloor(10),b=t.log10().floor();c=b.log10().floor(),o=[this.sign()];b=b/b.lfloor(10);a=a>=10?a/10:a;b=b>=10?b/10:b;o.push(a);if(t>=10)o.push(b);if(t>=1e10)o.push(c);return o};P.toStringFix=function(step=.01,emax=6,emin=-6){if(this.isNeg()&this.isInf())return'-Infinity';if(this.isInf())return'Infinity';if(this.isNaN())return'NaN';if(this.isz())return'0';var a=this.abs(),b=this.abs().min(1).lfloor(10),c;if(a>=10**emax|a<=10**emin){c=a.div(a.lfloor(10)).sfloor(step).floatFix()+'e'+a.log10().floor()}else{c=a.sfloor(step*b).floatFix()}return(this.isNeg()?'-':'')+c};P.modabs=function(i){var a=this.abs().mod(i);return(this.isNeg()?i-a:a)%i};P.toLocaleString2=function(){return this.toLocaleString().split('').exclude(',').join('')};P.divf=function(i){return(this/i).floor()};P.mix=function(i){return(this+i)/2};P.divisors=function(){var out=[];for(var i=0;i=maxat:b>maxat)?a+1:a};P.sthres=function(step=1,maxat=1,equal=true){return this.div(step).thres(maxat,equal)*step};P.lthres=function(step=10,maxat=1,equal=true){return this.logb(step).floatFix().thres(maxat,equal).bas(step)};P.fromCharCode=function(){return String.fromCharCode(this)};P.triareaIsos=function(w,h){return w*h/2};P.triareaEqui=function(w){return.75.sqrt()*w**2};P.rs=function(i){return this>>i};P.ls=function(i){return this<>>i};P.digitAt=function(i){return(this.abs()%10**(i+1)/10**i).floatFix(7).floor()%10};P.toStringWrite=function(hasIllions=true,flipSym=false){if(this.isNeg()&this.isInf())return'-∞';if(this.isInf())return'∞';var n=this.isNeg(),d=this.abs().log10().floor(),e=this.abs().dti();f=e.log10().floor();var a='0'.repeat(d.max(0)+1).map((v,i)=>{return this.abs().toNumber().digitAt(d-i).toString()});if(hasIllions)a=a.putevery(flipSym?'.':',',4,a.length%3,0);var b='0'.repeat(f.max(0)+1).map((v,i)=>{return e.toNumber().digitAt(f.max(0)-i).toString()});return(n?'-':'')+a+(b=='0'?'':(flipSym?',':'.')+b)};P.sdi=function(isDecAbs=true){return[this.sign(),isDecAbs?this.modabs(1):(this%1).abs(),this.floor()]};P.to0x=function(){return'0x'+this.toString(16)};S.DIST=Math.log10(Number.MAX_SAFE_INTEGER)/Math.log10(Number.MAX_VALUE);S.BIT32=2**31-1;S.BIT64=2**63-1;AddObj(Number,P,S,'Number');P={},S={};P.ifelse=function(i,e){return this?i:e};P.not=function(){return!this};P.and=function(i){return Boolean(this&i)};P.or=function(i){return Boolean(this|i)};P.xor=function(i){return Boolean(this^i)};P.pon=function(){return this?1:-1};S.muland=(...i)=>{var r=true;i.forEach(v=>{r=r.and(v)});return r};S.mulor=(...i)=>{var r=false;i.forEach(v=>{r=r.or(v)});return r};AddObj(Boolean,P,S,'Boolean');P={},S={};P.replaceAt=function(i,e){return this.substr(0,i)+e+this.substr(i+e.length)};P.befj=function(...i){i.push(this);i=i.join('');return i};P.html=function(i,attr){return`<${i}${attr==undefined?'':' '+attr}>${this}`};P.html2=function(i,attr){return`<${this}${attr==undefined?'':' '+attr}>${i}`};P.reverse=function(){var a=this;a=a.split('');a.reverse();return a.join('')};P.del=function(id){return this.substr(0,id)+this.substr(id+1,this.length-id-1)};P.fitEnd=function(l,f=''){l=Math.max(l,0);var a=this;if(a.lengthl){while(a.length!=l){a=a.slice(0,-1)}}return a+''};P.fitStart=function(l,f=''){l=Math.max(l,0);var a=this;if(a.lengthl){while(a.length!=l){a=a.slice(1)}}return a+''};P.loopIncludes=function(i,a=2){return this.repeat(a).includes(i)};P.heading=function(i,id='',Class=''){i=Number(i||1).min(6).max(1).floor();return`${this}`};P.change=function(i){var a=this;for(var b=0;b{return v.replaceAt(0,v[0].toUpperCase())});return a.join(' ')};P.argSplit=function(by,strStart,strEnd,inStr){var o=[],t='',str=false,a=false,input=this;for(var i=0;i{return String.fromCharCode(v.charCodeAt()+amm)})};P.bigintFix=function(){if(this.last()=='n'){a=this.removeside(true)}else a=this;return BigInt(a)};P.trimSplit=function(by){var a=this.split(by);return a.map(v=>{return v.trim()})};P.trimSplitJoin=function(by){var a=this.trimSplit(by);return a.join(by)};P.reverseGroups=function(groupSize){return this.split('').reverseGroups(groupSize).join('')};P.removeSplit=function(by,spliceStart,spliceCount,not=false){var a=this.split(by);if(not){return a.splice(spliceStart,spliceCount).join(by)}else{a.splice(spliceStart,spliceCount);return a.join(by)}};P.last=function(){return this[this.length-1]};P.unstreq=function(i){return this.toLowerCase()==i.toLowerCase()};P.removeside=function(isEnd=true){return isEnd?this.del(this.length-1):this.del(0)};P.fractal=function(int,last){var a=this.replaceAll('$r',last);for(var i=0;i{b=this.split('').indexOf(v);a.push(lastCounts?b==-1?this.length:b:b)});return a.min()}else{var a=this.split('').indexOf(target);return lastCounts?a==-1?this.length:a:a}};P.findLast=function(target,lastCounts=false){if(Array.isArray(target)){var a=[],b;target.forEach(v=>{b=this.split('').reverse().indexOf(v).neg(this.length).sub(1);a.push(lastCounts?b==-1?this.length:b:b)});return a.max()}else{var a=this.split('').reverse().indexOf(target).neg(this.length).sub(1);return lastCounts?a==-1?this.length:a:a}};P.cutFirst=function(pos,isLast=0){if(typeof pos=='string'|Array.isArray(pos)){pos=isLast?this.findLast(pos,1):this.findFirst(pos,1)}return this.substr(pos,this.length-pos)};P.cutLast=function(pos,isLast=0){if(typeof pos=='string'|Array.isArray(pos)){pos=this.length-(isLast?this.findLast(pos,1):this.findFirst(pos,1))}return this.substr(0,this.length-pos)};P.until=function(start=0,until='',mode=0,strmode=0){if(typeof start=='string'){start=this.findFirst(start)}var a=this.substr(start+(strmode>=2?1:0)),b=this.length-a.length;c=a.findFirst(until,1)+b,d=a.substr(0,a.findFirst(until,1)+(strmode==1?1:0));return mode?d:c};P.untilPrt=function(start=0,group='{',until='}',mode,strmode=0,strignore=true,endignore='\\'){if(typeof start=='string'){start=this.findFirst(start)}if(group!=until&!Array.isArray(group)&!Array.isArray(until)){group=[group];until=[until]}var b='',a=start;while(!group.includes(this[a])&this[a]!=undefined){b+=this[a];a++}var c=a;var step=[0].repeat(group.length),d='';while(!(step.sum()==0&a!=c|this[a]==undefined)){if(group==until&this[a]==group){if(step[0]==0)step[0]=1;else if(this.detectRepeats(endignore,a,true)%2==0)step[0]=0}else{if(group.includes(this[a])&until.includes(this[a])){if(strignore){if(d==this[a]){if(this.detectRepeats(endignore,a,true)%2==0){d='';step[group.indexOf(this[a])]=0}}else{if(d=='')d=this[a];step[group.indexOf(this[a])]=1}}else{step[group.indexOf(this[a])]=1-step[group.indexOf(this[a])]}}else{if(group.includes(this[a])&d=='')step[group.indexOf(this[a])]++;if(until.includes(this[a])&d=='')step[until.indexOf(this[a])]--}}b+=this[a];a++}if(strmode!=1)b=b.cutLast(1);if(strmode==2)b=b.substr(1);return mode?b:a-1};P.untilStrav=function(until='"',avoider='\\'){var w=until;if(!until.isArray())until=[until];until=this.findFirst(until,1);var end=this.whichFirst.apply(this,[0].concat(w));var a=until,b='';while(!(this[a]==end&this.detectRepeats(avoider,a,true)%2==0&a!=until)&this[a]!=undefined){b+=this[a];a++}return b};P.hasFirst=function(target,offset=0,mode){if(!Array.isArray(target))target=[target];var r=false,a='',t=this.cutFirst(offset);target.forEach(v=>{if(t.substr(0,v.length)==v){r=true;if(a=='')a=v}});return mode?[r,a]:r};P.untilSplit=function(by,start='"',end='"'){if(!Array.isArray(start))start=[start];if(!Array.isArray(end))end=[end];var a='',b=[],c=true;for(var i=0;i{return v.length}).sum()+this.length;return a.substr(pos.modabs(l),this.length)};P.exclude=function(...i){var a=this;i.forEach(v=>{a=a.replaceAll(i,'')});return a};P.put=function(at=0,str){return this.substr(0,at)+str+this.substr(at)};P.delmul=function(start=0,width=1){return this.substr(0,start)+this.substr(start+width)};P.detectRepeats=function(str,at,isRev=false){if(str=='')return 0;var a=0,b=at;if(isRev)b-=str.length;while(this.hasFirst(str,b)){b+=str.length*(isRev?-1:1);a++}return a};P.merge=function(...str){var length=str.map(v=>{return v.length}).sum()+this.length,out='',array=[this].concat(str);for(var i=0;i{out=out.replaceAt(v,to)});return out};P.allowIf=function(f=()=>{}){var a='';this.forEach((v,i)=>{if(f(v,i))a+=v});return a};P.findCount=function(str,abs=false,isArray=false){if(str=='')return isArray?[]:0;var out=isArray?[]:0;for(var i=0;i{return Math.random(){return v.isUpperCase()?v.toLowerCase():v.toUpperCase()})};P.isLetter=function(index=0){return!(!this.isUpperCase(index)&!this.isLowerCase(index))};P.whichFirst=function(mode=0,...str){var a;for(var i=0;i{if(this.hasFirst(v,i))a=mode?[v,i]:v});if(a)return a}return-1};P.toSymbol=function(benull=false){if(this.hasFirst('Symbol(')&this.last()==')'){return Symbol(this.substr(7).cutLast(1))}else{return benull?null:Symbol()}};P.detectType=function(isType=false){var a;if(this=='NaN')a=NaN;else if(this=='undefined')a=undefined;else if(this=='null')a=null;else if(this=='false')a=false;else if(this=='true')a=true;else{a=Number(this);if(isNaN(a)){try{a=this.bigintFix()}catch{a=this.toSymbol(true);if(!a)try{a=this.parse()}catch{a=this+''}}}}return isType?a.type:a};P.evalWorks=function(){try{Function(this);return true}catch{return false}};P.error=function(type=0,isThrow=true){if(typeof type=='string')type=EasyObj.errors.indexOf(type);var a;switch(type){case 0:a=Error(this);break;case 1:a=RangeError(this);break;case 2:a=ReferenceError(this);break;case 3:a=SyntaxError(this);break;case 4:a=TypeError(this);break;case 5:a=URIError(this);break;case 6:a=EvalError(this);break}if(isThrow){throw a}else{return a}};P.eqlength=function(str){return this.length==str.length};P.putevery=function(str,every,offset,allow0=true){var a=this+'',b=offset;while(b{a=a.map(y=>{return y.split(x)}).flat()});return a.flat()};P.setLocStr=function(name){localStorage.setItem(name,this)};P.setCookie=function(name,time,returnStr=false){var e=time?"; expires="+(new Date).add(time).toUTCString():"",a=name+"="+(this.toString()||"")+e+"; path=/";if(returnStr)return a;else document.cookie=a};P.toHTML=function(getInside=true){var a=new DOMParser;var b=a.parseFromString(this,'text/html');var c=b.body;if(getInside)return c.querySelector('*');return c};P.toHexCode=function(utf=8,joinby=''){if(utf!==8&utf!==16)'[EasyMod.js] Incorrect UTF type'.error(4);return this.split('').map(v=>{return v.charCodeAt().toString(16).padStart(utf/4,'0')}).join(joinby)};P.splitEvery=function(every=1,offset=0){var a=[],b='';for(var i=0;i{return v.parseInt().fromCharCode()}).join('')};S.progress=(length,progress,full='|',empty='.')=>{var a=(length*progress).floor().max(0).min(length),b=length-a,out='';for(var i=0;ii};P.gte=function(i){return this>=i};P.lt=function(i){return this=0:this>0};P.isNeg=function(e){return e?this<=0:this<0};P.comp=function(i){return(this-BigInt(i)).sign()};AddObj(BigInt,P,S,'BigInt');P={},S={};P.iterate=function(t,i){if(t==0){return i}else{return this(this.iterate(t-1,i))}};P.getArgs=function(){if(this.toString()[0]!='f'&this.toString()[0]!='(')return this.toString().cutLast([' ','=']);return this.toString().untilPrt('(','(',')',1,2).untilSplitPrt(',',EasyObj.prt.s,EasyObj.prt.e).mapTrim().map(v=>{return v.cutLast([' ','='])})};P.getArgsAll=function(){if(this.toString()[0]!='f'&this.toString()[0]!='(')return this.toString().cutLast([' ','=']);return this.toString().untilPrt('(','(',')',1,2).untilSplitPrt(',',EasyObj.prt.s,EasyObj.prt.e).mapTrim()};P.getCmd=function(mode){if(this.toString()[0]!='f'&this.toString()[0]!='('){var b=this.toString().substr(this.toString().untilPrt(0,'(',')',1,1)+1).cutFirst(['=','{']),z=false;while([' ','=','>'].includes(b[0])){b=b.cutFirst(1)}if(b[0]!='{')z=true;var a=b.untilPrt(0,EasyObj.prt.s,EasyObj.prt.e,1,z?1:2);if(mode>=1)a=a.split('\n');if(mode>=2&mode<4)a=a.mapTrim();if(mode>=3)c=c.exclude('');return a}else{var a=this.toString().untilPrt(0,'(',')',1,1),z=false,b=this.toString().cutFirst(a.length);while([' ','=','>'].includes(b[0])){b=b.cutFirst(1)}if(b[0]!='{')z=true;var c=b.untilPrt(0,EasyObj.prt.s,EasyObj.prt.e,1,z?1:2);if(mode>=1)c=c.split('\n');if(mode>=2&mode<4)c=c.mapTrim();if(mode>=3)c=c.exclude('');return c}};P.addLine=function(...i){var a=this.getCommand();a=a.concat.apply(a,i);a=a.join('\n');return a.func()};P.arrayCall=function(This=this,args){return this.apply(This,args)};P.reverseCall=function(...args){args.reverse();return this.arrayCall(args)};P.iteration=function(start,length,onlyres=true){var out=[],n=start;for(var i=0;i{return eval(v)});this.apply(This,args)};P["void"]=function(){return void this()};P.trycatch=function(catchfunc,isreturn=false){try{if(isreturn){this();return true}else{return this()}}catch(e){catchfunc(e);return isreturn?undefined:false}};AddObj(Function,P,S,'Function');P={},S={};P.pus=function(i){return this.push(i)};P.con=function(i){for(let j in i){this.push(j)}return this};P.befj=function(...i){i.push.apply(i,this);return i};P.fitEnd=function(l,f='',min){l=Math.max(l,0);var a=this;if(a.lengthl&!min){while(a.length!=l){a.pop()}}return a};P.fitStart=function(l,f='',min){l=Math.max(l,0);var a=this;if(a.lengthl&!min){while(a.length!=l){a.shift()}}return a};P.valueMap=function(f){var func=i=>{Object.keys(i).forEach((v,ip)=>{if(typeof i[v]=='object'){func(i[v])}else{i[v]=f(i[v],v)}})};var a=this;func(a);return a};P.sum=function(i=0){return this.reduce((p,c)=>{return p+c},0)+i};P.sub=function(i=0,op=false){var a=op?this.reverse():this;b=a.spliceReturn(0,1);return b.reduce((p,c)=>{return p-c},a[0])-i};P.prod=function(i=1){return this.reduce((p,c)=>{return p*c},1)*i};P.quot=function(i=1,op=false){var a=op?this.reverse():this;b=a.spliceReturn(0,1);return b.reduce((p,c)=>{return p/c},a[0])/i};P.pow=function(i=1,op=false){var a=op?this.reverse():this;b=a.spliceReturn(0,1);return b.reduce((p,c)=>{return p**c},a[0])**i};P.gate=function(){var a=0;var b=false;this.forEach(v=>{if(v){if(!b)a++}else{b=true}});return a};P.onlyAllow=function(isValue=false,...i){var a=[];i.forEach(v=>{if(isValue){if(this.includes(v))a.push(v)}else{a.push(this[v])}});return a};P.stringify=function(){return JSON.stringify(this)};P.detectRepeats=function(isPos=false,isEnd=false){var out=[],a=0,b=0,l=this[0];this.forEach((v,i)=>{if(v!=l){if(isEnd&isPos){out.push(i-1)}else{out.push(isPos?b:a)}a=0;b=i;l=v}a++});if(isEnd&isPos){out.push(this.length-1)}else{out.push(isPos?b:a)}return out};P.getIndexes=function(...i){var out=[];i.forEach(v=>{out.push(this.indexOf(v))});return out};P.max=function(pos=false){var a=Math.max.apply(null,this);if(pos){a=this.indexOf(a)}return a};P.min=function(pos=false){var a=Math.min.apply(null,this);if(pos){a=this.indexOf(a)}return a};P.split=function(by,value=true,exact=true){var out=[],a=[],ign=false;if(value){this.forEach((v,i)=>{ign=false;if(exact?v===by:v==by){out.push(a);a=[];ign=true}if(!ign)a.push(v)})}else{this.forEach((v,i,ar)=>{if(i%by==0&!(i==0)){out.push(a);a=[]}a.push(v)})}out.push(a);return out};P.joinArray=function(by=[]){var a=this.reduce((p,c)=>{return p.concat(c,by)},[]);if(!(by.length==0&Array.isArray(by)))a.pop();return a};P.reverseGroups=function(groupSize){var a=this.split(groupSize,false);a=a.reverse();return a.joinArray()};P.lastIndexOf=function(i){return this.length-1-this.reverse().indexOf(i)};P.detect=function(value,exact=true){var out=[];this.forEach((v,i)=>{if(exact?v===value:v==value)out.push(i)});return out};P.spliceReturn=function(start,length){var a=this.stringify().parse();a.splice(start,length);return a};P.toRGB=function(){var a=a.flat(),b=a[0].floor()*65536+a[1].floor()*256+a[2].floor()};P.compare=function(array,exact=false){if(this.length==array.length){var out=true;this.forEach((v,i)=>{if(exact?v!==array[i]:v!=array[i])out=false});return out}else{return false}};P.repeat=function(amm){var a=this;for(var i=0;i{out[i.toString()]=v})}else{out=Object.assign({},this)}return out};P.joinNum=function(by=''){return Number(this.join(by))};P.mapSum=function(array){return this.map((v,i)=>{return v+array[i]})};P.mapProd=function(array){return this.map((v,i)=>{return v*array[i]})};P.mapSub=function(array){return this.map((v,i)=>{return v-array[i]})};P.mapQuot=function(array){return this.map((v,i)=>{return v/array[i]})};P.toSave=function(){return this.stringify().btoa()};P.toFunctCmd=function(name='anonymous',str=false,...args){var a=`function ${name}(${args.join(',')}) {${this.map(v=>{return'\t'+v}).join(';\n')}}`;if(str){return a}else{return new Function}};P.toFunctArgs=function(name='anonymous',cmd,str=false){var a=`function ${name}(${this.join(',')}) {\n${cmd}\n}`;if(str){return a}else{return new Function}};P.joinFunct=function(){return new Function(`[${this.toString()}].forEach((v,i)=>{v(i)})`)};P.onchange=function(f,delay){var a=this();setInterval(()=>{if(a!=this()){f(this,a,this());a=this()}},delay||1e3/30)};P.loga=function(){var a=this[1],b=this[2]||0,c=this[3]||0,d=b*10**c,e=a*10**d;return e*this[0]};P.joinb=function(){return this.join('')};P.numToStr=function(){return this.map(v=>{return String.fromCharCode(v)}).join('')};P.mapTrim=function(mode=0){return this.map(v=>{switch(mode){case 0:return v.trim();case 1:return v.trimStart();case 2:return v.trimEnd()}})};P.last=function(){return this[this.length-1]};P.indexOfAll=function(input){var a=[];this.forEach((v,i)=>{if(v===input)a.push(i)});return a};P.exclude=function(...i){var a=[];this.forEach(v=>{if(!i.includes(v))a.push(v)});return a};P.defaultAll=function(){return this.map(v=>{return v["default"]()})};P.allowIf=function(f=()=>{}){var a=[];this.forEach((v,i)=>{if(f(v,i))a.push(v)});return a};P.sortNum=function(isRev=false){this.sort((a,b)=>{return a-b});if(isRev)this.reverse();return this};P.allowProb=function(chance,isIndex=false,equalLength=false){if(equalLength){var out=isIndex?this.getKeys().map(v=>{return Number(v)}):this.clone(),a=Math.ceil(this.length*(1-chance));for(var i=0;i{if(Math.random(){return v+this[x]}))}b=a}return a};P.removeRepeats=function(){return this.onlyAllow.apply(this,[0].concat(this.detectRepeats(1)))};P.grad=function(i){if(i==this.length)return this[this.length];var a=i%1,b=i.floor();return this[b]*(1-a)+this[b+1]*a};S.fromto=(start=1,end=10,by=1)=>{var out=[];for(var i=start;i{var out=[],a;for(var i=0;i{},dim=1,w=16,h=1,l=1,array=[])=>{var out;switch(dim){case 1:out=[0].repeat(w);break;case 2:out=[[0].repeat(h)].repeat(w).clone();break;case 3:out=[[[0].repeat(l)].repeat(h)].repeat(w).clone();break}for(var z=0;z<(dim<3?1:l);z++){for(var y=0;y<(dim<2?1:h);y++){for(var x=0;x{Object.keys(i).forEach((v,ip)=>{if(typeof i[v]=='object'){func(i[v])}else{i[v]=f(i[v],v)}})};var a=this;func(a);return a};P.gate=function(){var a=0;var b=false;Object.keys(this).forEach(v=>{if(this[v]){if(!b)a++}else{b=true}});return a};P.onlyAllow=function(...i){var a={};i.forEach(v=>{a[v]=this[v]});return a};P.propNames=function(str=true){return str?Object.keys(this):keys(this)};P.stringify=function(){return JSON.stringify(this)};P.path=function(...pathArray){var obj=this;pathArray.forEach(v=>{obj=obj[v]});return obj};P.sharechd=function(objvar){Object.keys(this).forEach(v=>{objvar[v]=this[v]})};P.removechd=function(...i){if(i.compare([])){i=Object.keys(this)}i.forEach(v=>{delete this[v]})};P.toSave=function(){return this.stringify().btoa()};P.getLength=function(){return Object.keys(this).length};P.forEach=function(f){for(var i=0;i{out.push(this[v])});return out}};P.reverse=function(){var out={};Object.keys(this).reverse().forEach(v=>{out[v]=this[v]});return out};P.sort=function(){var out={};Object.keys(this).sort().forEach(v=>{out[v]=this[v]});return out};P.allowSyntax=function(mode=0){var a=Object.keys(this),b;if(mode==0){b={}}else{b=[]}a.forEach(v=>{try{new Function(`z.${v}`);switch(mode){case 0:b[v]=this[v];break;case 1:b.push(v);break;case 2:b.push(this[v]);break;case 3:b.push(true)}}catch{if(mode==3){b.push(false)}}});return b};P.rename=function(target,name){if(target!==name){this[name]=this[target];delete this[target]}};P.mapName=function(f){var o=Object.keys(this),a=this.stringify().parse();o.forEach((v,i,a)=>{a.rename(v,f(v,i,a,this))});return a};P.getKeys=function(){return Object.keys(this)};P.includes=function(val,isPropName=false){if(isPropName){return this.toArray().includes(val)}else{return this.keys().includes(val)}};P.hasProp=function(obj,amm=-1){amm=amm==-1?obj.getLength():amm;var a=0;this.forEach((v,i)=>{if(obj.includes(i))a++});return a>=amm};P.merge=function(obj){return Object.assign(this,obj)};P.assignTo=function(obj){return Object.assign(obj,this)};P.clone=function(way=0){switch(way){case 0:return this.stringify().parse();case 1:return{...this};case 2:return Object.assign({},this)}};P.dupli=function(target,name){this[name]=this[target]};P.allowIf=function(f=()=>{}){var a={};this.propNames().forEach((v,i)=>{if(f(this[v],v,i))a[v]=this[v]});return a};P.clonepr=function(target,into){this[into]=this[target]};P.switchType=function(type,isFunc,useNew=true){if(isFunc){if(self[type]==undefined){throw TypeError('[EasyMod.js] 1: type is invalid')}else{try{if(!useNew)throw Error(' is not a constructor');return new self[type](this)}catch(e){e=e.toString();if(e.includes(' is not a constructor')){try{return self[type](this)}catch(e){throw Error(e)}}else{throw Error(e)}}}}else{switch(type){case'number':return Number(this);break;case'string':return String(this);break;case'boolean':return Boolean(this);break;case'bigint':return BigInt(this);break;case'object':return Object(this);break;case'array':return Array(this);break;case'symbol':return Symbol(this);break;case'undefined':return undefined;break}throw TypeError('[EasyMod.js] 1: type is invalid')}};P.getType=function(){return typeof this};P.truefy=function(){if(this.type=='object'){this.__proto__.sharechd(this)}else{var a={index:this};this.__proto__.sharechd(a);return a}};P.effect=function(funct){return funct(this,typeof this)};P.isType=function(type){return type==this.type};P.toNumber=function(){return Number(this)};P.toBigInt=function(){return BigInt(this)};P["default"]=function(){switch(this.type){case'number':return 0;case'string':return'';case'bigint':return 0n;case'boolean':return false;case'function':return function(){};case'object':if(Array.isArray(this)){return[]}else return{}}};P.isArray=function(){return Array.isArray(this)};P.unnew=function(objectClone=true){switch(this.type){case'number':return this+0;case'string':return this+'';case'bigint':return this+0n;case'boolean':return Number(this)?true:false;case'object':return objectClone?this.clone(1):this}return this};P.newfy=function(){return Object(this)};P.effect=function(funct){return funct(this)};P.ciu=function(i=0){return this??i};P.eq=function(i){return this.unnew()==i.unnew()};P.ex=function(i){return this.unnew()===i.unnew()};P.eqn=function(i){return this.unnew()!=i.unnew()};P.exn=function(i){return this.unnew()!==i.unnew()};P.isArray=function(){return Array.isArray(this)};AddObj(Object,P,S,'Object');P={},S={};P.since=function(t){t=new Date(t);return this.getTime()-t.getTime()};P.daysSinceYear=function(t){return(this.getTime()-new Date('year '+t).getTime())/864e5};P.add=function(i){i=new Date(i);return new Date(this.getTime()+i.getTime())};P.sub=function(i){i=new Date(i);return new Date(this.getTime()-i.getTime())};P.getAbsDay=function(){var a=this.getDate(),b=this.getMonth(),l=[31,28,31,30,31,30,31,31,30,31,30,31];m=l.splice(0,b).sum();return a+m-1};P.toTimeStr=function(hasMS=false){var a=this.getMilliseconds(),b=this.getSeconds(),c=this.getMinutes(),d=this.getHours(),e=this.getAbsDay(),f=this.getFullYear(),out=[];if((a!=0|b==0)&hasMS)out.push(a+' milliseconds');if(b!=0)out.push(b+' seconds');if(c!=0)out.push(c+' minutes');if(d!=0)out.push(d+' hours');if(e!=0)out.push(e+' days');if(f!=0)out.push(f+' years');return out.join(', ')};AddObj(Date,P,S,'Date');P={},S={};P.arrayfy=function(){var data=this.data;var a=Array(4),b=[a].repeat(this.height),c=[b].repeat(this.width);data.forEach((v,i)=>{c[(i/(4*this.height)).floor()][(i/4%this.height).floor()][i%4]=v});return c};P.editpx=function(x=0,y=0,color=[0,0,0,0],hasAlpha){var data=this.data;var c=typeof color=='number'?[color.div(65536).floor()%256,color.div(256).floor()%256,color.floor()%256,hasAlpha?color.div(16777216).floor()%256:255]:[color[0].floor().max(0).min(255),color[1].floor().max(0).min(255),color[2].floor().max(0).min(255),color[3].floor().max(0).min(255)];data[(x+y*this.width)*4+0]=c[0];data[(x+y*this.width)*4+1]=c[1];data[(x+y*this.width)*4+2]=c[2];data[(x+y*this.width)*4+3]=c[3]};P.getpx=function(x,y,hasAlpha=true){var a=[data[(x+y*this.width)*4+0],data[(x+y*this.width)*4+1],data[(x+y*this.width)*4+2]];if(hasAlpha)a.push(data[(x+y*this.width)*4+3]);return a};P.formula=function(f=()=>{},hasAlpha){var data=this.data;for(var x=0;x{if(typeof x!='object'|typeof y!='object')throw TypeError('[EasyMod.js] Both X and Y values needs to be object or array');if(x.length==y.length){var a=[];x.forEach((v,i)=>{a.push([v,y[i]])});a=a.map(v=>{return(v[0]-v[1])**2});return a.sum().sqrt()}else{return NaN}};S.chanceTotal=(...i)=>{return i.reduce((p,c)=>{return p+1/c},0)};S.average=(...i)=>{return i.sum()/i.length};S.averagelog=(...i)=>{return i.prod().nrot(i.length)};S.maxuntil=(array,max)=>{var m=max/array.max();return array.map(v=>{return v*m})};S.minuntil=(array,min)=>{var m=min/array.min();return array.map(v=>{return v*m})};S.maxindex=(...values)=>{return values.indexOf(Math.max.apply(null,values))};S.minindex=(...values)=>{return values.indexOf(Math.min.apply(null,values))};S.closest=(array,to,mode)=>{var a=array.map(v=>(v-to).abs());return mode?Math.minindex.apply(null,a):array[Math.minindex.apply(null,a)]};S.farthest=(array,to,mode)=>{var a=array.map(v=>(v-to).abs());return mode?Math.maxindex.apply(null,a):array[Math.maxindex.apply(null,a)]};S.isIns1=(x,bx=0,bw=1)=>{return!!(x>=bx&x{return!!(x>=bx&y>=by&x{return!!(x>=bx&y>=by&z>=bz&x{return!!((mode%2==0?x>=a:x>a)&(mode/2<1?x<=a:x{return y-x+y};S.findNext3=(x,y,z)=>{return z*3-y*3+x};AddObj(Math,P,S,'Math');if(!EasyObj.isNode){document.addEventListener('keydown',e=>{EasyObj.key.id.code[e.code]=true;EasyObj.key.id.key[e.key]=true;EasyObj.key.id.num[e.keyCode]=true;EasyObj.key.id.any=true});document.addEventListener('keyup',e=>{if(EasyObj.key.compressed){delete EasyObj.key.id.code[e.code];delete EasyObj.key.id.key[e.key];delete EasyObj.key.id.num[e.keyCode]}else{EasyObj.key.id.code[e.code]=false;EasyObj.key.id.key[e.key]=false;EasyObj.key.id.num[e.keyCode]=false}EasyObj.key.id.any=false});document.addEventListener('mousedown',()=>EasyObj.mouseDown=true);document.addEventListener('mouseup',()=>EasyObj.mouseDown=false);document.addEventListener('mousemove',e=>{EasyObj.doc.msePos.x=e.x;EasyObj.doc.msePos.y=e.y});document.addEventListener('mousedown',e=>{EasyObj.doc.lmsePos.x=e.x;EasyObj.doc.lmsePos.y=e.y});document.addEventListener('wheel',e=>{EasyObj.mouse.scr=e.deltaY;y=EasyObj.mouse.scrs=EasyObj.mouse.scr.sign()});document.addEventListener('mousedown',e=>{switch(e.which){case 1:EasyObj.mouse.ldown=true;EasyObj.mouse.sdown=true;break;case 2:EasyObj.mouse.mdown=true;break;case 3:EasyObj.mouse.rdown=true;EasyObj.mouse.sdown=true;break}EasyObj.mouse.down=true});document.addEventListener('mouseup',e=>{switch(e.which){case 1:EasyObj.mouse.ldown=false;EasyObj.mouse.sdown=false;break;case 2:EasyObj.mouse.mdown=false;break;case 3:EasyObj.mouse.rdown=false;EasyObj.mouse.sdown=false;break}EasyObj.mouse.down=false})}if(!EasyObj.isNode&EasyObj.setint)setInterval(async()=>{try{if(EasyObj.clipb.allow){await navigator.clipboard.read().then(async v=>{try{await v[0].getType('text/plain').then(v=>{v.text().then(v=>EasyObj.clipb.info=v)})}catch{EasyObj.clipb.info=null}})}}catch{}},25);if(EasyObj.setint)setInterval(()=>{EasyObj.random=Math.random()},10);var addm=0;add.proto.forEach(v=>{addm+=v.length});add["static"].forEach(v=>{addm+=v.length});add.totalAdds=addm;var time=Date.now();if(EasyObj.setint)setInterval(()=>{EasyObj.time=Date.now()-time},10);Number.prototype.type='number';Boolean.prototype.type='boolean';String.prototype.type='string';BigInt.prototype.type='bigint';Object.prototype.type='object';Symbol.prototype.type='symbol'})();