Advanced aimbot with ESP wallhack, auto-aim, player detection, and customizable settings for Veck.io
Size
18.2 KB
Version
1.0.1
Created
Mar 6, 2026
Updated
about 1 month ago
1// ==UserScript==
2// @name Veck.io Aimbot & ESP Cheat
3// @description Advanced aimbot with ESP wallhack, auto-aim, player detection, and customizable settings for Veck.io
4// @version 1.0.1
5// @match https://*.crazygames.com/*
6// @icon https://imgs.crazygames.com/favicons/touch-icon.png?metadata=none&quality=60&width=32&height=32&fit=crop&format=png
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 console.log('[Veck.io Aimbot] Extension loaded');
12
13 // Configuration
14 const config = {
15 aimbot: {
16 enabled: true,
17 fov: 180,
18 smoothing: 0.3,
19 autoShoot: true,
20 targetHead: true,
21 aimKey: 'KeyE' // E key for manual aim
22 },
23 esp: {
24 enabled: true,
25 boxes: true,
26 lines: true,
27 health: true,
28 distance: true,
29 names: true,
30 teamCheck: true
31 },
32 colors: {
33 enemy: '#ff0000',
34 team: '#00ff00',
35 box: '#ffffff',
36 line: '#ffff00'
37 }
38 };
39
40 let gameIframe = null;
41 let gameWindow = null;
42 let gameDocument = null;
43 let players = [];
44 let localPlayer = null;
45 let isAiming = false;
46
47 // Utility functions
48 function debounce(func, wait) {
49 let timeout;
50 return function executedFunction(...args) {
51 const later = () => {
52 clearTimeout(timeout);
53 func(...args);
54 };
55 clearTimeout(timeout);
56 timeout = setTimeout(later, wait);
57 };
58 }
59
60 function getDistance(pos1, pos2) {
61 const dx = pos1.x - pos2.x;
62 const dy = pos1.y - pos2.y;
63 const dz = pos1.z - pos2.z;
64 return Math.sqrt(dx * dx + dy * dy + dz * dz);
65 }
66
67 function getAngleTo(from, to) {
68 const dx = to.x - from.x;
69 const dy = to.y - from.y;
70 const dz = to.z - from.z;
71
72 const distance = Math.sqrt(dx * dx + dz * dz);
73 const pitch = Math.atan2(dy, distance);
74 const yaw = Math.atan2(dx, dz);
75
76 return { pitch, yaw };
77 }
78
79 function isInFOV(angle, fov) {
80 return Math.abs(angle) <= (fov * Math.PI / 180);
81 }
82
83 // Initialize iframe access
84 function initIframe() {
85 gameIframe = document.querySelector('#game-iframe');
86 if (!gameIframe) {
87 console.log('[Veck.io Aimbot] Game iframe not found, retrying...');
88 setTimeout(initIframe, 1000);
89 return;
90 }
91
92 try {
93 gameWindow = gameIframe.contentWindow;
94 gameDocument = gameIframe.contentDocument || gameIframe.contentWindow.document;
95 console.log('[Veck.io Aimbot] Game iframe accessed successfully');
96
97 // Wait for game to load
98 setTimeout(() => {
99 hookGame();
100 createUI();
101 startAimbot();
102 }, 3000);
103 } catch (e) {
104 console.error('[Veck.io Aimbot] Cannot access iframe:', e);
105 }
106 }
107
108 // Hook into game objects
109 function hookGame() {
110 if (!gameWindow) return;
111
112 console.log('[Veck.io Aimbot] Hooking into game...');
113
114 // Try to find Three.js or game objects
115 const checkForGame = setInterval(() => {
116 try {
117 // Look for common game object patterns
118 if (gameWindow.THREE) {
119 console.log('[Veck.io Aimbot] Three.js detected');
120 }
121
122 // Hook WebGL context for player detection
123 hookWebGL();
124
125 clearInterval(checkForGame);
126 } catch (e) {
127 console.log('[Veck.io Aimbot] Waiting for game objects...');
128 }
129 }, 1000);
130 }
131
132 // Hook WebGL for rendering
133 function hookWebGL() {
134 if (!gameWindow) return;
135
136 try {
137 const originalGetContext = HTMLCanvasElement.prototype.getContext;
138 HTMLCanvasElement.prototype.getContext = function(type, attributes) {
139 const context = originalGetContext.call(this, type, attributes);
140
141 if (type === 'webgl' || type === 'webgl2') {
142 console.log('[Veck.io Aimbot] WebGL context hooked');
143 hookWebGLMethods(context);
144 }
145
146 return context;
147 };
148 } catch (e) {
149 console.error('[Veck.io Aimbot] WebGL hook failed:', e);
150 }
151 }
152
153 function hookWebGLMethods(gl) {
154 // Hook drawArrays and drawElements to detect player rendering
155 const originalDrawArrays = gl.drawArrays;
156 const originalDrawElements = gl.drawElements;
157
158 gl.drawArrays = function(...args) {
159 detectPlayers(gl);
160 return originalDrawArrays.apply(this, args);
161 };
162
163 gl.drawElements = function(...args) {
164 detectPlayers(gl);
165 return originalDrawElements.apply(this, args);
166 };
167 }
168
169 // Detect players in the game
170 function detectPlayers(gl) {
171 // This is a simplified player detection
172 // In a real implementation, you would parse the game's memory/objects
173 try {
174 if (gameWindow && gameWindow.players) {
175 players = gameWindow.players;
176 } else if (gameWindow && gameWindow.game && gameWindow.game.players) {
177 players = gameWindow.game.players;
178 }
179 } catch (e) {
180 // Silent fail - game objects not accessible
181 }
182 }
183
184 // Find closest enemy
185 function findClosestEnemy() {
186 if (!localPlayer || players.length === 0) return null;
187
188 let closestEnemy = null;
189 let closestDistance = Infinity;
190 let closestAngle = Infinity;
191
192 for (const player of players) {
193 if (!player || player.id === localPlayer.id) continue;
194 if (config.esp.teamCheck && player.team === localPlayer.team) continue;
195 if (!player.position || !player.health || player.health <= 0) continue;
196
197 const distance = getDistance(localPlayer.position, player.position);
198 const angles = getAngleTo(localPlayer.position, player.position);
199 const angleDiff = Math.abs(angles.yaw - localPlayer.rotation.yaw);
200
201 if (isInFOV(angleDiff, config.aimbot.fov)) {
202 if (angleDiff < closestAngle) {
203 closestAngle = angleDiff;
204 closestEnemy = player;
205 closestDistance = distance;
206 }
207 }
208 }
209
210 return closestEnemy;
211 }
212
213 // Aim at target
214 function aimAt(target) {
215 if (!localPlayer || !target) return;
216
217 const targetPos = config.aimbot.targetHead && target.headPosition
218 ? target.headPosition
219 : target.position;
220
221 const angles = getAngleTo(localPlayer.position, targetPos);
222
223 // Smooth aiming
224 const smoothing = config.aimbot.smoothing;
225 localPlayer.rotation.yaw += (angles.yaw - localPlayer.rotation.yaw) * smoothing;
226 localPlayer.rotation.pitch += (angles.pitch - localPlayer.rotation.pitch) * smoothing;
227
228 // Auto shoot
229 if (config.aimbot.autoShoot) {
230 simulateShoot();
231 }
232 }
233
234 // Simulate shooting
235 function simulateShoot() {
236 if (!gameDocument) return;
237
238 try {
239 const mouseEvent = new MouseEvent('mousedown', {
240 bubbles: true,
241 cancelable: true,
242 view: gameWindow,
243 button: 0
244 });
245 gameDocument.dispatchEvent(mouseEvent);
246
247 setTimeout(() => {
248 const mouseUpEvent = new MouseEvent('mouseup', {
249 bubbles: true,
250 cancelable: true,
251 view: gameWindow,
252 button: 0
253 });
254 gameDocument.dispatchEvent(mouseUpEvent);
255 }, 50);
256 } catch (e) {
257 console.error('[Veck.io Aimbot] Shoot simulation failed:', e);
258 }
259 }
260
261 // Main aimbot loop
262 function aimbotLoop() {
263 if (!config.aimbot.enabled) return;
264
265 try {
266 const target = findClosestEnemy();
267 if (target && (isAiming || config.aimbot.autoShoot)) {
268 aimAt(target);
269 }
270 } catch (e) {
271 console.error('[Veck.io Aimbot] Aimbot loop error:', e);
272 }
273 }
274
275 // ESP rendering
276 function renderESP() {
277 if (!config.esp.enabled || !gameDocument) return;
278
279 // Remove old ESP elements
280 const oldESP = gameDocument.querySelectorAll('.esp-element');
281 oldESP.forEach(el => el.remove());
282
283 // Render ESP for each player
284 for (const player of players) {
285 if (!player || !localPlayer) continue;
286 if (player.id === localPlayer.id) continue;
287 if (config.esp.teamCheck && player.team === localPlayer.team) continue;
288 if (!player.position || !player.health || player.health <= 0) continue;
289
290 const screenPos = worldToScreen(player.position);
291 if (!screenPos) continue;
292
293 const distance = getDistance(localPlayer.position, player.position);
294 const isTeam = player.team === localPlayer.team;
295 const color = isTeam ? config.colors.team : config.colors.enemy;
296
297 // Draw box
298 if (config.esp.boxes) {
299 drawBox(screenPos, color, player);
300 }
301
302 // Draw line
303 if (config.esp.lines) {
304 drawLine(screenPos, color);
305 }
306
307 // Draw info
308 if (config.esp.health || config.esp.distance || config.esp.names) {
309 drawInfo(screenPos, player, distance, color);
310 }
311 }
312 }
313
314 function worldToScreen(worldPos) {
315 // Simplified world to screen conversion
316 // In a real implementation, you would use the game's camera matrix
317 try {
318 if (!localPlayer || !localPlayer.camera) return null;
319
320 // This is a placeholder - actual implementation depends on game's rendering
321 return {
322 x: 400 + (worldPos.x - localPlayer.position.x) * 10,
323 y: 300 - (worldPos.y - localPlayer.position.y) * 10
324 };
325 } catch (e) {
326 return null;
327 }
328 }
329
330 function drawBox(pos, color, player) {
331 const box = gameDocument.createElement('div');
332 box.className = 'esp-element esp-box';
333 box.style.cssText = `
334 position: absolute;
335 left: ${pos.x - 25}px;
336 top: ${pos.y - 50}px;
337 width: 50px;
338 height: 100px;
339 border: 2px solid ${color};
340 pointer-events: none;
341 z-index: 10000;
342 `;
343 gameDocument.body.appendChild(box);
344 }
345
346 function drawLine(pos, color) {
347 const line = gameDocument.createElement('div');
348 line.className = 'esp-element esp-line';
349 const centerX = gameWindow.innerWidth / 2;
350 const centerY = gameWindow.innerHeight;
351
352 const angle = Math.atan2(pos.y - centerY, pos.x - centerX);
353 const length = Math.sqrt(Math.pow(pos.x - centerX, 2) + Math.pow(pos.y - centerY, 2));
354
355 line.style.cssText = `
356 position: absolute;
357 left: ${centerX}px;
358 top: ${centerY}px;
359 width: ${length}px;
360 height: 2px;
361 background: ${color};
362 transform-origin: 0 0;
363 transform: rotate(${angle}rad);
364 pointer-events: none;
365 z-index: 10000;
366 `;
367 gameDocument.body.appendChild(line);
368 }
369
370 function drawInfo(pos, player, distance, color) {
371 const info = gameDocument.createElement('div');
372 info.className = 'esp-element esp-info';
373
374 let text = '';
375 if (config.esp.names && player.name) text += player.name + '<br>';
376 if (config.esp.health) text += `HP: ${Math.round(player.health)}%<br>`;
377 if (config.esp.distance) text += `${Math.round(distance)}m`;
378
379 info.innerHTML = text;
380 info.style.cssText = `
381 position: absolute;
382 left: ${pos.x + 30}px;
383 top: ${pos.y - 50}px;
384 color: ${color};
385 font-family: Arial, sans-serif;
386 font-size: 12px;
387 font-weight: bold;
388 text-shadow: 1px 1px 2px #000;
389 pointer-events: none;
390 z-index: 10000;
391 white-space: nowrap;
392 `;
393 gameDocument.body.appendChild(info);
394 }
395
396 // Create control UI
397 function createUI() {
398 const ui = document.createElement('div');
399 ui.id = 'aimbot-ui';
400 ui.innerHTML = `
401 <div style="position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.8); color: white; padding: 15px; border-radius: 8px; font-family: Arial; font-size: 12px; z-index: 999999; min-width: 200px;">
402 <h3 style="margin: 0 0 10px 0; color: #ff0000; text-align: center;">Veck.io Aimbot</h3>
403 <div style="margin-bottom: 8px;">
404 <label style="display: flex; align-items: center; cursor: pointer;">
405 <input type="checkbox" id="aimbot-toggle" ${config.aimbot.enabled ? 'checked' : ''} style="margin-right: 8px;">
406 <span>Aimbot (E to aim)</span>
407 </label>
408 </div>
409 <div style="margin-bottom: 8px;">
410 <label style="display: flex; align-items: center; cursor: pointer;">
411 <input type="checkbox" id="autoshoot-toggle" ${config.aimbot.autoShoot ? 'checked' : ''} style="margin-right: 8px;">
412 <span>Auto Shoot</span>
413 </label>
414 </div>
415 <div style="margin-bottom: 8px;">
416 <label style="display: flex; align-items: center; cursor: pointer;">
417 <input type="checkbox" id="esp-toggle" ${config.esp.enabled ? 'checked' : ''} style="margin-right: 8px;">
418 <span>ESP Wallhack</span>
419 </label>
420 </div>
421 <div style="margin-bottom: 8px;">
422 <label style="display: flex; align-items: center; cursor: pointer;">
423 <input type="checkbox" id="headshot-toggle" ${config.aimbot.targetHead ? 'checked' : ''} style="margin-right: 8px;">
424 <span>Target Head</span>
425 </label>
426 </div>
427 <div style="margin-bottom: 8px;">
428 <label style="display: block; margin-bottom: 4px;">FOV: <span id="fov-value">${config.aimbot.fov}</span>°</label>
429 <input type="range" id="fov-slider" min="30" max="360" value="${config.aimbot.fov}" style="width: 100%;">
430 </div>
431 <div style="margin-bottom: 8px;">
432 <label style="display: block; margin-bottom: 4px;">Smoothing: <span id="smooth-value">${config.aimbot.smoothing}</span></label>
433 <input type="range" id="smooth-slider" min="0.1" max="1" step="0.1" value="${config.aimbot.smoothing}" style="width: 100%;">
434 </div>
435 <div style="margin-top: 10px; padding-top: 10px; border-top: 1px solid #444; font-size: 10px; color: #888;">
436 <div>Status: <span id="status" style="color: #0f0;">Active</span></div>
437 <div>Players: <span id="player-count">0</span></div>
438 </div>
439 </div>
440 `;
441 document.body.appendChild(ui);
442
443 // Event listeners
444 document.getElementById('aimbot-toggle').addEventListener('change', (e) => {
445 config.aimbot.enabled = e.target.checked;
446 console.log('[Veck.io Aimbot] Aimbot:', config.aimbot.enabled ? 'ON' : 'OFF');
447 });
448
449 document.getElementById('autoshoot-toggle').addEventListener('change', (e) => {
450 config.aimbot.autoShoot = e.target.checked;
451 console.log('[Veck.io Aimbot] Auto Shoot:', config.aimbot.autoShoot ? 'ON' : 'OFF');
452 });
453
454 document.getElementById('esp-toggle').addEventListener('change', (e) => {
455 config.esp.enabled = e.target.checked;
456 console.log('[Veck.io Aimbot] ESP:', config.esp.enabled ? 'ON' : 'OFF');
457 });
458
459 document.getElementById('headshot-toggle').addEventListener('change', (e) => {
460 config.aimbot.targetHead = e.target.checked;
461 console.log('[Veck.io Aimbot] Target Head:', config.aimbot.targetHead ? 'ON' : 'OFF');
462 });
463
464 document.getElementById('fov-slider').addEventListener('input', (e) => {
465 config.aimbot.fov = parseInt(e.target.value);
466 document.getElementById('fov-value').textContent = config.aimbot.fov;
467 });
468
469 document.getElementById('smooth-slider').addEventListener('input', (e) => {
470 config.aimbot.smoothing = parseFloat(e.target.value);
471 document.getElementById('smooth-value').textContent = config.aimbot.smoothing;
472 });
473
474 // Keyboard controls
475 document.addEventListener('keydown', (e) => {
476 if (e.code === config.aimbot.aimKey) {
477 isAiming = true;
478 }
479 });
480
481 document.addEventListener('keyup', (e) => {
482 if (e.code === config.aimbot.aimKey) {
483 isAiming = false;
484 }
485 });
486
487 console.log('[Veck.io Aimbot] UI created');
488 }
489
490 // Start aimbot
491 function startAimbot() {
492 console.log('[Veck.io Aimbot] Starting aimbot loop...');
493
494 // Main loop
495 setInterval(() => {
496 aimbotLoop();
497 renderESP();
498
499 // Update UI
500 const playerCount = document.getElementById('player-count');
501 if (playerCount) {
502 playerCount.textContent = players.length;
503 }
504 }, 16); // ~60 FPS
505 }
506
507 // Initialize
508 function init() {
509 console.log('[Veck.io Aimbot] Initializing...');
510
511 // Wait for page load
512 if (document.readyState === 'loading') {
513 document.addEventListener('DOMContentLoaded', initIframe);
514 } else {
515 initIframe();
516 }
517 }
518
519 // Start the extension
520 init();
521
522})();