您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
autorespawn, redrawing player + upgrade tree, copy party link, leave game, no privacy settings button, no apes.io advertisment, net_predict_movement false
当前为
// ==UserScript== // @name r!PsAw small mod // @namespace http://tampermonkey.net/ // @version 0.0.4 // @description autorespawn, redrawing player + upgrade tree, copy party link, leave game, no privacy settings button, no apes.io advertisment, net_predict_movement false // @author You // @match https://diep.io/* // @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io // @grant none // @license MIT // ==/UserScript== let script_boolean = true; // Mouse coordinates var uwuX = '0'; var uwuY = '0'; document.addEventListener('mousemove', function(e) { uwuX = e.clientX; uwuY = e.clientY; }); //net_predict_movement false window.addEventListener("load", (event) => { input.execute("net_predict_movement false"); }); //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; let ar_mode = "normal";//change normal to bonus, if you want to collect extra levels function respawn(){ if(autorespawn){ if(ingamescreen.classList.contains("screen") && ingamescreen.classList.contains("active")){ return; }else{ if(ar_mode === "normal"){ let spawnbtn = document.getElementById("spawn-button"); spawnbtn.click(); }else if(ar_mode === "bonus"){ //this clicks on +level for watching ad button. However there must be some cooldown, which prevents from user spamming on it, so I won't continue working on that let ad_btn = document.getElementById("game-over-video-ad"); ad_btn.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.backgroundColor = "red"; 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}`; if(autorespawn){ toggle_auto_r_btn.style.backgroundColor = "green"; }else{ toggle_auto_r_btn.style.backgroundColor = "red"; } } 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); //find the current Level CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, { apply(fillRect, ctx, [text, x, y, ...blah]) { if (text.startsWith('Lvl ')) { currentLevel = text.split(' ')[1]; if(text.split(' ')[3] != undefined){ tanky = text.split(' ')[2] + text.split(' ')[3]; }else{ tanky = text.split(' ')[2] } } fillRect.call(ctx, text, x, y, ...blah); } }); //Diep Units & fov calculator //NOTE: I removed spaces between tank names for this script only. Also since glider came out and diepindepth was unupdated it didn't update correctly, I fixed that. /* bugs that I need to fix: - window.resize doesn't check if canvas size changes, but only if the user changes it. - when entering fullscreen, following things happen: -> text is acting weird -> coordinates don't sync -> but the scaling changes correctly - press 2 keys at the same time For example opening google console changes canvas size, but user didn't change the window. Useful info: -shape sizes: tank lvl 1 size = 53 diep units grid square side length = 50 diep units square, triangle = 55 diep units pentagon = 75 diep units small crasher = 35 diep units big crasher = 55 diep units alpha pentagon = 200 diep units - */ var currentLevel = 0; var lastLevel = 0; var tanky = ""; let ripsaw_radius; let fieldFactor = 1.0; let found = false; let loltank ;let lolztank; let diepUnits = 53 * (1.01 ** (currentLevel - 1)); let FOV = (0.55 * fieldFactor) / Math.pow(1.01, (currentLevel - 1) / 2); let scalingFactor = FOV * windowScaling(); const fieldFactors = [ {tank: "Sniper", factor: 0.899}, {tank: "Overseer", factor: 0.899}, {tank: "Overlord", factor: 0.899}, {tank: "Assassin", factor: 0.8}, {tank: "Necromancer", factor: 0.899}, {tank: "Hunter", factor: 0.85}, {tank: "Stalker", factor: 0.8}, {tank: "Ranger", factor: 0.699}, {tank: "Manager", factor: 0.899}, {tank: "Predator", factor: 0.85}, {tank: "Trapper", factor: 0.899}, {tank: "GunnerTrapper", factor: 0.899}, {tank: "Overtrapper", factor: 0.899}, {tank: "MegaTrapper", factor: 0.899}, {tank: "Tri-Trapper", factor: 0.899}, {tank: "Smasher", factor: 0.899}, {tank: "Landmine", factor: 0.899}, {tank: "Streamliner", factor: 0.85}, {tank: "AutoTrapper", factor: 0.899}, {tank: "Battleship", factor: 0.899}, {tank: "AutoSmasher", factor: 0.899}, {tank: "Spike", factor: 0.899}, {tank: "Factory", factor: 0.899}, {tank: "Skimmer", factor: 0.899}, {tank: "Glider", factor: 0.899}, {tank: "Rocketeer", factor: 0.899}, ] function windowScaling() { const a = canvas.height / 1080; const b = canvas.width / 1920; return b < a ? a : b; } function calculateFOV(Fv, l) { const numerator = 0.55 * Fv; const denominator = Math.pow(1.01, (l - 1) / 2); FOV = numerator / denominator; return FOV; } function apply_values(FF){ calculateFOV(FF, currentLevel); scalingFactor = FOV * windowScaling(); ripsaw_radius = diepUnits * scalingFactor; diepUnits = 53 * (1.01 ** (currentLevel - 1)); } function apply_changes(value){ if(found){ fieldFactor = fieldFactors[value].factor; loltank = tanky; lastLevel = currentLevel; apply_values(fieldFactor); }else{ if(value === null){ fieldFactor = 1.0; loltank = "default"; lolztank = tanky; lastLevel = currentLevel; apply_values(fieldFactor); } } } function bruteforce_tanks(){ for (let i = 0; i < fieldFactors.length; i++){ if(tanky.includes(fieldFactors[i].tank)){ found = true; console.log("FOUND TANK " + fieldFactors[i].tank); apply_changes(i); break; }else{ found = false; if(i < fieldFactors.length - 1){ console.log(`checking tank ${i}`); }else{ console.log("No Tank was found, resetting to default") apply_changes(null); } } } } window.addEventListener("resize", bruteforce_tanks); function check_lvl_change() { if(lastLevel === currentLevel){ //console.log("level wasn't changed"); }else{ console.log("changed level, bruteforcing"); bruteforce_tanks(); } } function check_change(){ //console.log("lastLevel: " + lastLevel + " currentLevel: " + currentLevel); check_lvl_change(); if(loltank != tanky){ if(loltank === "default"){ if(lolztank != tanky){ bruteforce_tanks(); }else{ return; } }else{ bruteforce_tanks(); } } } setInterval(check_change, 250); //canvas gui let offsetX = 0; let offsetY = 0; //for canvas text height and space between it let text_startingY = 450*windowScaling();let textAdd = 25*windowScaling(); const boxes = [ {color: "lightblue", LUcornerX: 47, LUcornerY: 67}, {color: "green", LUcornerX: 47+90+13, LUcornerY: 67}, {color: "red", LUcornerX: 47, LUcornerY: 67+90+9}, {color: "yellow", LUcornerX: 47+90+13, LUcornerY: 67+90+9}, {color: "blue", LUcornerX: 47, LUcornerY: 67+((90+9)*2)}, {color: "rainbow", LUcornerX: 47+90+13, LUcornerY: 67+((90+9)*2)} ] const ctx = canvas.getContext('2d'); function ctx_text(fcolor, scolor, lineWidth, font, text, textX, textY){ ctx.fillStyle = fcolor; ctx.lineWidth = lineWidth; ctx.font = font; ctx.strokeStyle = scolor; ctx.strokeText(`${text}`, textX, textY) ctx.fillText(`${text}`, textX, textY) } function ctx_arc(x, y, r, sAngle, eAngle, counterclockwise, c){ ctx.beginPath(); ctx.arc(x, y, r, sAngle, eAngle, counterclockwise); ctx.fillStyle = c; ctx.fill(); } //use this for game entities function dot_in_diepunits(diepunits_X, diepunits_Y){ ctx_arc(diepunits_X * scalingFactor, diepunits_Y * scalingFactor, 5, 0, 2 * Math.PI, false, "lightblue"); } //use this for ui elements like upgrades or scoreboard function dot_in_diepunits_FOVless(diepunits_X, diepunits_Y){ ctx_arc(diepunits_X * windowScaling(), diepunits_Y * windowScaling(), 5, 0, 2 * Math.PI, false, "lightblue"); } function square_for_grid(x, y, a, b, color){ ctx.beginPath(); ctx.rect(x*windowScaling(), y*windowScaling(), a*windowScaling(), b*windowScaling()); ctx.strokeStyle = color; ctx.stroke(); } function draw_upgrade_grid(){ //console.log("started grid"); for(let i = 0; i < boxes.length; i++){ let start_x = (boxes[i].LUcornerX*windowScaling())/2; let start_y = (boxes[i].LUcornerY*windowScaling())/2; let end_x = ((boxes[i].LUcornerX+43*2)*windowScaling())/2; let end_y = ((boxes[i].LUcornerY+43*2)*windowScaling())/2; //console.log("start_x, start_y, end_x, end_y "+ start_x + " " + start_y + " " + end_x + " " + end_y) let temp_color = "black"; if(uwuX > start_x && uwuY > start_y && uwuX < end_x && uwuY < end_y){ temp_color = "red"; }else{ temp_color = "black"; } square_for_grid(boxes[i].LUcornerX, boxes[i].LUcornerY, 86, 86, temp_color); } for(let i = 0; i < boxes.length; i++){ //console.log(boxes[i].LUcornerX); dot_in_diepunits_FOVless(boxes[i].LUcornerX, boxes[i].LUcornerY); dot_in_diepunits_FOVless(boxes[i].LUcornerX+43, boxes[i].LUcornerY); dot_in_diepunits_FOVless(boxes[i].LUcornerX+43*2, boxes[i].LUcornerY); dot_in_diepunits_FOVless(boxes[i].LUcornerX+43*2, boxes[i].LUcornerY+43); dot_in_diepunits_FOVless(boxes[i].LUcornerX+43*2, boxes[i].LUcornerY+43*2); dot_in_diepunits_FOVless(boxes[i].LUcornerX, boxes[i].LUcornerY+43); dot_in_diepunits_FOVless(boxes[i].LUcornerX, boxes[i].LUcornerY+43*2); dot_in_diepunits_FOVless(boxes[i].LUcornerX+43, boxes[i].LUcornerY+43); } //console.log("stopped grid"); } setTimeout(() => { let gui = () => { if(script_boolean){ if(ingamescreen.classList.contains("screen") && ingamescreen.classList.contains("active")){ ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "canvas Lvl:" + currentLevel, canvas.width/20 + 10, text_startingY + (textAdd*0)); ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "canvas tank: " + tanky, canvas.width/20 + 10, text_startingY + (textAdd*1)); ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "radius: " + ripsaw_radius, canvas.width/20 + 10, text_startingY + (textAdd*2)); ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "field Factor: " + fieldFactor, canvas.width/20 + 10, text_startingY + (textAdd*3)); ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "diep Units: " + diepUnits, canvas.width/20 + 10, text_startingY + (textAdd*4)); ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "Fov: " + FOV, canvas.width/20 + 10, text_startingY + (textAdd*5)); //ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "realX: " + uwuX + "realY: " + uwuY + "newX: " + uwuX*windowScaling() + "newY: " + uwuY*windowScaling(), uwuX*2, uwuY*2); //points at mouse ctx_arc(uwuX*2, uwuY*2, 5, 0, 2 * Math.PI, false, "purple"); //coords at mouse ctx_text("white", "DarkRed", 6, 1.5 + "em Ubuntu", "realX: " + uwuX*2 + "realY: " + uwuY*2, uwuX*2, uwuY*2); if(currentLevel != null && tanky != null){ ctx.beginPath(); ctx.moveTo(canvas.width / 2 + offsetX, canvas.height / 2 + offsetY); ctx.lineTo(uwuX*2, uwuY*2); ctx.stroke(); ctx_arc(canvas.width / 2 + offsetX, canvas.height / 2 + offsetY, ripsaw_radius, 0, 2 * Math.PI, false, "darkblue"); ctx_arc(canvas.width / 2 + offsetX, canvas.height / 2 + offsetY, ripsaw_radius*0.9, 0, 2 * Math.PI, false, "lightblue"); draw_upgrade_grid(); }; } } window.requestAnimationFrame(gui); } gui(); setTimeout(() => { gui(); },5000); }, 1000); //turn off script document.onkeydown = function(e) { if(e.keyCode === 74){ //J script_boolean = !script_boolean; } } // Handle key presses for moving the center UNFINISHED /* function return_to_center(XorY, posOrNeg){ console.log("function called with: " + XorY + posOrNeg); if(XorY === "x"){ if(posOrNeg === "pos"){ while(offsetX < 0){ offsetX += 0.5*scalingFactor; } }else if(posOrNeg === "neg"){ while(offsetX > 0){ offsetX -= 0.5*scalingFactor; } }else{ console.log("invalid posOrNeg at return_to_center();") } }else if(XorY === "y"){ if(posOrNeg === "pos"){ while(offsetY < 0){ offsetY += 0.5*scalingFactor; } }else if(posOrNeg === "neg"){ while(offsetY > 0){ offsetY -= 0.5*scalingFactor; } }else{ console.log("invalid posOrNeg at return_to_center();") } }else{ console.log("invalid XorY at return_to_center();"); } } document.onkeydown = function(e) { switch (e.keyCode) { case 87: // 'W' key console.log("W"); if(offsetY >= -87.5*scalingFactor){ offsetY -= 12.5*scalingFactor; } break case 83: // 'S' key console.log("S"); if(offsetY <= 87.5*scalingFactor){ offsetY += 12.5*scalingFactor; } break; case 68: // 'D' key console.log("D"); if(offsetX <= 87.5*scalingFactor){ offsetX += 12.5*scalingFactor; } break case 65: // 'A' key console.log("A"); if(offsetX >= -87.5*scalingFactor){ offsetX -= 12.5*scalingFactor; } break } } document.onkeyup = function(e) { switch (e.keyCode) { case 87: // 'W' key console.log("W unpressed"); return_to_center("y", "pos"); break case 83: // 'S' key console.log("S unpressed"); return_to_center("y", "neg"); break; case 68: // 'D' key console.log("D unpressed"); return_to_center("x", "neg"); break case 65: console.log("A unpressed"); return_to_center("x", "pos"); } } */