Console (Sandbox)

← разместить еще код

https://www.youtube.com/channel/UCjdaTHKeNciWN1IzZExRXjg?view_as=subscriber

Расшаренный код:

function getId(e){return document.getElementById(e)}function getCl(e){return document.getElementsByClassName(e)}function getTag(e){return document.getElementsByTagName(e)}function say(e){mode.cht.chatBuffer=[e],mode.updateChatText(e,mode.player.gpData.chat)}var cli=client;"sandbox"!=this.client.modeName&&"hideAndSeek"!=this.client.modeName&&(getTag("div")[111].style.opacity=".2");var keys={w:0,a:0,s:0,d:0,n1:0,n2:0,n3:0,n4:0,n5:0,n6:0,n8:0,nD:0,nP:0,nM:0},hack={up:"#3E4C5F",op:".3",numMin:.02,numMax:.08,WASD:11},ks=0,n=0;function createFragment(e){var a=document.createDocumentFragment(),t=document.createElement("div");for(t.innerHTML=e;t.firstChild;)a.appendChild(t.firstChild);return a}function setGrav(e){mode.player.gpData.p.gravityScale=e}function setGrav2(e){mode.player.gpData.p.world.gravity=e}function setColl(e){mode.player.gpData.p.collisionResponse=e}function setVel(e){mode.player.gpData.p.velocity=e}function hide(e){e.style.display="none"}function show(e){e.style.display="block"}function god(e){mode.player.gpData.p.shapes[0].ref.refP.setMass(e)}function tpTo(e){e?"sandbox"!=this.client.modeName&&"hideAndSeek"!=this.client.modeName&&(mode.player.gpData.p.position[1]=mode.exitGate.exitGateCounter.refP.p.position[1],mode.player.gpData.p.position[0]=mode.exitGate.exitGateCounter.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0):(mode.player.gpData.p.position[1]=mode.spawn.refP.p.position[1],mode.player.gpData.p.position[0]=mode.spawn.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0)}"sandbox"!=this.client.modeName&&"hideAndSeek"!=this.client.modeName&&null!=document.querySelector("#startTime")&&document.querySelector("#startTime").remove(),txt="<style>.window{z-index:10;position:fixed;border-radius:1px;position:fixed;font-family:Verdana;color:#BFCFD2;background:#000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:16px;cursor:default}.window-title{padding:7px 8px 5px 10px;color:#e1eff0;background:#3e4c5f}.icon{height:1em;vertical-align:-12%;pointer-events:none;margin-right:4px}.window-content{width:100%;height:100%;padding:15px 20px}.winContent{width:100%;height:100%;padding-right:10px;overflow-y:auto;overflow-x:hidden}.winContent::-webkit-scrollbar{width:10px}.winContent::-webkit-scrollbar-track{border:2px solid #3e4c5f}.winContent::-webkit-scrollbar-thumb{background-color:#3e4c5f}.window-log-message{padding:8px 0}.hr{border-color:#AAA;background-color:#AAA}.form{margin-top:10px;position:absolute;width:97%;height:21px;padding:5px 0px 5px 7px;display:inline-block;border:2px solid #CCC;background:#000}.txta{outline:none;color:#FFF;background:#000;border:none;width:85%}.txta::selection{background:#7700CC}.button{display:inline-block;text-align:center;color:#e1eff0;width:210px;padding:4px 0;border:1px solid rgba(191,207,210,.5);background-color:rgba(191,207,210,.1);border-radius:1px;cursor:pointer;transition:.2s;font-size:18px;font-weight:700}.button:hover{background-color:rgba(191,207,210,.2);border:1px solid rgba(191,207,210,.7)}.button:active{background-color:rgba(191,207,210,.5);border:1px solid rgba(191,207,210,1)}.checkbox1{display:none}.Check1{position:relative;width:10px;height:10px;border:2px solid #CCC}.Check1,.label{display:inline-block;vertical-align:middle;background:#000}.checkbox1:checked + .Check1::before{content:'';display:block;position:absolute;top:2px;right:2px;bottom:2px;left:2px;background:#0C0}</style><div class='window'style='width:650px'><div class='window-title'>Console</div><div style='padding:2px;margin-top:2px;position:absolute'>Last command: <b id='lastCMD'style='background:#394045;padding:2px'></b></div><br><div style='padding:2px;margin-top:10px;position:absolute'>Result: <b id='lastRES'style='background:#394045;padding:2px'></b></div><br><div class='form'style='margin-top:20px'><span style='color:#FFF'>> </span><input id='inp1'class='txta'onclick='this.focus()'maxlength='1000'></div><hr class='hr'style='margin-top:65px;height:1px'><div style='padding:2px;margin-top:2px;position:absolute'>Server: <b style='background:#394045;padding:2px'id='sv'></b></div><br><div style='padding:2px;margin-top:10px;position:absolute'>Mode: <b style='background:#394045;padding:2px'id='md'></b></div><label style='margin-top:40px;display:block;background:#222;padding-bottom:5px'><input class='checkbox1'type='checkbox'id='lpo'checked><span class='Check1'></span><span style='background:#222'class='label'>Loop</span></label><div class='button'id='ae'style='width:99.7%;color:#F00'>Auto execution</div><div class='window-content'style='width:400px;height:0'><div class='winContent'></div></div></div>",document.body.insertBefore(createFragment(txt),document.body.childNodes[0]),getId("sv").innerHTML=client.roomId,getId("md").innerHTML=cli.modeName,getId("lastCMD").onclick=function(){getTag("input")[0].value+=getId("lastCMD").innerHTML},getId("lastRES").onclick=function(){getTag("input")[0].value+=getId("lastRES").innerHTML};var aev=0;getId("ae").onclick=function(){getId("ae").style.color=aev?"#F00":"#0F0",aev=!aev};var scale=1;function fixEvent(e){if(null==(e=e||window.event).pageX&&null!=e.clientX){var a=document.documentElement,t=document.body;e.pageX=e.clientX+(a&&a.scrollLeft||t&&t.scrollLeft||0)-(a.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||t&&t.scrollTop||0)-(a.clientTop||0)}return!e.which&&e.button&&(e.which=1&e.button?1:2&e.button?3:4&e.button?2:0),e}document.onmousewheel=function(e){e.deltaY<0&&(scale+=.05,getCl("window")[0].style.transform="scale("+scale+")"),0<e.deltaY&&(scale-=.05,getCl("window")[0].style.transform="scale("+scale+")"),scale<.1&&(scale=.1),1.5<scale&&(scale=1.5)},getCl("window")[0].style.borderLeft="1px solid "+hack.up,getCl("window")[0].style.borderRight="1px solid "+hack.up,getCl("window")[0].style.borderBottom="1px solid "+hack.up,getCl("window-title")[0].style.background=hack.up;var dragMaster=function(){var dragObject,mouseOffset;function getMouseOffset(e,a){var t=getPosition(e);return{x:a.pageX-t.x,y:a.pageY-t.y}}function mouseUp(){dragObject=null,document.onmousemove=null,document.onmouseup=null,document.ondragstart=null,document.body.onselectstart=null}function mouseMove(e){with(e=fixEvent(e),dragObject.style)position="fixed",top=e.pageY-mouseOffset.y+"px",left=e.pageX-mouseOffset.x+"px";return!1}function mouseDown(e){if(1==(e=fixEvent(e)).which)return mouseOffset=getMouseOffset(dragObject=this,e),document.onmousemove=mouseMove,document.onmouseup=mouseUp,document.ondragstart=function(){return!1},!(document.body.onselectstart=function(){return!1})}return{makeDraggable:function(e){e.onmousedown=mouseDown}}}(),lc;function getPosition(e){for(var a=0,t=0;e.offsetParent;)a+=e.offsetLeft,t+=e.offsetTop,e=e.offsetParent;return{x:a+=e.offsetLeft,y:t+=e.offsetTop}}function tpName(e){for(var a=0;a<mode.player.gpData.g.parent.children.length;a++)void 0!==mode.player.gpData.g.parent.children[a].ref.name&&mode.player.gpData.g.parent.children[a].ref.name.getText()==e&&(mode.player.gpData.p.position[0]=mode.player.gpData.g.parent.children[a].ref.p.position[0],mode.player.gpData.p.position[1]=mode.player.gpData.g.parent.children[a].ref.p.position[1])}function chatName(e){for(var a=0;a<mode.player.gpData.g.parent.children.length;a++)void 0!==mode.player.gpData.g.parent.children[a].ref.name&&mode.player.gpData.g.parent.children[a].ref.name.getText()==e&&(getId("lastRES").innerHTML=mode.player.gpData.g.parent.children[a].ref.chat.getText())}getCl("window-title")[0].onmousedown=function(){dragMaster.makeDraggable(getCl("window")[0]),getCl("window")[0].style.opacity=hack.op},getCl("window-title")[0].onmouseup=function(){getCl("window")[0].onmousedown=null,getCl("window")[0].style.opacity=1},getId("lastRES").innerHTML="null",getId("lastCMD").innerHTML="null",getTag("input")[0].maxlength;var loopFunc=0;function prv(){getId("lastRES").innerHTML="null","nick:text "==getTag("input")[0].value.slice(0,10)&&(mode.player.gpData.name.setText(getTag("input")[0].value.slice(10,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(10,getTag("input")[0].maxlength)),"nick:color "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.name.setColor(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"nick:FS "==getTag("input")[0].value.slice(0,8)&&(""==getTag("input")[0].value.slice(8,getTag("input")[0].maxlength)?mode.player.gpData.name.setFontSize(1):(mode.player.gpData.name.setFontSize(Number(getTag("input")[0].value.slice(8,getTag("input")[0].maxlength))),getId("lastRES").innerHTML=getTag("input")[0].value.slice(8,getTag("input")[0].maxlength))),"nick:alpha "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.name.setAlpha(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"nick:angle "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.name.setAngle(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"chat:color "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.chat.setColor(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"chat:FS "==getTag("input")[0].value.slice(0,8)&&(""==getTag("input")[0].value.slice(8,getTag("input")[0].maxlength)?mode.player.gpData.chat.setFontSize(1):(mode.player.gpData.chat.setFontSize(Number(getTag("input")[0].value.slice(8,getTag("input")[0].maxlength))),getId("lastRES").innerHTML=getTag("input")[0].value.slice(8,getTag("input")[0].maxlength))),"chat:alpha "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.chat.setAlpha(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"chat:angle "==getTag("input")[0].value.slice(0,11)&&(mode.player.gpData.chat.setAngle(getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(11,getTag("input")[0].maxlength)),"grav "==getTag("input")[0].value.slice(0,5)&&(mode.player.gpData.p.gravityScale=Number(getTag("input")[0].value.slice(5,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(5,getTag("input")[0].maxlength)),"gravArr "==getTag("input")[0].value.slice(0,8)&&(mode.player.gpData.p.world.gravity=eval(eval("getTag('input')[0].value.slice(8,getTag('input')[0].maxlength)")),getId("lastRES").innerHTML=getTag("input")[0].value.slice(8,getTag("input")[0].maxlength)),"getGrav"==getTag("input")[0].value.slice(0,7)&&(getId("lastRES").innerHTML="-9.779999732971191"),"goTo "==getTag("input")[0].value.slice(0,5)&&(mode.player.gpData.p.position=eval(eval("getTag('input')[0].value.slice(5,getTag('input')[0].maxlength)")),getId("lastRES").innerHTML=getTag("input")[0].value.slice(5,getTag("input")[0].maxlength)),"getPos"==getTag("input")[0].value.slice(0,6)&&(getId("lastRES").innerHTML=mode.player.gpData.p.position),"damp "==getTag("input")[0].value.slice(0,5)&&(mode.player.gpData.p.damping=Number(getTag("input")[0].value.slice(5,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(5,getTag("input")[0].maxlength)),"say "==getTag("input")[0].value.slice(0,4)&&(say(getTag("input")[0].value.slice(4,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(4,getTag("input")[0].maxlength)),"tpName "==getTag("input")[0].value.slice(0,7)&&(tpName(getTag("input")[0].value.slice(7,getTag("input")[0].maxlength)),getId("lastRES").innerHTML=getTag("input")[0].value.slice(7,getTag("input")[0].maxlength)),"chatName "==getTag("input")[0].value.slice(0,9)&&chatName(getTag("input")[0].value.slice(9,getTag("input")[0].maxlength)),lc=getTag("input")[0].value,getId("lastCMD").innerHTML=lc}var kd=0;document.onkeydown=function(e){var a=e.keyCode,t=e.shiftKey;getTag("input")[0]===document.activeElement&&13==a&&(prv(),kd=1),19==a&&(prv(),kd=1),t&&38==a&&(mode.moveUp=0,say("↟")),t&&40==a&&(mode.moveDown=0,say("↡")),t&&37==a&&(mode.moveLeft=0,say("↞")),t&&39==a&&(mode.moveRight=0,say("↠")),27==a?(ks=!ks,console.log("%cЧиты на кнопках: "+ks,"background:#0000FF;color:#FFFF00")):ks&&(a=="W".charCodeAt()&&(keys.w=1,say(8)),a=="A".charCodeAt()&&(keys.a=1,say(8)),a=="S".charCodeAt()&&(keys.s=1,say(8)),a=="D".charCodeAt()&&(keys.d=1,say(8)),a=="Q".charCodeAt()&&(Object.defineProperty(mode,"ghost",{enumerable:!1,configurable:!0,writable:!1,value:!0}),mode.player.gpData.p.shapes[0].ref.refP.setMass(0),say(8)),a=="E".charCodeAt()&&(Object.defineProperty(mode,"ghost",{enumerable:!1,configurable:!0,writable:!1,value:!1}),mode.player.gpData.p.shapes[0].ref.refP.setMass(1),say(8)),35==a&&"sandbox"!=cli.modeName&&"hideAndSeek"!=cli.modeName&&(mode.player.gpData.p.position[1]=mode.exitGate.exitGateCounter.refP.p.position[1],mode.player.gpData.p.position[0]=mode.exitGate.exitGateCounter.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0),36==a&&(mode.player.gpData.p.position[1]=mode.spawn.refP.p.position[1],mode.player.gpData.p.position[0]=mode.spawn.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0),a=="Z".charCodeAt()&&(mode.player.gpData.p.gravityScale=-1,say(8)),a=="X".charCodeAt()&&(mode.player.gpData.p.gravityScale=1,say(8)),a=="I".charCodeAt()&&(mode.player.gpData.p.position[1]+=1.8,say(8)),a=="J".charCodeAt()&&(mode.player.gpData.p.position[0]-=1.8,say(8),mode.player.gpData.p.gravityScale=0,mode.player.gpData.p.velocity[1]=0),a=="K".charCodeAt()&&(mode.player.gpData.p.position[1]-=1.8,say(8)),a=="L".charCodeAt()&&(mode.player.gpData.p.position[0]+=1.8,say(8),mode.player.gpData.p.gravityScale=0,mode.player.gpData.p.velocity[1]=0),t&&a=="I".charCodeAt()&&(mode.player.gpData.p.position[1]+=3,say(8)),t&&a=="J".charCodeAt()&&(mode.player.gpData.p.position[0]-=3,mode.player.gpData.p.gravityScale=0,mode.player.gpData.p.velocity[1]=0,say(8)),t&&a=="K".charCodeAt()&&(mode.player.gpData.p.position[1]-=3,say(8)),t&&a=="L".charCodeAt()&&(mode.player.gpData.p.position[0]+=3,mode.player.gpData.p.gravityScale=0,mode.player.gpData.p.velocity[1]=0,say(8))),106==a?(say(8),n=!n,console.log("%cЧиты на NumPad'е: "+n,"background:#0000FF;color:#FF00FF")):n&&(111==a&&(keys.nD=1,say(8)),104==a&&(keys.n8=1,say(8)),101==a&&(keys.n5=1,say(8)),98==a&&(keys.n2=1,say(8)),97==a&&(keys.n1=1,say(8)),99==a&&(keys.n3=1,say(8)),100==a&&(keys.n4=1,say(8)),102==a&&(keys.n6=1,say(8)),103==a&&(Object.defineProperty(mode,"ghost",{enumerable:!1,configurable:!0,writable:!1,value:!0}),mode.player.gpData.p.shapes[0].ref.refP.setMass(0),say(8)),105==a&&(Object.defineProperty(mode,"ghost",{enumerable:!1,configurable:!0,writable:!1,value:!1}),mode.player.gpData.p.shapes[0].ref.refP.setMass(1),mode.player.gpData.p.shapes[0].ref.refP.setAlpha(1),say(8)),109==a&&(keys.nM=1,say(8)),107==a&&(keys.nP=1,say(8))),34==a&&(mode.player.gpData.p.collisionResponse=0),33==a&&(mode.player.gpData.p.collisionResponse=0,mode.player.gpData.p.gravityScale=-1)},document.onkeyup=function(e){var a=e.keyCode;ks&&(a=="W".charCodeAt()&&(keys.w=0),a=="A".charCodeAt()&&(keys.a=0),a=="S".charCodeAt()&&(keys.s=0),a=="D".charCodeAt()&&(keys.d=0)),13==a&&(kd=0),19==a&&(kd=0),n&&(111==a&&(mode.player.gpData.p.invMass=1,keys.nD=0),104==a&&(mode.player.gpData.p.invMass=1,keys.n8=0),101==a&&(mode.player.gpData.p.collisionResponse=1,keys.n5=0),98==a&&(mode.player.gpData.p.collisionResponse=1,keys.n2=0),97==a&&(mode.player.gpData.p.invMass=1,keys.n1=0),99==a&&(mode.player.gpData.p.invMass=1,keys.n3=0),100==a&&(mode.player.gpData.p.invMass=1,keys.n4=0),102==a&&(mode.player.gpData.p.invMass=1,keys.n6=0),109==a&&(keys.nM=0),107==a&&(keys.nP=0)),34==a&&(mode.player.gpData.p.collisionResponse=1),33==a&&(mode.player.gpData.p.collisionResponse=1,mode.player.gpData.p.gravityScale=1)};var prov=setInterval(function(){keys.w&&(mode.player.gpData.p.velocity[1]=hack.WASD),keys.a&&(mode.player.gpData.p.velocity[0]=-hack.WASD),keys.s&&(mode.player.gpData.p.velocity[1]=-hack.WASD),keys.d&&(mode.player.gpData.p.velocity[0]=hack.WASD),keys.nD&&(mode.player.gpData.p.position[1]+=hack.numMax,mode.player.gpData.p.invMass=0),keys.n8&&(mode.player.gpData.p.position[1]+=hack.numMin,mode.player.gpData.p.invMass=0),keys.n5&&(mode.player.gpData.p.collisionResponse=0,mode.player.gpData.p.position[1]-=hack.numMin),keys.n2&&(mode.player.gpData.p.collisionResponse=0,mode.player.gpData.p.position[1]-=hack.numMax),keys.n1&&(mode.player.gpData.p.position[0]-=hack.numMax,mode.player.gpData.p.invMass=0,mode.player.gpData.p.velocity[1]=0),keys.n3&&(mode.player.gpData.p.position[0]+=hack.numMax,mode.player.gpData.p.invMass=0,mode.player.gpData.p.velocity[1]=0),keys.n4&&(mode.player.gpData.p.position[0]-=hack.numMin,mode.player.gpData.p.invMass=0,mode.player.gpData.p.velocity[1]=0),keys.n6&&(mode.player.gpData.p.position[0]+=hack.numMin,mode.player.gpData.p.invMass=0,mode.player.gpData.p.velocity[1]=0),keys.nP&&"sandbox"!=cli.modeName&&"hideAndSeek"!=cli.modeName&&(mode.player.gpData.p.position[1]=mode.exitGate.exitGateCounter.refP.p.position[1],mode.player.gpData.p.position[0]=mode.exitGate.exitGateCounter.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0),keys.nM&&(mode.player.gpData.p.position[1]=mode.spawn.refP.p.position[1],mode.player.gpData.p.position[0]=mode.spawn.refP.p.position[0],mode.player.gpData.p.position[1]+=.5,mode.player.gpData.p.velocity[1]=0,mode.player.gpData.p.velocity[0]=0),loopFunc=getId("lpo").checked?1:0},0);!function e(){requestAnimationFrame(e),kd&&loopFunc&&prv(),aev&&prv()}();