您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/456843/1130312/diep_Shortcut.js
// ==UserScript== // @name diep_Shortcut // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author tariteur // @match https://diep.io/ // @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io // @grant none // ==/UserScript== (() => { const { backgroundOverlay, overlay } = window.diepAPI.tools; const { Vector } = window.diepAPI.core; const { scaling, player, game, minimap, arena } = window.diepAPI.apis; const ctx2 = backgroundOverlay.ctx; const ctx = overlay.ctx; const _window = 'undefined' == typeof unsafeWindow ? window : unsafeWindow; if (_window.diep_Shortcut) return; //diepAPI start var diep_Shortcut; /******/ (() => { // webpackBootstrap /******/ 'use strict'; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for (var key in definition) { /******/ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { core: () => /* reexport */ core_namespaceObject, }); // NAMESPACE OBJECT: ./src/core/index.ts var core_namespaceObject = {}; __webpack_require__.r(core_namespaceObject); __webpack_require__.d(core_namespaceObject, { Canvas: () => Canvas, }); function toMinimapPosition(vector) { var unscale = arena.unscale(vector); var minimapPos = Vector.multiply(minimap.minimapDim, unscale); return Vector.add(minimap.minimapPos, minimapPos); } const textShadow = 'text-shadow:black 0.18vh 0, black -0.18vh 0, black 0 -0.18vh, black 0 0.18vh, black 0.18vh 0.18vh, black -0.18vh 0.18vh, black 0.18vh -0.18vh, black -0.18vh -0.18vh, black 0.09vh 0.18vh, black -0.09vh 0.18vh, black 0.09vh -0.18vh, black -0.09vh -0.18vh, black 0.18vh 0.09vh, black -0.18vh 0.09vh, black 0.18vh -0.09vh, black -0.18vh -0.09vh' class CANVAS { GUI_create(id, Class, text, x, y,width, height, color, callback) { // Créer l'élément de l'interface graphique const guiElement = document.createElement('button'); guiElement.id = id; guiElement.classList.add(Class); guiElement.innerHTML = text; guiElement.style.top = x; guiElement.style.left = y; guiElement.style.backgroundColor = color; guiElement.style.textShadow = textShadow; guiElement.style.position = 'absolute'; guiElement.style.width = width+"vw"; guiElement.style.height = height+"vh"; // Appliquer les styles supplémentaires guiElement.style.borderRadius = '0.5vw'; guiElement.style.fontFamily = 'Ubuntu'; guiElement.style.opacity = '60%'; guiElement.style.color = '#FFFFFF'; guiElement.style.fontStyle = 'normal'; guiElement.style.fontSize = '0.9vw'; guiElement.addEventListener('mouseover', function() { guiElement.style.opacity = '100%' }); guiElement.addEventListener('mouseout', function() { guiElement.style.opacity = '60%' }); guiElement.addEventListener('click', callback); // Append the GUI element to the body of the document document.body.appendChild(guiElement); } GUI_changeName(id, text) { const element = document.getElementById(id); element.innerHTML = text; } GUI_hide_or_showID(id, truefalse) { const element = document.getElementById(id); if (truefalse == undefined) { if (element.style.display === 'none') { element.style.display = 'block'; } else { element.style.display = 'none'; } } else if (truefalse == true) { element.style.display = 'block'; } else if (truefalse == false) { element.style.display = 'none'; } } GUI_hide_or_showClass(Class, truefalse) { const elements = document.querySelectorAll(Class); for (const element of elements) { if (truefalse == undefined) { if (element.style.display === 'none') { element.style.display = 'block'; } else { element.style.display = 'none'; } } else if (truefalse == true) { element.style.display = 'block'; } else if (truefalse == false) { element.style.display = 'none'; } } } GUI_delete(id) { const element = document.getElementById(id); if (element) { element.parentNode.removeChild(element); } } drawText(Scaling, ctx , x, y, text, color, size, visibility, StrokeStyle, strokeStyleColor) { if (Scaling == "map") { const Pos = scaling.toCanvasPos(new Vector(x, y)); x = Pos.x; y = Pos.y; const radius = scaling.toCanvasPos(new Vector(0, size+y)).y - Pos.y size = radius; } else if (Scaling == "minimap") { const Pos = toMinimapPosition(new Vector(x, y)); x = Pos.x; y = Pos.y; } ctx.save(); ctx.textAlign = "center" ctx.font = `${size}px Ubuntu`; ctx.fillStyle = color; ctx.globalAlpha = visibility; ctx.fillText(text, x, y) if (StrokeStyle) { ctx.strokeStyle = strokeStyleColor; ctx.strokeText(text, x, y); } ctx.restore(); } drawLine(Scaling, ctx, x1, y1, x2, y2, color, visibility) { if (Scaling == "map") { const Pos1 = scaling.toCanvasPos(new Vector(x1, y1)); const Pos2 = scaling.toCanvasPos(new Vector(x2, y2)); x1 = Pos1.x; y1 = Pos1.y; x1 = Pos2.x; y2 = Pos2.y; } else if (Scaling == "minimap") { const Pos1 = toMinimapPosition(new Vector(x1, y1)); const Pos2 = toMinimapPosition(new Vector(x2, y2)); x1 = Pos1.x; y1 = Pos1.y; x1 = Pos2.x; y2 = Pos2.y; } ctx.save(); ctx.fillStyle = color; ctx.globalAlpha = visibility; ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke(); ctx.restore(); } drawPoint(Scaling, ctx, x, y, size, color, visibility, StrokeStyle, strokeStyleColor, strokeStyleSize) { if (Scaling == "map") { const Pos = scaling.toCanvasPos(new Vector(x, y)); x = Pos.x; y = Pos.y; const radius = scaling.toCanvasPos(new Vector(0, size+y)).y - Pos.y size = radius; } else if (Scaling == "minimap") { const Pos = toMinimapPosition(new Vector(x, y)); x = Pos.x; y = Pos.y; const radius = toMinimapPosition(new Vector(0, size+y)).y - Pos.y size = radius; } ctx.save(); ctx.fillStyle = color; ctx.globalAlpha = visibility; ctx.beginPath(); ctx.arc(x, y, size, 0, 2 * Math.PI); ctx.fill(); if (StrokeStyle) { ctx.lineWidth = strokeStyleSize; ctx.strokeStyle = strokeStyleColor; ctx.stroke(); } ctx.restore(); } drawSquar(scaling, ctx, x1, y1, x2, y2, size, color, visibility, StrokeStyle, strokeStyleColor, strokeStyleSize) { if (scaling == "map") { //mapPos = "scaling.toCanvasPos" or "toMinimapPosition" const Pos1 = scaling(new Vector(x1+size, y1+size)); const Pos2 = scaling(new Vector(x2+size, y2+size)); x1 = Pos1.x; y1= Pos1.y; x2 = Pos2.x; y2= Pos2.y; } else if (scaling == "minimap") { } else if (scaling == "screen") { } ctx.save(); ctx.fillStyle = color; ctx.globalAlpha = visibility; ctx.fillRect(x1, y1, x2 - x1, y2 - y1); if (StrokeStyle) { ctx.lineWidth = strokeStyleSize; ctx.strokeStyle = strokeStyleColor; ctx.stroke(); } ctx.restore(); } } const Canvas = new CANVAS(); // CONCATENATED MODULE: ./src/tools/index.ts // CONCATENATED MODULE: ./src/types/index.ts // CONCATENATED MODULE: ./src/index.ts // const shortcut = new Shortcut(); diep_Shortcut = __webpack_exports__; /******/ })(); //diepAPI end _window.diep_Shortcut = diep_Shortcut; })();