helperPvP2

рп

  1. // ==UserScript==
  2. // @name helperPvP2
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description рп
  6. // @author matrosik (Drik)
  7. // @match https://cavegame.io/
  8. // @icon https://i.postimg.cc/nLbFxnNg/image.png
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function changeBackgroundColor() {
  17. document.body.style.backgroundColor = 'transparent';
  18.  
  19. const menu = document.getElementById('craft-modal');
  20. if (menu) {
  21. menu.style.backgroundColor = '#FF1493';
  22. menu.style.color = 'white';
  23. }
  24.  
  25. const elementsToStyle = [
  26. 'buy-item',
  27. 'buy-item-2',
  28. 'sell-step-1',
  29. 'xp-bar'
  30. ];
  31.  
  32. elementsToStyle.forEach(id => {
  33. const element = document.getElementById(id);
  34. if (element) {
  35. element.style.backgroundColor = '#FF1493';
  36. element.style.color = 'white';
  37. }
  38. });
  39.  
  40. const headers = document.querySelectorAll('h3');
  41. headers.forEach(header => {
  42. header.style.color = 'white';
  43. header.style.backgroundColor = '#FF1493';
  44. });
  45.  
  46. const shopTabs = document.querySelectorAll('.shop-tab-button');
  47. shopTabs.forEach(tab => {
  48. tab.style.backgroundColor = '#FF1493';
  49. });
  50.  
  51. const elementsToRemove = [
  52. document.querySelector('.view-instructions-container'),
  53. document.getElementById('bottom-links'),
  54. document.querySelector('.mini-modal.modal.limited')
  55. ];
  56.  
  57. elementsToRemove.forEach(element => {
  58. if (element) {
  59. element.remove();
  60. }
  61. });
  62.  
  63. createPositionMenu();
  64. }
  65.  
  66. function createPositionMenu() {
  67. const existingMenu = document.getElementById('player-position-menu');
  68. if (existingMenu) {
  69. existingMenu.remove();
  70. }
  71.  
  72. const positionMenu = document.createElement('div');
  73. positionMenu.id = 'player-position-menu';
  74. positionMenu.style.position = 'fixed';
  75. positionMenu.style.top = '10px';
  76. positionMenu.style.left = '10px';
  77. positionMenu.style.backgroundColor = '#FF1493';
  78. positionMenu.style.color = 'white';
  79. positionMenu.style.padding = '10px';
  80. positionMenu.style.borderRadius = '8px';
  81. positionMenu.style.zIndex = '1000';
  82. positionMenu.style.fontFamily = 'Arial, sans-serif';
  83. positionMenu.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.5)';
  84.  
  85. const title = document.createElement('h3');
  86. title.innerText = 'press F1 ';
  87. title.style.margin = '0';
  88. positionMenu.appendChild(title);
  89.  
  90. const positionDisplay = document.createElement('div');
  91. positionDisplay.id = 'current-position';
  92. positionDisplay.innerText = 'help координаты: 0, 0';
  93. positionMenu.appendChild(positionDisplay);
  94.  
  95. document.body.appendChild(positionMenu);
  96. trackPlayerPosition();
  97. }
  98.  
  99. function trackPlayerPosition() {
  100. const positionElement = document.querySelector('.player-position.no-select');
  101. const positionDisplay = document.getElementById('current-position');
  102.  
  103. if (!positionElement || !positionDisplay) return;
  104.  
  105. const updatePosition = () => {
  106. const positionText = positionElement.innerText;
  107. positionDisplay.innerText = `Cord: ${positionText}`;
  108. };
  109.  
  110. updatePosition();
  111. setInterval(updatePosition, 0);
  112.  
  113. window.addEventListener("keydown", function(e) {
  114. if (e.key.toLowerCase() === "f1") {
  115. e.preventDefault();
  116. const coordsElem = document.querySelector('.player-position.no-select');
  117. const chatInput = document.querySelector('#chat-input');
  118. if (coordsElem && chatInput) {
  119. const coords = `(code matrosika) help pls: ${coordsElem.textContent.trim()}`;
  120. let tEvent = new KeyboardEvent('keydown', {
  121. key: "t",
  122. code: "KeyT",
  123. keyCode: 84,
  124. which: 84,
  125. bubbles: true,
  126. cancelable: true
  127. });
  128. document.dispatchEvent(tEvent);
  129.  
  130. setTimeout(() => {
  131. chatInput.value = coords;
  132. const enterEvent = new KeyboardEvent('keydown', {
  133. key: "Enter",
  134. code: "Enter",
  135. keyCode: 13,
  136. which: 13,
  137. bubbles: true,
  138. cancelable: true
  139. });
  140. chatInput.dispatchEvent(enterEvent);
  141. }, 0);
  142. }
  143. }
  144. });
  145. }
  146.  
  147. window.addEventListener('load', changeBackgroundColor);
  148. })();