diep_Shortcut

try to take over the world!

当前为 2022-12-31 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/456843/1133639/diep_Shortcut.js

  1. // ==UserScript==
  2. // @name diep_Shortcut
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author tariteur
  7. // @match https://diep.io/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io
  9. // @grant none
  10. // ==/UserScript==
  11. (() => {
  12. const _window = 'undefined' == typeof unsafeWindow ? window : unsafeWindow;
  13. if (_window.diep_Shortcut) return;
  14.  
  15. //diepAPI start
  16. var diep_Shortcut;
  17. /******/ (() => {
  18. // webpackBootstrap
  19. /******/ 'use strict';
  20. /******/ // The require scope
  21. /******/ var __webpack_require__ = {};
  22. /******/
  23. /************************************************************************/
  24. /******/ /* webpack/runtime/define property getters */
  25. /******/ (() => {
  26. /******/ // define getter functions for harmony exports
  27. /******/ __webpack_require__.d = (exports, definition) => {
  28. /******/ for (var key in definition) {
  29. /******/ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  30. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  31. /******/
  32. }
  33. /******/
  34. }
  35. /******/
  36. };
  37. /******/
  38. })();
  39. /******/
  40. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  41. /******/ (() => {
  42. /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  43. /******/
  44. })();
  45. /******/
  46. /******/ /* webpack/runtime/make namespace object */
  47. /******/ (() => {
  48. /******/ // define __esModule on exports
  49. /******/ __webpack_require__.r = (exports) => {
  50. /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  51. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  52. /******/
  53. }
  54. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  55. /******/
  56. };
  57. /******/
  58. })();
  59. /******/
  60. /************************************************************************/
  61. var __webpack_exports__ = {};
  62. // ESM COMPAT FLAG
  63. __webpack_require__.r(__webpack_exports__);
  64.  
  65. // EXPORTS
  66. __webpack_require__.d(__webpack_exports__, {
  67. core: () => /* reexport */ core_namespaceObject,
  68. });
  69.  
  70. // NAMESPACE OBJECT: ./src/core/index.ts
  71. var core_namespaceObject = {};
  72. __webpack_require__.r(core_namespaceObject);
  73. __webpack_require__.d(core_namespaceObject, {
  74. Canvas: () => Canvas,
  75. });
  76.  
  77. ////////////////////pink////////violet/////bleu///////jaune//////rouge//////vert///////bleu clair//gris////
  78. 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'
  79. class CANVAS {
  80. GUI_create(id, Class, text, x, y,width, height, color, border, fontSize, callback) {
  81. // Créer l'élément de l'interface graphique
  82. const guiElement = document.createElement('d-button');
  83. guiElement.id = id;
  84. guiElement.classList.add(Class);
  85. guiElement.innerHTML = text;
  86. guiElement.style.top = x+"%";
  87. guiElement.style.left = y+"%";
  88. guiElement.border = border;
  89. guiElement.style.fontSize = fontSize+"vw";
  90. guiElement.bg = color;
  91. guiElement.textBorder = fontSize;
  92. guiElement.textalign = 'center';
  93. guiElement.style.position = 'absolute';
  94. guiElement.style.width = width+"vw";
  95. guiElement.style.height = height+"vh";
  96. guiElement.addEventListener('click', callback);
  97. // Append the GUI element to the body of the document
  98. document.body.appendChild(guiElement);
  99. }
  100.  
  101. GUI_changeName(id, text) {
  102. const element = document.getElementById(id);
  103. element.innerHTML = text;
  104. }
  105. GUI_hide_or_showID(id, truefalse) {
  106. const element = document.getElementById(id);
  107. if (truefalse == undefined) {
  108. if (element.style.display === 'none') {
  109. element.style.display = 'block';
  110. } else {
  111. element.style.display = 'none';
  112. }
  113. } else if (truefalse == true) {
  114. element.style.display = 'block';
  115. } else if (truefalse == false) {
  116. element.style.display = 'none';
  117. }
  118. }
  119. GUI_hide_or_showClass(Class, truefalse) {
  120. const elements = document.querySelectorAll(Class);
  121. for (const element of elements) {
  122. if (truefalse == undefined) {
  123. if (element.style.display === 'none') {
  124. element.style.display = 'block';
  125. } else {
  126. element.style.display = 'none';
  127. }
  128. } else if (truefalse == true) {
  129. element.style.display = 'block';
  130. } else if (truefalse == false) {
  131. element.style.display = 'none';
  132. }
  133. }
  134. }
  135. GUI_delete(id) {
  136. const element = document.getElementById(id);
  137. if (element) {
  138. element.parentNode.removeChild(element);
  139. }
  140. }
  141. drawText(canvasType , x, y, text1, text2, color, size, visibility, StrokeStyle, strokeStyleColor) {
  142. canvasType.save();
  143. canvasType.textAlign = "center"
  144. canvasType.font = `${size}px Ubuntu`;
  145. canvasType.fillStyle = color;
  146. canvasType.globalAlpha = visibility;
  147. canvasType.fillText(text1, x, y)
  148. if (StrokeStyle) {
  149. canvasType.strokeStyle = strokeStyleColor;
  150. canvasType.strokeText(text1, x, y);
  151. }
  152. canvasType.restore();
  153. }
  154. drawLine(canvasType, xy, XY, color, visibility) {
  155. canvasType.save();
  156. canvasType.fillStyle = color;
  157. canvasType.globalAlpha = visibility;
  158. canvasType.beginPath();
  159. canvasType.moveTo(xy.x, xy.y);
  160. canvasType.lineTo(XY.x, XY.y);
  161. canvasType.stroke();
  162. canvasType.restore();
  163. }
  164.  
  165. drawPoint(canvasType, xy, radius, color, visibility, StrokeStyle, strokeStyleColor, strokeStyleSize) {
  166. canvasType.save();
  167. canvasType.fillStyle = color;
  168. canvasType.globalAlpha = visibility;
  169. canvasType.beginPath();
  170. canvasType.arc(xy.x, xy.y, radius, 0, 2 * Math.PI);
  171. canvasType.fill();
  172. if (StrokeStyle) {
  173. canvasType.lineWidth = strokeStyleSize;
  174. canvasType.strokeStyle = strokeStyleColor;
  175. canvasType.stroke();
  176. }
  177. canvasType.restore();
  178. }
  179.  
  180. drawSquar(canvasType, x1, y1, x2, y2, size, color, visibility, StrokeStyle, strokeStyleColor, strokeStyleSize) {
  181. canvasType.save();
  182. canvasType.fillStyle = color;
  183. canvasType.globalAlpha = visibility;
  184. canvasType.fillRect(x1, y1, x2 - x1, y2 - y1);
  185. if (StrokeStyle) {
  186. canvasType.lineWidth = strokeStyleSize;
  187. canvasType.strokeStyle = strokeStyleColor;
  188. canvasType.stroke();
  189. }
  190. canvasType.restore();
  191. }
  192. }
  193. const Canvas = new CANVAS(); // CONCATENATED MODULE: ./src/tools/index.ts // CONCATENATED MODULE: ./src/types/index.ts // CONCATENATED MODULE: ./src/index.ts
  194.  
  195. // const shortcut = new Shortcut();
  196. diep_Shortcut = __webpack_exports__;
  197. /******/
  198. })();
  199. //diepAPI end
  200.  
  201. _window.diep_Shortcut = diep_Shortcut;
  202. })();