respawn script for tricksplit.io

instantly respawn with a press of a button

目前為 2020-07-23 提交的版本,檢視 最新版本

// ==UserScript==
// @name         respawn script for tricksplit.io
// @namespace    http://tampermonkey.net/
// @version      2.3
// @description  instantly respawn with a press of a button
// @author       sos
// @match        https://tricksplit.io/v3/
// @grant        none
// ==/UserScript==
window.addEventListener('keydown', keydown);
window.addEventListener('keydown', keydown2);
window.addEventListener('keydown', keydown3);
window.addEventListener('keyup', keyup);
var menu = document.getElementsByClassName('_1WFOVxzGRMuYJNrV60dtbj _2RXX28My_mpEKTc7Qy5FvV');
var endPanel = document.getElementsByClassName('_1WFOVxzGRMuYJNrV60dtbj _1d7K856ppytFaFYuKq61hT');
//var closePanel = document.getElementsByClassName('closePanel');
var chatInput = document.getElementsByClassName('chatInput');
var isTyping = false;
window.onload = function(){
    //closePanel[0].click(); // automaticlly closes the newSkins window at the start of the game
    window.game.animationDelay = 55; // Set this to any animation delay you want, !WARNING! if you set the animation delay below 1, your game is not gonna work
    setTimeout(startCollection, 5000);
    chatInput[0].oninput = () => {
      isTyping = true;
    }

};

function startCollection() {
    var freeCoins = document.getElementsByClassName('_2TqqNMdkvf0Ja5mSs0amuX');
    freeCoins[0].onclick = function() {
        console.log('auto coins collection started');
        window.self.API.claimFreeCoins();
        setInterval(collectCoins, 7210000);
    }
}


function collectCoins() {

   window.self.API.claimFreeCoins();

}
function keydown3(event) {
    if (event.keyCode == 27) {
        menu[0].style.display = "flex";
    }
}
function keydown2(event) {
        if (event.keyCode == 13) {
           isTyping = false;
        }
}
    function keydown(event) {
        if (event.keyCode == 68) { // 68 is equal to the key D if you want to change it then look at the link at the end of the script for the list of key codes numbers
            if (isTyping === false) {
                setTimeout(spawn, 100);
            }
        }
    }
function keyup(event) {
    if (event.keyCode == 68) { // 68 is equal to the key D if you want to change it then look at the link at the end of the script for the list of key codes numbers
        return;
    }
}


function spawn() {
   if (menu[0].style.display !== "none" || menu[0].style.display === "none" && isTyping === false) {
          window.tricksplit.client.socket.webSocket.close();
          if (endPanel[0].style.display !== "none" || document.getElementsByClassName('_1WFOVxzGRMuYJNrV60dtbj _2RXX28My_mpEKTc7Qy5FvV')[0].style.display !== "none") {
              endPanel[0].style.display = "none"
              document.getElementsByClassName('_1WFOVxzGRMuYJNrV60dtbj _2RXX28My_mpEKTc7Qy5FvV')[0].style.display = "none"
          }
          menu[0].style.display = "flex";
          setTimeout(spawn2, 3000);
   }
}
function spawn2() {
       window.tricksplit.spawn();
}


//     https://docstore.mik.ua/orelly/webprog/DHTML_javascript/0596004672_jvdhtmlckbk-app-b.html     \\ Link for key codes numbers