r!PsAw small mod

autorespawn, copy party link, leave game, no privacy settings button, no apes.io advertisment

目前為 2024-08-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         r!PsAw small mod
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  autorespawn, copy party link, leave game, no privacy settings button, no apes.io advertisment
// @author       You
// @match        https://diep.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=diep.io
// @grant        none
// @license      MIT
// ==/UserScript==

//remove privacy settings button and apes.io promo
setTimeout(() => {
document.getElementById("cmpPersistentLink").remove();
document.getElementById("apes-io-promo").remove();
}, 2500);

//toggle leave game
let active = false;
let s = false;
let ingame_quit_btn = document.getElementById("quick-exit-game");
let app = document.getElementById("app");

function check_class(){
  if(ingame_quit_btn.classList.contains("shown")){
      active = false;
  }else if(ingame_quit_btn.classList.contains("hidden")){
      active = true;
  }
}

setInterval(check_class, 300);

var toggle_quit_btn = document.createElement('button');
toggle_quit_btn.innerHTML = `leave button active? ${active}`;
toggle_quit_btn.style.color = "white";
toggle_quit_btn.style.position = "fixed";
toggle_quit_btn.style.width = "100px";
toggle_quit_btn.style.height = "50px";
toggle_quit_btn.style.bottom = "20%";
toggle_quit_btn.style.left = "20%";
toggle_quit_btn.style.transform = "translate(-50%, 50%)";
toggle_quit_btn.style.cursor = "pointer";
toggle_quit_btn.style.zIndex = '9999';
toggle_quit_btn.onclick = function() {
   s = !s;
  toggle_quit_btn.innerHTML = `leave button active? ${active}`;
  if(s){
   ingame_quit_btn.classList.remove("hidden");
   ingame_quit_btn.classList.add("shown");
  }else{
   ingame_quit_btn.classList.remove("shown");
   ingame_quit_btn.classList.add("hidden");
  }
}

app.appendChild(toggle_quit_btn);

//autorespawn (easy way)
let ingamescreen = document.getElementById("in-game-screen");
let autorespawn = false;
function respawn(){
 if(autorespawn){
  if(ingamescreen.classList.contains("screen") && ingamescreen.classList.contains("active")){
   return;
  }else{
    let spawnbtn = document.getElementById("spawn-button");
    spawnbtn.click();
  }
 }
}

setInterval(respawn, 1000);

var toggle_auto_r_btn = document.createElement('button');
toggle_auto_r_btn.innerHTML = `auto respawn active? ${autorespawn}`;
toggle_auto_r_btn.style.color = "white";
toggle_auto_r_btn.style.position = "fixed";
toggle_auto_r_btn.style.width = "100px";
toggle_auto_r_btn.style.height = "50px";
toggle_auto_r_btn.style.bottom = "20%";
toggle_auto_r_btn.style.left = "25%";
toggle_auto_r_btn.style.transform = "translate(-50%, 50%)";
toggle_auto_r_btn.style.cursor = "pointer";
toggle_auto_r_btn.style.zIndex = '9999';
toggle_auto_r_btn.onclick = function() {
   autorespawn = !autorespawn;
   toggle_auto_r_btn.innerHTML = `auto respawn active? ${autorespawn}`;
}

app.appendChild(toggle_auto_r_btn);

//copy party link
var copy_p_link_btn = document.createElement('button');
copy_p_link_btn.innerHTML = `copy party link`;
copy_p_link_btn.style.color = "white";
copy_p_link_btn.style.position = "fixed";
copy_p_link_btn.style.width = "100px";
copy_p_link_btn.style.height = "50px";
copy_p_link_btn.style.bottom = "20%";
copy_p_link_btn.style.left = "30%";
copy_p_link_btn.style.transform = "translate(-50%, 50%)";
copy_p_link_btn.style.cursor = "pointer";
copy_p_link_btn.style.zIndex = '9999';
copy_p_link_btn.onclick = function() {
  document.getElementById("copy-party-link").click();
}

app.appendChild(copy_p_link_btn);