// ==UserScript==
// @name TRIBALS.IO SPEEDHACK + SHOTGUN BOOST
// @namespace http://tampermonkey.net/
// @version 2.4
// @description Aumenta a velocidade do jogo e melhora a cadência de tiro da
Shotgun no Tribals.io (com menu móvel)
// @author ExplodIng_Andrey
// @match https://tribals.io/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tribals.io
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
let menuVisible = true;
let isDragging = false;
let offsetX, offsetY;
function createMenu() {
window.UI = document.createElement("div");
UI.innerHTML = `
<div id="menu-header">[ TRIBALS HACK MENU ]</div>
<div class="menu-item">
<label>Game Speed</label>
<input type="range" min="0.1" max="1000" value="1" class="slider"
id="speed" step="0.1">
<div id="value">100%</div>
</div>
<div class="menu-item">
<label>Shotgun Fire Rate</label>
<input type="range" min="0.01" max="2" value="1" class="slider"
id="fireRate" step="0.01">
<div id="fireRateValue">100%</div>
</div>
`;
UI.style = `
left: 20px;
top: 50px;
position: fixed;
border-radius: 15px;
padding: 20px;
background: rgba(0, 0, 0, 0.85);
color: lime;
font-family: "Courier New", monospace;
z-index: 9999;
width: 300px;
height: 350px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
box-shadow: 0px 0px 20px rgba(0, 255, 0, 0.8);
border: 2px solid lime;
animation: fadeIn 0.5s ease-out;
cursor: default;
user-select: none;
`;
document.body.appendChild(UI);
// Estiliza o cabeçalho do menu
const header = UI.querySelector("#menu-header");
header.style = `
font-size: 16px;
font-weight: bold;
width: 100%;
text-align: center;
padding-bottom: 10px;
border-bottom: 2px solid lime;
text-shadow: 0 0 5px lime, 0 0 10px lime;
cursor: move;
`;
// Estiliza os elementos internos
let items = UI.querySelectorAll(".menu-item");
items.forEach(item => {
item.style = `
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: 5px 0;
`;
});
let sliders = UI.querySelectorAll(".slider");
sliders.forEach(slider => {
slider.style.width = "90%";
slider.style.accentColor = "lime";
});
// Controle da velocidade do jogo
const speedInput = UI.querySelector("#speed");
const speedValue = UI.querySelector("#value");
speedInput.addEventListener("input", () => {
let speed = Number(speedInput.value);
speedValue.innerText = speed + "X";
pc.app.timeScale = speed;
});
// Controle da cadência da Shotgun
const fireRateInput = UI.querySelector("#fireRate");
const fireRateValue = UI.querySelector("#fireRateValue");
fireRateInput.addEventListener("input", () => {
const fireRate = Number(fireRateInput.value);
fireRateValue.innerText = Math.round(fireRate * 100) + "%";
let shotgun = pc.app.root.findByName("Shotgun");
if (shotgun) {
shotgun.script.weapon.fireRate = fireRate;
}
});
// Funções para arrastar o menu
header.addEventListener('mousedown', (e) => {
isDragging = true;
offsetX = e.clientX - UI.getBoundingClientRect().left;
offsetY = e.clientY - UI.getBoundingClientRect().top;
UI.style.cursor = 'grabbing';
e.preventDefault(); // Evita seleção de texto durante o arrasto
});
document.addEventListener('mousemove', (e) => {
if (!isDragging) return;
UI.style.left = (e.clientX - offsetX) + 'px';
UI.style.top = (e.clientY - offsetY) + 'px';
});
document.addEventListener('mouseup', () => {
isDragging = false;
UI.style.cursor = 'default';
});
// Alternar visibilidade do menu com a tecla "O"
document.addEventListener("keydown", (event) => {
if (event.key.toLowerCase() === "o") {
menuVisible = !menuVisible;
UI.style.display = menuVisible ? "flex" : "none";
}
// Resetar tudo para o padrão ao pressionar "P"
if (event.key.toLowerCase() === "p") {
speedInput.value = 1;
speedValue.innerText = "1X";
pc.app.timeScale = 1;
fireRateInput.value = 1;
fireRateValue.innerText = "100%";
let shotgun = pc.app.root.findByName("Shotgun");
if (shotgun) {
shotgun.script.weapon.fireRate = 1;
}
}
// Definir velocidade para 1000X ao pressionar "-"
if (event.key === "-") {
speedInput.value = 1000;
speedValue.innerText = "1000X";
pc.app.timeScale = 1000;
}
});
// Animação de entrada
const style = document.createElement("style");
style.innerHTML = `
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
`;
document.head.appendChild(style);
}
function init() {
createMenu();
}
addEventListener("load", init);
// Bypass de proteção do PlayCanvas
window._pc = false;
Object.defineProperty(window, "pc", {
set(value) {
if (!window.pc) {
window._pc = value;
}
},
get() {
return window._pc;
}
});
})();