Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Tribals.io Wallhack + Simple UI
- // @namespace http://tampermonkey.net/
- // @version 1.1
- // @description See through walls in Tribals.io with a simple click UI
- // @author ChatGPT Fixer
- // @match *://tribals.io/*
- // @grant none
- // @run-at document-idle
- // ==/UserScript==
- (function() {
- 'use strict';
- let wallhackEnabled = false;
- let webglContexts = new Set();
- // Hook all WebGL contexts when created
- const originalGetContext = HTMLCanvasElement.prototype.getContext;
- HTMLCanvasElement.prototype.getContext = function(type, attrs) {
- const ctx = originalGetContext.call(this, type, attrs);
- if (type === 'webgl' || type === 'experimental-webgl') {
- hookWebGLContext(ctx);
- }
- return ctx;
- };
- // Function to hook WebGL functions
- function hookWebGLContext(gl) {
- if (webglContexts.has(gl)) return; // Already hooked
- webglContexts.add(gl);
- console.log('[+] Hooked WebGL Context!');
- const originalDrawElements = gl.drawElements;
- const originalDrawArrays = gl.drawArrays;
- gl.drawElements = function(...args) {
- if (wallhackEnabled) gl.disable(gl.DEPTH_TEST);
- else gl.enable(gl.DEPTH_TEST);
- return originalDrawElements.apply(this, args);
- };
- gl.drawArrays = function(...args) {
- if (wallhackEnabled) gl.disable(gl.DEPTH_TEST);
- else gl.enable(gl.DEPTH_TEST);
- return originalDrawArrays.apply(this, args);
- };
- }
- // Create simple toggle menu
- function createWallhackMenu() {
- const menuDiv = document.createElement('div');
- menuDiv.style = `
- position: fixed;
- bottom: 60px;
- left: 20px;
- width: 140px;
- padding: 8px;
- background: rgba(0, 0, 0, 0.6);
- color: red;
- font-family: monospace;
- font-size: 14px;
- border: 1px solid red;
- border-radius: 8px;
- z-index: 999999;
- user-select: none;
- cursor: pointer;
- text-align: center;
- `;
- menuDiv.innerText = '[OFF] WALLHACK';
- // Toggle on click
- menuDiv.onclick = () => {
- wallhackEnabled = !wallhackEnabled;
- menuDiv.innerText = wallhackEnabled ? '[ON] WALLHACK' : '[OFF] WALLHACK';
- menuDiv.style.color = wallhackEnabled ? 'lime' : 'red';
- console.log(`Wallhack toggled: ${wallhackEnabled ? 'ON' : 'OFF'}`);
- };
- document.body.appendChild(menuDiv);
- }
- // Mutation observer to hook late canvases
- const observer = new MutationObserver((mutations) => {
- mutations.forEach((mutation) => {
- mutation.addedNodes.forEach((node) => {
- if (node.tagName === 'CANVAS') {
- console.log('[+] New canvas detected!');
- const ctx = node.getContext('webgl') || node.getContext('experimental-webgl');
- if (ctx) hookWebGLContext(ctx);
- }
- });
- });
- });
- observer.observe(document.body, { childList: true, subtree: true });
- // Run the menu after DOM loaded
- window.addEventListener('load', () => {
- createWallhackMenu();
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement