// ==UserScript==
// @name Hammer Senpa.io Mod - Performance & Visual Enhancements with GUI
// @namespace http://tampermonkey.net/
// @version 1.3
// @description Optimize Senpa.io with FPS optimization, freeze on death, and visual effects, all customizable via GUI
// @author Hammer
// @match https://senpa.io/*
// @grant GM_addStyle
// ==/UserScript==
(function () {
'use strict';
let optimizationEnabled = true;
let fxOn = true;
let isFrozen = false;
const smallGui = document.createElement('div');
smallGui.id = 'small-gui';
Object.assign(smallGui.style, {
position: 'fixed',
bottom: '20px',
right: '20px',
width: '50px',
height: '50px',
backgroundColor: 'rgba(0, 0, 0, 0.7)',
color: 'white',
textAlign: 'center',
fontSize: '14px',
borderRadius: '5px',
cursor: 'pointer',
zIndex: '9999',
border: '2px solid red'
});
smallGui.innerText = 'Mods';
document.body.appendChild(smallGui);
const guiContainer = document.createElement('div');
guiContainer.id = 'gui-container';
Object.assign(guiContainer.style, {
position: 'fixed',
bottom: '100px',
right: '20px',
width: '250px',
backgroundColor: 'rgba(0, 0, 0, 0.8)',
color: 'white',
padding: '20px',
borderRadius: '10px',
zIndex: '9999',
display: 'none',
fontFamily: 'Arial, sans-serif',
border: '2px solid red'
});
const closeButton = document.createElement('button');
closeButton.innerText = 'X';
Object.assign(closeButton.style, {
backgroundColor: '#dc3545',
color: 'white',
border: 'none',
padding: '5px',
borderRadius: '50%',
cursor: 'pointer',
position: 'absolute',
top: '10px',
right: '10px'
});
closeButton.addEventListener('click', () => {
guiContainer.style.display = 'none';
hammerText.style.display = 'none';
});
const hammerText = document.createElement('div');
hammerText.innerText = 'made by hammer <3';
Object.assign(hammerText.style, {
color: '#fff',
fontSize: '14px',
textAlign: 'center',
marginTop: '20px',
display: 'none'
});
function createToggleButton(textOn, textOff, initialState, callback) {
const btn = document.createElement('button');
btn.innerText = initialState ? textOff : textOn;
btn.style.backgroundColor = initialState ? '#28a745' : '#dc3545';
btn.style.color = 'white';
btn.style.border = 'none';
btn.style.padding = '10px';
btn.style.borderRadius = '5px';
btn.style.cursor = 'pointer';
btn.style.marginBottom = '10px';
btn.addEventListener('click', () => {
const newState = callback();
btn.innerText = newState ? textOff : textOn;
btn.style.backgroundColor = newState ? '#28a745' : '#dc3545';
});
return btn;
}
guiContainer.appendChild(closeButton);
guiContainer.appendChild(createToggleButton('Enable FPS Optimization', 'Disable FPS Optimization', optimizationEnabled, () => {
optimizationEnabled = !optimizationEnabled;
optimizationEnabled ? enableOptimization() : disableOptimization();
return optimizationEnabled;
}));
guiContainer.appendChild(createToggleButton('Enable FX', 'Disable FX', fxOn, () => {
fxOn = !fxOn;
applyVisualEffects();
return fxOn;
}));
guiContainer.appendChild(createToggleButton('Freeze on Death', 'Unfreeze on Death', isFrozen, () => {
isFrozen = !isFrozen;
return isFrozen;
}));
guiContainer.appendChild(hammerText);
document.body.appendChild(guiContainer);
smallGui.addEventListener('click', () => {
const isHidden = guiContainer.style.display === 'none';
guiContainer.style.display = isHidden ? 'block' : 'none';
hammerText.style.display = isHidden ? 'block' : 'none';
});
function applyVisualEffects() {
const canvas = document.querySelector('canvas');
if (canvas) {
canvas.style.filter = fxOn ? 'brightness(1.1) contrast(1.2) saturate(1.1)' : 'none';
}
}
function enableOptimization() {
document.body.style.backgroundImage = 'none';
document.querySelectorAll('img').forEach(img => img.src = '');
const style = document.createElement('style');
style.innerHTML = `
* {
animation: none !important;
transition: none !important;
box-shadow: none !important;
}
canvas {
image-rendering: optimizeSpeed;
will-change: transform;
}
body, html {
background: #000 !important;
overflow: hidden;
margin: 0;
padding: 0;
}
`;
document.head.appendChild(style);
document.querySelectorAll('audio').forEach(audio => audio.pause());
document.querySelectorAll('.ad, .sidebar, .popup').forEach(ad => ad.remove());
}
function disableOptimization() {
const style = document.createElement('style');
style.innerHTML = `
* {
animation: initial !important;
transition: initial !important;
}
`;
document.head.appendChild(style);
}
function freezeOnDeath() {
if (!isFrozen) return;
const player = document.querySelector('.player');
if (!player) return;
isFrozen = true;
const preventMovement = e => { e.preventDefault(); e.stopPropagation(); };
document.addEventListener('keydown', preventMovement);
document.addEventListener('mousemove', preventMovement);
document.addEventListener('mousedown', preventMovement);
setTimeout(() => {
isFrozen = false;
document.removeEventListener('keydown', preventMovement);
document.removeEventListener('mousemove', preventMovement);
document.removeEventListener('mousedown', preventMovement);
}, 3000);
}
setInterval(() => {
const deathState = document.querySelector('.dead');
if (deathState && isFrozen) {
freezeOnDeath();
}
}, 1000);
if (optimizationEnabled) enableOptimization();
if (fxOn) applyVisualEffects();
})();