Advertisement
Guest User

tribals

a guest
Mar 12th, 2025
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Tribals.io Wallhack + Simple UI
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description See through walls in Tribals.io with a simple click UI
  6. // @author ChatGPT Fixer
  7. // @match *://tribals.io/*
  8. // @grant none
  9. // @run-at document-idle
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let wallhackEnabled = false;
  16. let webglContexts = new Set();
  17.  
  18. // Hook all WebGL contexts when created
  19. const originalGetContext = HTMLCanvasElement.prototype.getContext;
  20. HTMLCanvasElement.prototype.getContext = function(type, attrs) {
  21. const ctx = originalGetContext.call(this, type, attrs);
  22. if (type === 'webgl' || type === 'experimental-webgl') {
  23. hookWebGLContext(ctx);
  24. }
  25. return ctx;
  26. };
  27.  
  28. // Function to hook WebGL functions
  29. function hookWebGLContext(gl) {
  30. if (webglContexts.has(gl)) return; // Already hooked
  31. webglContexts.add(gl);
  32.  
  33. console.log('[+] Hooked WebGL Context!');
  34.  
  35. const originalDrawElements = gl.drawElements;
  36. const originalDrawArrays = gl.drawArrays;
  37.  
  38. gl.drawElements = function(...args) {
  39. if (wallhackEnabled) gl.disable(gl.DEPTH_TEST);
  40. else gl.enable(gl.DEPTH_TEST);
  41. return originalDrawElements.apply(this, args);
  42. };
  43.  
  44. gl.drawArrays = function(...args) {
  45. if (wallhackEnabled) gl.disable(gl.DEPTH_TEST);
  46. else gl.enable(gl.DEPTH_TEST);
  47. return originalDrawArrays.apply(this, args);
  48. };
  49. }
  50.  
  51. // Create simple toggle menu
  52. function createWallhackMenu() {
  53. const menuDiv = document.createElement('div');
  54. menuDiv.style = `
  55. position: fixed;
  56. bottom: 60px;
  57. left: 20px;
  58. width: 140px;
  59. padding: 8px;
  60. background: rgba(0, 0, 0, 0.6);
  61. color: red;
  62. font-family: monospace;
  63. font-size: 14px;
  64. border: 1px solid red;
  65. border-radius: 8px;
  66. z-index: 999999;
  67. user-select: none;
  68. cursor: pointer;
  69. text-align: center;
  70. `;
  71. menuDiv.innerText = '[OFF] WALLHACK';
  72.  
  73. // Toggle on click
  74. menuDiv.onclick = () => {
  75. wallhackEnabled = !wallhackEnabled;
  76. menuDiv.innerText = wallhackEnabled ? '[ON] WALLHACK' : '[OFF] WALLHACK';
  77. menuDiv.style.color = wallhackEnabled ? 'lime' : 'red';
  78. console.log(`Wallhack toggled: ${wallhackEnabled ? 'ON' : 'OFF'}`);
  79. };
  80.  
  81. document.body.appendChild(menuDiv);
  82. }
  83.  
  84. // Mutation observer to hook late canvases
  85. const observer = new MutationObserver((mutations) => {
  86. mutations.forEach((mutation) => {
  87. mutation.addedNodes.forEach((node) => {
  88. if (node.tagName === 'CANVAS') {
  89. console.log('[+] New canvas detected!');
  90. const ctx = node.getContext('webgl') || node.getContext('experimental-webgl');
  91. if (ctx) hookWebGLContext(ctx);
  92. }
  93. });
  94. });
  95. });
  96.  
  97. observer.observe(document.body, { childList: true, subtree: true });
  98.  
  99. // Run the menu after DOM loaded
  100. window.addEventListener('load', () => {
  101. createWallhackMenu();
  102. });
  103.  
  104. })();
  105.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement