smoothretro1982

coordinate scanner (w.i.p)

Jun 14th, 2026 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.97 KB | None | 0 0
  1. // 1. Create the HUD container and styles
  2. const hud = document.createElement('div');
  3. hud.id = 'coord-hud-vista';
  4. hud.innerHTML = `
  5. <div id="hud-header">
  6. <span class="hud-title">Coordinate Scanner</span>
  7. <button id="hud-close-btn" title="Close">X</button>
  8. </div>
  9. <div id="hud-body">
  10. <div class="hud-content-area">
  11. <div class="hud-input-group">
  12. <label for="hud-prefix-input">Prefix:</label>
  13. <input type="text" id="hud-prefix-input" value="project" placeholder="e.g. project">
  14. </div>
  15. <div class="hud-input-row">
  16. <div class="hud-input-group compact">
  17. <label for="hud-x-input">Target X:</label>
  18. <input type="number" id="hud-x-input" value="69420" placeholder="e.g. 69420">
  19. </div>
  20. <div class="hud-input-group compact">
  21. <label for="hud-y-input">Target Y:</label>
  22. <input type="number" id="hud-y-input" value="69420" placeholder="e.g. 69420">
  23. </div>
  24. </div>
  25. <button id="hud-start-btn">Start Scan</button>
  26. <div id="hud-progress">Progress: 0%</div>
  27. <pre id="hud-results">Matches will appear here...</pre>
  28. </div>
  29. </div>
  30. <div class="resizer n"></div>
  31. <div class="resizer s"></div>
  32. <div class="resizer e"></div>
  33. <div class="resizer w"></div>
  34. <div class="resizer ne"></div>
  35. <div class="resizer nw"></div>
  36. <div class="resizer se"></div>
  37. <div class="resizer sw"></div>
  38. `;
  39.  
  40. const styles = document.createElement('style');
  41. styles.innerHTML = `
  42. #coord-hud-vista {
  43. position: fixed;
  44. top: 20px;
  45. left: 20px;
  46. width: 330px;
  47. height: 460px;
  48. min-width: 250px;
  49. min-height: 320px;
  50. background: rgba(220, 235, 255, 0.5);
  51. backdrop-filter: blur(10px);
  52. -webkit-backdrop-filter: blur(10px);
  53. font-family: "Segoe UI", Tahoma, sans-serif;
  54. font-size: 12px;
  55. color: #000000;
  56. border-radius: 8px;
  57. border: 1px solid rgba(255, 255, 255, 0.4);
  58. box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3),
  59. 0 0 1px 1px rgba(255, 255, 255, 0.2) inset;
  60. z-index: 99999;
  61. display: flex;
  62. flex-direction: column;
  63. box-sizing: border-box;
  64. }
  65.  
  66. #hud-header {
  67. padding: 5px 10px 8px 10px;
  68. background: linear-gradient(to bottom,
  69. rgba(255, 255, 255, 0.6) 0%,
  70. rgba(255, 255, 255, 0.2) 50%,
  71. rgba(255, 255, 255, 0.0) 51%,
  72. rgba(255, 255, 255, 0.2) 100%);
  73. border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  74. cursor: move;
  75. user-select: none;
  76. display: flex;
  77. justify-content: space-between;
  78. align-items: center;
  79. border-top-left-radius: 7px;
  80. border-top-right-radius: 7px;
  81. }
  82.  
  83. #hud-header .hud-title {
  84. font-weight: bold;
  85. color: #000000;
  86. text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  87. }
  88.  
  89. #hud-close-btn {
  90. background: linear-gradient(to bottom, #fca 0%, #f77 50%, #f44 51%, #f77 100%);
  91. border: 1px solid #933;
  92. color: white;
  93. font-weight: bold;
  94. font-size: 10px;
  95. padding: 0 6px;
  96. border-radius: 2px;
  97. cursor: pointer;
  98. }
  99. #hud-close-btn:hover {
  100. background: linear-gradient(to bottom, #fdb 0%, #f88 50%, #f55 51%, #f88 100%);
  101. }
  102.  
  103. #hud-body {
  104. flex: 1;
  105. background-color: #f0f5f9;
  106. padding: 10px;
  107. display: flex;
  108. flex-direction: column;
  109. overflow: hidden;
  110. border-bottom-left-radius: 7px;
  111. border-bottom-right-radius: 7px;
  112. }
  113.  
  114. .hud-content-area {
  115. display: flex;
  116. flex-direction: column;
  117. gap: 10px;
  118. height: 100%;
  119. }
  120.  
  121. .hud-input-row {
  122. display: flex;
  123. gap: 10px;
  124. width: 100%;
  125. }
  126.  
  127. .hud-input-group {
  128. display: flex;
  129. align-items: center;
  130. gap: 8px;
  131. color: #000000;
  132. font-weight: 600;
  133. }
  134.  
  135. .hud-input-group.compact {
  136. flex: 1;
  137. }
  138.  
  139. #hud-prefix-input, #hud-x-input, #hud-y-input {
  140. background: #fff;
  141. border: 1px solid #666;
  142. padding: 3px 5px;
  143. color: #000000;
  144. }
  145.  
  146. #hud-prefix-input {
  147. flex: 1;
  148. }
  149.  
  150. #hud-x-input, #hud-y-input {
  151. width: 100%;
  152. box-sizing: border-box;
  153. }
  154.  
  155. #hud-start-btn {
  156. background: linear-gradient(to bottom, #e1e1e1 0%, #e1e1e1 50%, #d5d5d5 51%, #d5d5d5 100%);
  157. border: 1px solid #777;
  158. color: #000000;
  159. font-weight: bold;
  160. padding: 5px;
  161. cursor: pointer;
  162. border-radius: 3px;
  163. position: relative;
  164. }
  165. #hud-start-btn::after {
  166. content: '';
  167. position: absolute;
  168. top: 0; left: 0; right: 0; bottom: 50%;
  169. background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.1) 100%);
  170. border-radius: 3px 3px 0 0;
  171. }
  172. #hud-start-btn:hover {
  173. background: linear-gradient(to bottom, #e9f0f7 0%, #e9f0f7 50%, #dce8f3 51%, #dce8f3 100%);
  174. border-color: #3c7fb1;
  175. }
  176.  
  177. #hud-progress {
  178. color: #000000;
  179. font-weight: bold;
  180. }
  181.  
  182. #hud-results {
  183. flex: 1;
  184. background: #fff;
  185. border: 1px solid #777;
  186. padding: 5px;
  187. overflow-y: auto;
  188. font-family: Consolas, monospace;
  189. font-size: 11px;
  190. white-space: pre-wrap;
  191. margin: 0;
  192. color: #000000;
  193. }
  194.  
  195. /* Invisible Resize Borders & Corners */
  196. .resizer {
  197. position: absolute;
  198. z-index: 100000;
  199. }
  200. .resizer.n { top: -4px; left: 4px; right: 4px; height: 8px; cursor: n-resize; }
  201. .resizer.s { bottom: -4px; left: 4px; right: 4px; height: 8px; cursor: s-resize; }
  202. .resizer.e { right: -4px; top: 4px; bottom: 4px; width: 8px; cursor: e-resize; }
  203. .resizer.w { left: -4px; top: 4px; bottom: 4px; width: 8px; cursor: w-resize; }
  204. .resizer.ne { top: -4px; right: -4px; width: 10px; height: 10px; cursor: ne-resize; }
  205. .resizer.nw { top: -4px; left: -4px; width: 10px; height: 10px; cursor: nw-resize; }
  206. .resizer.se { bottom: -4px; right: -4px; width: 10px; height: 10px; cursor: se-resize; }
  207. .resizer.sw { bottom: -4px; left: -4px; width: 10px; height: 10px; cursor: sw-resize; }
  208. `;
  209.  
  210. document.head.appendChild(styles);
  211. document.body.appendChild(hud);
  212.  
  213. // --- Moving and Resizing Implementation ---
  214.  
  215. let currentWindowMode = null;
  216. let activeResizer = null;
  217. let startX, startY, startWidth, startHeight, startLeft, startTop;
  218.  
  219. const MIN_WIDTH = 250;
  220. const MIN_HEIGHT = 320;
  221.  
  222. const header = document.getElementById('hud-header');
  223.  
  224. header.addEventListener('mousedown', (e) => {
  225. if (e.target.id === 'hud-close-btn') return;
  226. currentWindowMode = 'moving';
  227. startX = e.clientX;
  228. startY = e.clientY;
  229. startLeft = hud.offsetLeft;
  230. startTop = hud.offsetTop;
  231. e.preventDefault();
  232. });
  233.  
  234. hud.querySelectorAll('.resizer').forEach(resizer => {
  235. resizer.addEventListener('mousedown', (e) => {
  236. currentWindowMode = 'resizing';
  237. activeResizer = e.target;
  238. startX = e.clientX;
  239. startY = e.clientY;
  240. startWidth = hud.offsetWidth;
  241. startHeight = hud.offsetHeight;
  242. startLeft = hud.offsetLeft;
  243. startTop = hud.offsetTop;
  244. e.preventDefault();
  245. });
  246. });
  247.  
  248. document.addEventListener('mousemove', (e) => {
  249. if (!currentWindowMode) return;
  250.  
  251. const dx = e.clientX - startX;
  252. const dy = e.clientY - startY;
  253.  
  254. if (currentWindowMode === 'moving') {
  255. hud.style.left = `${startLeft + dx}px`;
  256. hud.style.top = `${startTop + dy}px`;
  257. }
  258. else if (currentWindowMode === 'resizing') {
  259. const classes = activeResizer.classList;
  260.  
  261. let targetWidth = startWidth;
  262. let targetHeight = startHeight;
  263. let targetLeft = startLeft;
  264. let targetTop = startTop;
  265.  
  266. if (classes.contains('e') || classes.contains('se') || classes.contains('ne')) {
  267. targetWidth = Math.max(MIN_WIDTH, startWidth + dx);
  268. } else if (classes.contains('w') || classes.contains('sw') || classes.contains('nw')) {
  269. const calculatedWidth = startWidth - dx;
  270. if (calculatedWidth >= MIN_WIDTH) {
  271. targetWidth = calculatedWidth;
  272. targetLeft = startLeft + dx;
  273. } else {
  274. targetWidth = MIN_WIDTH;
  275. targetLeft = startLeft + (startWidth - MIN_WIDTH);
  276. }
  277. }
  278.  
  279. if (classes.contains('s') || classes.contains('se') || classes.contains('sw')) {
  280. targetHeight = Math.max(MIN_HEIGHT, startHeight + dy);
  281. } else if (classes.contains('n') || classes.contains('ne') || classes.contains('nw')) {
  282. const calculatedHeight = startHeight - dy;
  283. if (calculatedHeight >= MIN_HEIGHT) {
  284. targetHeight = calculatedHeight;
  285. targetTop = startTop + dy;
  286. } else {
  287. targetHeight = MIN_HEIGHT;
  288. targetTop = startTop + (startHeight - MIN_HEIGHT);
  289. }
  290. }
  291.  
  292. hud.style.width = `${targetWidth}px`;
  293. hud.style.height = `${targetHeight}px`;
  294. hud.style.left = `${targetLeft}px`;
  295. hud.style.top = `${targetTop}px`;
  296. }
  297. });
  298.  
  299. document.addEventListener('mouseup', () => {
  300. currentWindowMode = null;
  301. activeResizer = null;
  302. });
  303.  
  304. document.getElementById('hud-close-btn').addEventListener('click', () => {
  305. hud.remove();
  306. styles.remove();
  307. });
  308.  
  309. // --- Scan Logic ---
  310. const startBtn = document.getElementById('hud-start-btn');
  311. const progressDiv = document.getElementById('hud-progress');
  312. const resultsPre = document.getElementById('hud-results');
  313. const prefixInput = document.getElementById('hud-prefix-input');
  314. const xInput = document.getElementById('hud-x-input');
  315. const yInput = document.getElementById('hud-y-input');
  316.  
  317. startBtn.addEventListener('click', async () => {
  318. const prefix = prefixInput.value.trim() || 'project';
  319.  
  320. // Parse target values or fall back to original defaults
  321. const targetX = xInput.value !== '' ? parseInt(xInput.value, 10) : 69420;
  322. const targetY = yInput.value !== '' ? parseInt(yInput.value, 10) : 69420;
  323.  
  324. if (typeof w === 'undefined' || !w.generateCoords) {
  325. resultsPre.innerText = "Error: Global context engine target 'w.generateCoords' is missing.";
  326. return;
  327. }
  328.  
  329. startBtn.disabled = true;
  330. prefixInput.disabled = true;
  331. xInput.disabled = true;
  332. yInput.disabled = true;
  333. resultsPre.innerText = `Scanning for "${prefix}" matching coordinates (${targetX}, ${targetY})...\n`;
  334.  
  335. let matches = [];
  336. const total = 1e6;
  337. const batchSize = 20000;
  338.  
  339. for (let i = 0; i < total; i++) {
  340. let c = w.generateCoords(`${prefix}${i}`);
  341.  
  342. // Dynamically validate calculated target ruleset coordinates
  343. if (c && (Math.abs(c.x) === Math.abs(targetX) || Math.abs(c.y) === Math.abs(targetY))) {
  344. const matchStr = `/${prefix}${i} (${c.x}, ${-c.y})`;
  345. matches.push(matchStr);
  346. resultsPre.innerText += matchStr + '\n';
  347. resultsPre.scrollTop = resultsPre.scrollHeight;
  348. }
  349.  
  350. if (i % batchSize === 0) {
  351. progressDiv.innerText = `Progress: ${((i / total) * 100).toFixed(1)}%`;
  352. await new Promise(resolve => setTimeout(resolve, 1));
  353. }
  354. }
  355.  
  356. progressDiv.innerText = "Scan Complete! 100%";
  357. startBtn.disabled = false;
  358. prefixInput.disabled = false;
  359. xInput.disabled = false;
  360. yInput.disabled = false;
  361.  
  362. if (matches.length === 0) {
  363. resultsPre.innerText = `No coordinates matched (${targetX}, ${targetY}) using prefix "${prefix}".`;
  364. }
  365. });
Tags: tw.2s4.me
Advertisement
Add Comment
Please, Sign In to add comment