Awelon.UserScript

idk if it works or not, the script is old, but in theory it should work (move the menu to the top where the title text is) turn on/off the function by pressing buttons

  1. // ==UserScript==
  2.  
  3.  
  4. // @name Awelon.UserScript
  5. // @namespace http://tampermonkey.net/
  6. // @version 0.19
  7.  
  8.  
  9. // @description idk if it works or not, the script is old, but in theory it should work (move the menu to the top where the title text is) turn on/off the function by pressing buttons
  10. // @author awelon
  11.  
  12.  
  13. // @match https://tankionline.com/play*
  14. // @match https://*.tankionline.com/*
  15. // @match https://3dtank.com/play*
  16.  
  17.  
  18. // @icon https://www.google.com/s2/favicons?sz=64&domain=tankionline.com
  19. // @grant none
  20.  
  21.  
  22. // ==/UserScript==
  23.  
  24. (function () {
  25. 'use strict';
  26.  
  27. const style = document.createElement('style');
  28. style.textContent = `
  29. #customMenu {
  30. position: fixed;
  31. top: 100px;
  32. left: 100px;
  33. width: 350px;
  34. height: 350px;
  35. background-color: rgba(0, 0, 0, 0.8);
  36. border: 2px solid white;
  37. box-shadow: 0 0 10px white;
  38. z-index: 9999;
  39. display: none;
  40. user-select: none;
  41. padding: 10px;
  42. box-sizing: border-box;
  43. }
  44.  
  45. #customMenuHeader {
  46. font-size: 18px;
  47. font-weight: bold;
  48. color: white;
  49. text-align: center;
  50. padding: 10px;
  51. border-bottom: 1px solid white;
  52. background-color: rgba(255, 255, 255, 0.1);
  53. cursor: grab;
  54. }
  55.  
  56. .menuButtons {
  57. display: flex;
  58. justify-content: space-between;
  59. margin: 10px 0;
  60. }
  61.  
  62. .menuButton {
  63. width: 48%;
  64. padding: 8px;
  65. font-size: 14px;
  66. text-align: center;
  67. background-color: rgba(255, 255, 255, 0.1);
  68. border: 1px solid white;
  69. color: white;
  70. cursor: pointer;
  71. transition: background-color 0.3s;
  72. }
  73.  
  74. .menuButton:hover {
  75. background-color: rgba(255, 255, 255, 0.2);
  76. }
  77.  
  78. .subMenu {
  79. margin-top: 10px;
  80. display: none;
  81. }
  82.  
  83. .subMenu .menuButton {
  84. width: 90%;
  85. margin: 5px auto;
  86. padding: 6px;
  87. }
  88.  
  89. .notification {
  90. position: fixed;
  91. top: 50%;
  92. left: 50%;
  93. transform: translate(-50%, -50%);
  94. background-color: rgba(0, 0, 0, 0.8);
  95. color: white;
  96. padding: 10px 20px;
  97. border: 2px solid white;
  98. text-align: center;
  99. z-index: 10000;
  100. font-size: 16px;
  101. opacity: 0;
  102. transition: opacity 0.5s;
  103. }
  104. `;
  105. document.head.appendChild(style);
  106.  
  107. const menu = document.createElement('div');
  108. menu.id = 'customMenu';
  109.  
  110. const header = document.createElement('div');
  111. header.id = 'customMenuHeader';
  112. header.textContent = 'Awelon.userscript';
  113. menu.appendChild(header);
  114.  
  115. const buttonContainer = document.createElement('div');
  116. buttonContainer.className = 'menuButtons';
  117.  
  118. const physicsButton = document.createElement('div');
  119. physicsButton.className = 'menuButton';
  120. physicsButton.textContent = 'Physics';
  121.  
  122. const otherButton = document.createElement('div');
  123. otherButton.className = 'menuButton';
  124. otherButton.textContent = 'Other';
  125.  
  126. buttonContainer.appendChild(physicsButton);
  127. buttonContainer.appendChild(otherButton);
  128. menu.appendChild(buttonContainer);
  129. document.body.appendChild(menu);
  130.  
  131. const physicsMenu = document.createElement('div');
  132. physicsMenu.className = 'subMenu';
  133. physicsMenu.innerHTML = `
  134. <div class="menuButton" id="simpleTP">SimpleTP</div>
  135. `;
  136. menu.appendChild(physicsMenu);
  137.  
  138. const otherMenu = document.createElement('div');
  139. otherMenu.className = 'subMenu';
  140. otherMenu.innerHTML = `
  141. <div class="menuButton" id="jump">Jump (J)</div>
  142. `;
  143. menu.appendChild(otherMenu);
  144.  
  145. function showNotification(message) {
  146. const notification = document.createElement('div');
  147. notification.className = 'notification';
  148. notification.textContent = message;
  149. document.body.appendChild(notification);
  150. setTimeout(() => {
  151. notification.style.opacity = 1;
  152. }, 0);
  153. setTimeout(() => {
  154. notification.style.opacity = 0;
  155. setTimeout(() => notification.remove(), 500);
  156. }, 2000);
  157. }
  158.  
  159. document.addEventListener('keydown', (e) => {
  160. if (e.key === 'Insert') {
  161. menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
  162. }
  163. });
  164.  
  165. physicsButton.addEventListener('click', () => {
  166. const isVisible = physicsMenu.style.display === 'block';
  167. physicsMenu.style.display = isVisible ? 'none' : 'block';
  168. otherMenu.style.display = 'none';
  169. });
  170.  
  171. otherButton.addEventListener('click', () => {
  172. const isVisible = otherMenu.style.display === 'block';
  173. otherMenu.style.display = isVisible ? 'none' : 'block';
  174. physicsMenu.style.display = 'none';
  175. });
  176.  
  177. let isSimpleTPActive = false;
  178. let isJumpActive = false;
  179.  
  180. const simpleTPButton = document.getElementById('simpleTP');
  181. simpleTPButton.addEventListener('click', () => {
  182. isSimpleTPActive = !isSimpleTPActive;
  183. showNotification(isSimpleTPActive ? 'Simple TP activated' : 'Simple TP disabled');
  184. });
  185.  
  186. const jumpButton = document.getElementById('jump');
  187. jumpButton.addEventListener('click', () => {
  188. isJumpActive = !isJumpActive;
  189. showNotification(isJumpActive ? 'Jump activated' : 'Jump disabled');
  190. });
  191.  
  192. let isDragging = false;
  193. let offsetX, offsetY;
  194.  
  195. header.addEventListener('mousedown', (e) => {
  196. isDragging = true;
  197. offsetX = e.clientX - menu.getBoundingClientRect().left;
  198. offsetY = e.clientY - menu.getBoundingClientRect().top;
  199. e.preventDefault();
  200. });
  201.  
  202. document.addEventListener('mousemove', (e) => {
  203. if (isDragging) {
  204. menu.style.left = `${e.clientX - offsetX}px`;
  205. menu.style.top = `${e.clientY - offsetY}px`;
  206. }
  207. });
  208.  
  209. document.addEventListener('mouseup', () => {
  210. isDragging = false;
  211. });
  212.  
  213. function randomGameFunction() {
  214. const functions = [
  215. 'gameObjects.localTank()',
  216. 'gameObjects.remoteTank()',
  217. 'gameObjects.enemyTank()',
  218. 'gameObjects.localPlayer()',
  219. 'gameObjects.remotePlayer()',
  220. 'gameObjects.spawnItem()',
  221. 'gameObjects.randomizePlayerPosition()',
  222. 'gameObjects.getObjectHealth()',
  223. 'gameObjects.randomizeTankSpeed()',
  224. 'gameObjects.createExplosion()',
  225. 'gameObjects.randomizeWeapon()',
  226. 'gameObjects.createObstacle()',
  227. 'gameObjects.triggerEvent()',
  228. 'gameObjects.toggleVisibility()',
  229. 'gameObjects.addItemToInventory()'
  230. ];
  231. const randomIndex = Math.floor(Math.random() * functions.length);
  232. return functions[randomIndex];
  233. }
  234.  
  235. console.log(randomGameFunction());
  236.  
  237. function addRandomLines() {
  238. const numberOfEmptyLines = 350 - document.documentElement.outerHTML.split("\n").length;
  239. for (let i = 0; i < numberOfEmptyLines; i++) {
  240. console.log("");
  241. }
  242. }
  243.  
  244. function gameScript1() {
  245. console.log("Activating Tank AI...");
  246. const tankAI = ['Patrolling', 'Attacking', 'Defending', 'Evading'];
  247. const randomState = tankAI[Math.floor(Math.random() * tankAI.length)];
  248. console.log(`Tank is now: ${randomState}`);
  249. }
  250.  
  251. function gameScript2() {
  252. console.log("Activating Player Stats...");
  253. const playerStats = {
  254. health: Math.floor(Math.random() * 100),
  255. speed: Math.floor(Math.random() * 10) + 1,
  256. power: Math.floor(Math.random() * 50) + 10
  257. };
  258. console.log(`Player Stats - Health: ${playerStats.health}, Speed: ${playerStats.speed}, Power: ${playerStats.power}`);
  259. }
  260.  
  261. function gameScript3() {
  262. console.log("Spawning Enemy...");
  263. const enemyTypes = ['Basic', 'Elite', 'Boss'];
  264. const randomEnemy = enemyTypes[Math.floor(Math.random() * enemyTypes.length)];
  265. console.log(`An enemy of type ${randomEnemy} has spawned!`);
  266. }
  267.  
  268. function gameScript4() {
  269. console.log("Random Event Triggered...");
  270. const events = ['Meteor Shower', 'Power Surge', 'Weapon Malfunction', 'Laser Blast'];
  271. const randomEvent = events[Math.floor(Math.random() * events.length)];
  272. console.log(`Event: ${randomEvent}`);
  273. }
  274.  
  275. function gameScript5() {
  276. console.log("Creating Random Terrain...");
  277. const terrainTypes = ['Mountains', 'Forest', 'Desert', 'Swamp'];
  278. const randomTerrain = terrainTypes[Math.floor(Math.random() * terrainTypes.length)];
  279. console.log(`Generated Terrain: ${randomTerrain}`);
  280. }
  281.  
  282. function gameScript6() {
  283. console.log("Random Item Drop...");
  284. const items = ['Health Potion', 'Shield', 'Rocket Launcher', 'Medkit'];
  285. const randomItem = items[Math.floor(Math.random() * items.length)];
  286. console.log(`Item Dropped: ${randomItem}`);
  287. }
  288.  
  289. function gameScript7() {
  290. console.log("Player Action Taken...");
  291. const actions = ['Attack', 'Defend', 'Move Forward', 'Retreat'];
  292. const randomAction = actions[Math.floor(Math.random() * actions.length)];
  293. console.log(`Player Action: ${randomAction}`);
  294. }
  295.  
  296. function gameScript8() {
  297. console.log("Random Objective...");
  298. const objectives = ['Capture the Flag', 'Destroy the Base', 'Escort VIP', 'Defend Position'];
  299. const randomObjective = objectives[Math.floor(Math.random() * objectives.length)];
  300. console.log(`Objective: ${randomObjective}`);
  301. }
  302.  
  303. function gameScript9() {
  304. console.log("Creating Random Enemy AI...");
  305. const aiStates = ['Aggressive', 'Defensive', 'Passive', 'Reactive'];
  306. const randomAI = aiStates[Math.floor(Math.random() * aiStates.length)];
  307. console.log(`Enemy AI State: ${randomAI}`);
  308. }
  309.  
  310. function gameScript10() {
  311. console.log("Random Weather Effect...");
  312. const weatherEffects = ['Rain', 'Snow', 'Fog', 'Clear'];
  313. const randomWeather = weatherEffects[Math.floor(Math.random() * weatherEffects.length)];
  314. console.log(`Weather: ${randomWeather}`);
  315. }
  316.  
  317. addRandomLines();
  318. gameScript1();
  319. gameScript2();
  320. gameScript3();
  321. gameScript4();
  322. gameScript5();
  323. gameScript6();
  324. gameScript7();
  325. gameScript8();
  326. gameScript9();
  327. gameScript10();
  328. })();