Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save OutOfBrain/23d8be9dbe4403f6f9fa17a572109d37 to your computer and use it in GitHub Desktop.
Save OutOfBrain/23d8be9dbe4403f6f9fa17a572109d37 to your computer and use it in GitHub Desktop.
Slither.io MODS with Zoom and Less Latency for Tampermonkey
// ==UserScript==
// @name Slither.io Mods
// @namespace DerpCookiePrograms
// @version 0.1
// @description Sliter.io Mods
// @author DerpCookiePrograms
// @match http://slither.io/*
// @grant none
// ==/UserScript==
(function(w) {
//Append div
function appendDiv(id, className, style) {
var div = document.createElement("div");
if (id) {
div.id = id;
}
if (className) {
div.className = className;
}
if (style) {
div.style = style;
}
document.body.appendChild(div);
}
//Set leaderboard text
function lb() {
if (w.lbh) w.lbh.textContent = "Leaderboard";
else setTimeout(lb, 0);
}
//Boardy Stuff
function zoom(e) {
if (!w.gsc) {
return;
}
w.gsc *= Math.pow(0.9, e.wheelDelta / -120 || e.detail / 2 || 0);
}
var iStyle = 'position: fixed; top: 10px; left: 15px; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999; border-radius: 5px; min-height: 15px; min-width: 200px; background-color: rgba(0, 0, 0, 0.6);',
data = null,
v = 0.1;
//Append divs
appendDiv("DerpCookiePrograms", "DerpCookiePrograms", iStyle + "top: 100px;");
data = document.getElementById("DerpCookiePrograms");
//Zoom ZOOOOOOOM
if (/firefox/i.test(navigator.userAgent)) {
document.addEventListener("DOMMouseScroll", zoom, false);
} else {
document.body.onmousewheel = zoom;
}
//Keep updating data
function dt() {
if (w.playing) {
//Loopy Loops XD :D
if (data) data.innerHTML = '<div id="DerpCookiePrograms" className="DerpCookiePrograms" style="font-family: Sans Serif; font-size: 20px; color: Orange;"><b>Slither.io Mods Beta ' + v + '</b></div>' + "<br>" +
'<div id="DerpCookiePrograms" className="DerpCookiePrograms" style="color: yellow;"><b>Made By DerpCookiePrograms</b></div>' + "<br>" +
'<div id="slitherio" className="DerpCookiePrograms" style="color: lightblue; font-size: 17px"><sup><b>My Website: derpcookieprograms.weebly.com</b></sup></div>' + "<br>" +
'<div id="Hotkeys" className="DerpCookiePrograms" style="color: green;">[Mouse wheel] - Zoom</div>' + "<br>" +
"X: " + ~~w.snake.xx + "<br>" +
"Y: " + ~~w.snake.yy + "<br>" +
"Rank: " + w.rank + "/" + w.snake_count + "<br>" +
"Server IP: " + w.bso.ip;
}
setTimeout(dt, 0);
}
dt();
lb();
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment