Script completo con zoom en tiempo real, optimización, anti-lag, bypass de anuncios y más
当前为
// ==UserScript==
// @name Little Big Snake Script Ultra Completo
// @namespace http://tampermonkey.net/
// @version 2024-08-19
// @description Script completo con zoom en tiempo real, optimización, anti-lag, bypass de anuncios y más
// @author You
// @match https://littlebigsnake.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_addStyle
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
if (window.location.hostname !== 'littlebigsnake.com') return;
// Variables globales
let autoEmojiInterval = null;
let autoEmojiBackupInterval = null;
let currentEmojiNumber = 1;
let isAutoEmojiActive = false;
let gameCanvas = null;
const CONFIG = {
performance: {
originalRAF: null,
fpsLimit: 60,
lastFrameTime: 0,
},
intervals: new Set(),
};
const styles = `
.custom-menu {
position: fixed;
top: 20px;
left: 0;
width: 300px;
background-color: rgba(255, 255, 255, 0.95);
border: 5px solid #000;
padding: 20px;
border-radius: 15px;
transition: all 0.3s ease;
transform: translateX(-100%);
z-index: 9999;
}
.menu-title {
text-align: center;
font-size: 24px;
color: #4CAF50;
margin-bottom: 20px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.option {
display: flex;
justify-content: space-between;
margin: 15px 0;
padding: 10px;
border-radius: 10px;
background: rgba(0, 0, 0, 0.1);
transition: background 0.3s ease;
}
.option:hover {
background: rgba(0, 0, 0, 0.2);
}
.switch {
position: relative;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background-color: #ccc;
border-radius: 34px;
transition: .4s;
}
input:checked + .slider {
background-color: #4CAF50;
}
.menu-toggle-btn {
position: fixed;
top: 20px;
left: 310px;
padding: 12px;
background-color: #4CAF50;
border-radius: 10px;
color: white;
cursor: pointer;
}
`;
GM_addStyle(styles);
const GameOptimizer = {
init() {
CONFIG.performance.originalRAF = window.requestAnimationFrame;
this.setupPerformanceMonitors();
},
setupPerformanceMonitors() {
const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
if (entry.duration > 100) this.optimizeElement(entry.name);
});
});
observer.observe({ entryTypes: ['measure', 'resource'] });
},
optimizeElement(elementName) {
const element = document.querySelector(elementName);
if (element) {
element.style.transform = 'translateZ(0)';
element.style.willChange = 'transform';
}
},
optimizeRendering() {
if (window.game && window.game.renderer) {
window.game.renderer.autoResize = false;
window.game.renderer.roundPixels = true;
}
},
optimizeMemory() {
setInterval(() => {
window.game?.renderer?.textureGC.run();
}, 30000);
},
};
const AdBypass = {
enable() {
window.adSystem = { isReady: () => true, showAd: (cb) => cb?.({ type: 'complete' }) };
Object.defineProperty(window, 'isAdBlockerEnabled', { get: () => false });
},
};
function applyZoom(zoomValue) {
try {
if (!gameCanvas) gameCanvas = document.querySelector('canvas');
const minZoom = 0.5, maxZoom = 2.0;
const scale = minZoom + (maxZoom - minZoom) * (100 - zoomValue) / 100;
gameCanvas.style.transform = `scale(${scale})`;
localStorage.setItem('snakeGameZoom', zoomValue);
} catch (error) {
console.error('Error al aplicar zoom:', error);
}
}
function toggleAutoEmoji(enabled) {
isAutoEmojiActive = enabled;
const speed = parseInt(document.getElementById('emojiSpeed').value);
clearInterval(autoEmojiInterval);
if (enabled) {
autoEmojiInterval = setInterval(() => {
if (isAutoEmojiActive) {
simulateKeyPress(currentEmojiNumber.toString());
currentEmojiNumber = currentEmojiNumber >= 10 ? 1 : currentEmojiNumber + 1;
}
}, speed);
localStorage.setItem('autoEmojiEnabled', 'true');
} else {
localStorage.removeItem('autoEmojiEnabled');
}
}
function simulateKeyPress(key) {
const event = new KeyboardEvent('keydown', { key });
document.dispatchEvent(event);
}
// Eventos del menú
function toggleMenu() {
const menu = document.querySelector('.custom-menu');
menu.style.transform = menu.style.transform === 'translateX(0%)' ? 'translateX(-100%)' : 'translateX(0%)';
}
function initializeMenu() {
const menu = document.createElement('div');
menu.className = 'custom-menu';
menu.innerHTML = `
<div class="menu-title">Little Big Snake Ultra</div>
<div class="option">
<span>Auto Emoji</span>
<label class="switch">
<input type="checkbox" id="autoEmojiSwitch">
<span class="slider"></span>
</label>
</div>
<input type="range" min="0" max="100" value="50" class="zoom-slider" id="zoomSlider">
`;
document.body.appendChild(menu);
const toggleBtn = document.createElement('button');
toggleBtn.className = 'menu-toggle-btn';
toggleBtn.innerText = 'Menu';
toggleBtn.onclick = toggleMenu;
document.body.appendChild(toggleBtn);
document.getElementById('autoEmojiSwitch').onchange = (e) => toggleAutoEmoji(e.target.checked);
document.getElementById('zoomSlider').oninput = (e) => applyZoom(e.target.value);
}
// Inicialización del script
window.addEventListener('load', () => {
GameOptimizer.init();
AdBypass.enable();
initializeMenu();
});
})();