Greasy Fork

Greasy Fork is available in English.

splixHax Vbetter

better than other splix hacks

当前为 2019-04-18 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         splixHax Vbetter
// @namespace    http://tampermonkey.net/
// @version      11.7
// @description  better than other splix hacks
// @author       You
// @match        *://splix.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.serverSel=null;
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;
    });
    trackGameStart=function(){
      sendDir(4);
      setTimeout(()=>sendDir(4),0);
      setTimeout(()=>sendDir(4),125);
      setTimeout(()=>sendDir(4),250);
      setTimeout(()=>sendDir(4),375);
      setTimeout(()=>sendDir(4),500);
      myOldPlayer=myPlayer;
    };
    window.addEventListener("hashchange",function(){
      if("#"+serverSel.value!=window.location.hash)window.selUpd();
    },false);
    window.selUpd=()=>{
      serverSel.outerHTML="";
      setTimeout(async ()=>{
        while(!serversRequestDone)await new Promise(r=>setTimeout(r,1));
        window.createServerSelectPls();
      },100);
    };
    formElem.appendChild(document.createElement("BR"));
    window.createServerSelectPls=function(){
      window.serverSel=document.createElement("SELECT");
      serverSel.className="fancyBox inputFancy";
      var tobesrvselectinnerhtml='<option value="" hidden disabled selected>'+(selectedGamemode.startsWith("N")?('Select a server... (Current: '+(window.location.hash.length<2?'Auto':window.location.hash.slice(1))+')</option><option value="">Auto'):'Possible Servers: ')+'</option>';
      serverSel.onchange=function(){if(serverSel.value==""){history.replaceState(null,null,' ');}else{window.location.hash=serverSel.value;}};
      formElem.appendChild(serverSel);
      window.servers.forEach((srv,indx)=>{
        tobesrvselectinnerhtml+='<option value="'+srv.gamemodes[selectedGamemode.startsWith("N")?0:1].versions[0].lobbies[0].hash+'"'+(selectedGamemode.startsWith("N")?"":" disabled")+'>'+srv.gamemodes[selectedGamemode.startsWith("N")?0:1].versions[0].lobbies[0].hash+' ('+srv.loc+')</option>';
        if(indx+1==window.servers.length)serverSel.innerHTML=tobesrvselectinnerhtml;
      });
    };
    (async ()=>{
      while(!serversRequestDone)await new Promise(r=>setTimeout(r,1));
      window.createServerSelectPls();
    })();
});
    window.myOldPlayer=null;
    window.macroMaker=function(k,s){
      if(typeof k=="undefined"||typeof s=="undefined")return "1st arg=array of nums (see desc. for more info), 2nd arg=milliseconds between presses";
      for(var i=0;i<k.length;i++){
        if(k[i]==5){
          setTimeout(()=>{honkStart();honkEnd();},s*i);
        }else if(k[i]==6){
          //do nothing
        }else{
          setTimeout(a=>sendDir(a),s*i,k[i]);
        }
      }
    };
    window.spectate=function(back){
      pressedKeys=[];
      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.trails=[];
      myPlayer=players[lstPlyrIndx];
      myPlayer.trails=[];
      return 'now spectating "'+myPlayer.name+'"';
    }
    var lstPlyrIndx=-1,high=false,spam=false,dark=false,keyHandler=function(e){
        if(e.keyCode>=112&&e.keyCode<=121&&e.keyCode!=116)return e.preventDefault();
        if(document.activeElement.tagName=="input")return;
        if(e.type.endsWith("n")){
            switch(e.key){
              case "y":
              if(myOldPlayer==myPlayer){
                document.title=spectate();
                sendDir(4);
              }
              break;
            }
            if("y".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))*.00075;
                    document.title="speed mode "+(GLOBAL_SPEED==.006?"dis":"en")+"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();
            }
        }
    };
    var setTitleInterval=-1;
    function resetTitle(){
      clearInterval(setTitleInterval);
      setTitleInterval=setTimeout(()=>{
        document.title="splix.io";
        setTitleInterval=-1;
      },3000);
    }
    window.addEventListener('keydown',keyHandler);
    window.addEventListener('keyup',keyHandler);
    var tmpColId;
    setInterval(()=>{if(!isConnectingWithTransition&&myPlayer!=null&&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;
            //toggleUglyMode();
          }
          //make other players stoopid
          players.filter(v=>v!=myPlayer&&!v.name.startsWith('[stoopid] ')&&v!=myOldPlayer).forEach(v=>v.name="[stoopid] "+v.name);
          players.filter(v=>v!=myPlayer&&v!=myOldPlayer).forEach(v=>{v.skinBlock=high?13:myColorId;});
    },1000);
        var prevGameMode=null;
    setInterval(async ()=>{
        if(selectedGamemode==null)return;
        if(prevGameMode==null)prevGameMode=selectedGamemode;
        if(prevGameMode!=selectedGamemode){
          prevGameMode=selectedGamemode;
          window.selUpd();
        }
        if(myPlayer==null)return;
        if(myOldPlayer==null||(myPlayer!=myOldPlayer&&myPlayer.id==myOldPlayer.id))myOldPlayer=myPlayer;
        if(spam){
            honkStart();
            honkEnd();
        }
        if(myPlayer.isDead){
          if(myPlayer==myOldPlayer){
            if(myPlayer.deathWasCertain)sendDir(4);
            myPlayer.undoDie();
            myPlayer.deathWasCertain=false;
            //doSkipDeathTransition();
          }else if(myOldPlayer.isDead){
            //myOldPlayer=myPlayer=null;
            setTimeout(()=>myOldPlayer=myPlayer=null,100);
            myPlayer.undoDie();
            //myPlayer.deathWasCertain=false;
            spectate(1);
            if(myPlayer.deathWasCertain)sendDir(4);
            myPlayer.deathWasCertain=false;
          }else{spectate();}
        }
        if(high)myPlayer.die();
        if(myPlayer!=myOldPlayer)pressedKeys=[];
        clearTimeout(deathTransitionTimeout);
        if(pressedKeys.includes(27))doTransition("Despacito",true,null,()=>{window.setTimeout(afterDeath,250);onClose();resetAll();},true);
    },0);
    document.head.innerHTML+="<style>#playUI>*{transition:all .5s linear;}#miniMap{transform-origin:top left;transform:scale(1.25,1.25);}</style>";
})();