better than other splix hacks
当前为
// ==UserScript==
// @name splixHax Vbetter
// @namespace http://tampermonkey.net/
// @version 3.6
// @description better than other splix hacks
// @author You
// @match *://splix.io/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load',function(){
MAX_ZOOM=10000;
USERNAME_SIZE=6;
var defzm=BLOCKS_ON_SCREEN,zm=1;
window.addEventListener('wheel',function(e){
zm+=e.deltaY/Math.abs(e.deltaY)*.5;
if(defzm*zm>16000)zm-=.5;
if(defzm*zm<100)zm+=.5;
BLOCKS_ON_SCREEN=defzm*zm;
});
});
var myOldPlayer=null;
window.spectate=function(back){
if(typeof back!="undefined"&&back){
if(myOldPlayer==myPlayer)return;
myPlayer.isMyPlayer=false;
myOldPlayer.isMyPlayer=true;
myPlayer=myOldPlayer;
lstPlyrIndx=players.indexOf(myPlayer);
return;
}
if(lstPlyrIndx==-1)lstPlyrIndx=players.indexOf(myPlayer);
if(players.length<2)return "error: there is nobody else nearby to spectate";
players[lstPlyrIndx].isMyPlayer=false;
lstPlyrIndx+=1;
if(lstPlyrIndx>=players.length)lstPlyrIndx=0;
players[lstPlyrIndx].isMyPlayer=true;
myPlayer=players[lstPlyrIndx];
return 'now spectating "'+myPlayer.name+'"';
}
var lstPlyrIndx=-1,high=false,spam=false,dark=false,keyHandler=function(e){
if(document.activeElement.tagName=="input")return;
if(e.type.endsWith("n")){
switch(e.key){
case "p":
pressedKeys=[];
myPlayer.isMyPlayer=!myPlayer.isMyPlayer;
pressedKeys=[];
myPlayer.isMyPlayer=!myPlayer.isMyPlayer;
document.title="paused";
break;
case "y":
if(myOldPlayer==myPlayer)document.title=spectate();
break;
}
if("py".split("").includes(e.key)){
if(e.key=="y"?myOldPlayer==myPlayer:true)myPlayer.addHitLine(myPlayer.pos,myColorId);
resetTitle();
}
};
if(e.type.endsWith("p")){
switch(e.key){
case "h":
high=!high;
document.title="high mode "+(high?"en":"dis")+"abled";
break;
case "g":
spam=!spam;
document.title="spam mode "+(spam?"en":"dis")+"abled";
break;
case "f":
GLOBAL_SPEED=.006+(+(GLOBAL_SPEED==.006))*.001;
document.title="speed mode "+(GLOBAL_SPEED==.006?"en":"dis")+"abled";
break;
case "t":
dark=!dark;
document.title="dark mode "+(dark?"en":"dis")+"abled";
break;
case "y":
spectate(1);
myPlayer.addHitLine(myPlayer.pos,myColorId);
break;
}
if("hgft".split("").includes(e.key)){
myPlayer.addHitLine(myPlayer.pos,myColorId);
resetTitle();
}
}
};
function resetTitle(){setTimeout(()=>document.title="splix.io",3000);}
window.addEventListener('keydown',keyHandler);
window.addEventListener('keyup',keyHandler);
var tmpColId;
setInterval(()=>{if(myOldPlayer!=myPlayer)spectate();},3000);
setInterval(()=>{
if(myPlayer==null)return;
if(myOldPlayer==null)myOldPlayer=myPlayer;
tmpColId=myColorId;
while(myColorId==tmpColId)myColorId=Math.floor(Math.random()*13);
tmpColId=myColorId;
myPlayer.skinBlock=(high|!dark)?myColorId:13;
if(high)myColorId=13;
colorUI();
if(high)myColorId=tmpColId;
//make other players stoopid
players.filter(v=>v!=myPlayer&&!v.name.startsWith('[stoopid] ')&&v!=myOldPlayer).forEach(v=>v.name="[stoopid] "+v.name);
},1000);
setInterval(()=>{
if(myPlayer==null)return;
if(isConnectingWithTransition)myOldPlayer=myPlayer;
if(spam){
honkStart();
honkEnd();
myPlayer.addHitLine(myPlayer.pos,myColorId);
}
if(myPlayer.isDead){
if(myPlayer==myOldPlayer){
myPlayer.undoDie();
myPlayer.deathWasCertain=false;
doSkipDeathTransition();
}else{
spectate(1);
}
}
players.filter(v=>v.isMyPlayer==false).forEach(v=>{v.skinBlock=high?13:myColorId;});
if(high)myPlayer.die();
},1);
document.head.innerHTML+="<style>#playUI>*{transition:all .5s linear;}#miniMap{transform-origin:top left;transform:scale(1.25,1.25);}</style>";
})();