Agar.io Oculus GUI

Custom GUI for script execution in Agar.io

目前为 2024-09-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Agar.io Oculus GUI
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Custom GUI for script execution in Agar.io
  6. // @author Your Name
  7. // @match *://agar.io/*
  8. // @grant GM_addStyle
  9. // @grant GM_addElement
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Create the "Open GUI" button
  16. const openGuiButton = document.createElement('button');
  17. openGuiButton.id = 'open-gui-button';
  18. openGuiButton.innerText = 'Open GUI';
  19. document.body.appendChild(openGuiButton);
  20.  
  21. // Create the GUI container
  22. const oculusGUI = document.createElement('div');
  23. oculusGUI.id = 'oculus-gui';
  24. oculusGUI.style.display = 'none'; // Initially hidden
  25. oculusGUI.innerHTML = `
  26. <div id="oculus-container">
  27. <div id="oculus-header">
  28. <img src="https://i.imgur.com/og6DB9N.png" alt="Oculus" id="oculus-logo">
  29. <span id="oculus-label">Oculus</span>
  30. <div id="status-indicator" class="red-circle"></div>
  31. <button id="close-gui-button">X</button>
  32. </div>
  33. <textarea id="script-input" placeholder="Enter your script here..."></textarea>
  34. <div id="oculus-buttons">
  35. <button id="execute">Execute</button>
  36. <button id="clear">Clear</button>
  37. <button id="inject">Inject</button>
  38. </div>
  39. </div>
  40. `;
  41. document.body.appendChild(oculusGUI);
  42.  
  43. // Inject CSS styles
  44. GM_addStyle(`
  45. #open-gui-button {
  46. position: fixed;
  47. top: 10px;
  48. left: 10px;
  49. z-index: 10000;
  50. padding: 10px 20px;
  51. background-color: #FFCA2E;
  52. border: 2px solid #E0A800;
  53. border-radius: 10px;
  54. font-size: 16px;
  55. font-weight: bold;
  56. cursor: pointer;
  57. }
  58.  
  59. #open-gui-button:hover {
  60. background-color: #E0A800;
  61. }
  62.  
  63. #oculus-gui {
  64. position: fixed;
  65. top: 50px;
  66. left: 50px;
  67. width: 600px;
  68. z-index: 9999;
  69. font-family: Arial, sans-serif;
  70. background-color: #FFCA2E;
  71. border-radius: 10px;
  72. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  73. }
  74.  
  75. #oculus-container {
  76. padding: 10px;
  77. }
  78.  
  79. #oculus-header {
  80. display: flex;
  81. justify-content: space-between;
  82. align-items: center;
  83. background-color: #FFCA2E;
  84. border-bottom: 2px solid #D4D4D4;
  85. padding-bottom: 10px;
  86. margin-bottom: 10px;
  87. }
  88.  
  89. #oculus-logo {
  90. height: 40px;
  91. margin-right: 10px;
  92. }
  93.  
  94. #oculus-label {
  95. font-size: 24px;
  96. font-weight: bold;
  97. color: #000;
  98. }
  99.  
  100. #status-indicator {
  101. width: 20px;
  102. height: 20px;
  103. border-radius: 50%;
  104. background-color: #FF0000;
  105. margin-right: 20px;
  106. }
  107.  
  108. #close-gui-button {
  109. background-color: #FFCA2E;
  110. border: none;
  111. font-size: 18px;
  112. cursor: pointer;
  113. color: #000;
  114. font-weight: bold;
  115. }
  116.  
  117. #script-input {
  118. width: 100%;
  119. height: 200px;
  120. background-color: #BFBFBF;
  121. border: none;
  122. border-radius: 10px;
  123. padding: 10px;
  124. font-size: 16px;
  125. resize: none;
  126. box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.1);
  127. margin-bottom: 10px;
  128. }
  129.  
  130. #oculus-buttons {
  131. display: flex;
  132. justify-content: space-between;
  133. }
  134.  
  135. #oculus-buttons button {
  136. background-color: #FFCA2E;
  137. border: 2px solid #E0A800;
  138. border-radius: 20px;
  139. padding: 10px 30px;
  140. font-size: 16px;
  141. font-weight: bold;
  142. cursor: pointer;
  143. transition: background-color 0.3s ease;
  144. }
  145.  
  146. #oculus-buttons button:hover {
  147. background-color: #E0A800;
  148. }
  149.  
  150. #oculus-buttons button:active {
  151. background-color: #C69300;
  152. }
  153. `);
  154.  
  155. // JavaScript Logic
  156.  
  157. // Open GUI
  158. openGuiButton.addEventListener('click', function() {
  159. oculusGUI.style.display = 'block';
  160. });
  161.  
  162. // Close GUI
  163. document.getElementById('close-gui-button').addEventListener('click', function() {
  164. oculusGUI.style.display = 'none';
  165. });
  166.  
  167. const executeButton = document.getElementById('execute');
  168. const clearButton = document.getElementById('clear');
  169. const injectButton = document.getElementById('inject');
  170. const scriptInput = document.getElementById('script-input');
  171. const statusIndicator = document.getElementById('status-indicator');
  172.  
  173. injectButton.addEventListener('click', function() {
  174. statusIndicator.classList.remove('red-circle');
  175. statusIndicator.classList.add('green-circle');
  176. });
  177.  
  178. clearButton.addEventListener('click', function() {
  179. scriptInput.value = "";
  180. });
  181.  
  182. executeButton.addEventListener('click', function() {
  183. try {
  184. eval(scriptInput.value);
  185. alert('Script executed successfully.');
  186. } catch (err) {
  187. console.error('Error executing script:', err);
  188. alert('Error executing script.');
  189. }
  190. });
  191.  
  192. // Dragging Logic
  193. oculusGUI.onmousedown = function(event) {
  194. let shiftX = event.clientX - oculusGUI.getBoundingClientRect().left;
  195. let shiftY = event.clientY - oculusGUI.getBoundingClientRect().top;
  196.  
  197. function moveAt(pageX, pageY) {
  198. oculusGUI.style.left = pageX - shiftX + 'px';
  199. oculusGUI.style.top = pageY - shiftY + 'px';
  200. }
  201.  
  202. moveAt(event.pageX, event.pageY);
  203.  
  204. function onMouseMove(event) {
  205. moveAt(event.pageX, event.pageY);
  206. }
  207.  
  208. document.addEventListener('mousemove', onMouseMove);
  209.  
  210. oculusGUI.onmouseup = function() {
  211. document.removeEventListener('mousemove', onMouseMove);
  212. oculusGUI.onmouseup = null;
  213. };
  214. };
  215.  
  216. oculusGUI.ondragstart = function() {
  217. return false;
  218. };
  219. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址