Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name GabyGaming
- // @namespace GabyGaming
- // @version 0.1.4
- // @description slither.io MOD
- // @author GabyGaming
- // @match http://slither.io/*
- // @updateURL http://ogario.ovh/download/SLITio.user.js
- // @grant none
- // ==/UserScript==
- (function(w) {
- var renderMode = 2, // 2 - normal, 1 - simple (mobile)
- gameFPS = null,
- positionHUD = null,
- fpsHUD = null,
- ipHUD = null,
- styleHUD = "color: #FFF; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; position: fixed; opacity: 0.35; z-index: 100;",
- clearedBg = false,
- clearedGlow = false;
- function init() {
- // Append DIVs
- appendDiv("position-hud", "nsi", styleHUD + "right: 30; bottom: 120px;");
- appendDiv("fps-hud", "nsi", styleHUD + "right: 30; bottom: 140px;");
- appendDiv("ip-hud", "nsi", styleHUD + "right: 30; bottom: 8;");
- positionHUD = document.getElementById("position-hud");
- fpsHUD = document.getElementById("fps-hud");
- ipHUD = document.getElementById("ip-hud");
- // Add zoom
- if (/firefox/i.test(navigator.userAgent)) {
- document.addEventListener("DOMMouseScroll", zoom, false);
- } else {
- document.body.onmousewheel = zoom;
- }
- // Hijack console log
- if (window.console) {
- window.console.logOld = console.log;
- window.console.log = getConsoleLog;
- }
- // Set game
- setGame();
- // Clear background and glow
- clearBg();
- // Update game
- updateGame();
- }
- // 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);
- }
- // Zoom
- function zoom(e) {
- if (!w.gsc) {
- return;
- }
- w.gsc *= Math.pow(0.9, e.wheelDelta / -120 || e.detail || 0);
- }
- // Get console log
- function getConsoleLog(log) {
- window.console.logOld(log);
- if (log.indexOf("FPS") != -1) {
- gameFPS = log;
- }
- }
- // Set game
- function setGame() {
- if (w.render_mode && w.render_mode != renderMode) {
- w.render_mode = renderMode;
- }
- if (w.high_quality) {
- w.high_quality = false;
- }
- if (w.gla && w.gla != 0) {
- w.gla = 0;
- }
- }
- // Clear background and glow
- function clearBg() {
- if (clearedBg && clearedGlow) {
- return;
- }
- if (w.ii && !clearedBg) {
- w.ii.src = "";
- w.ii.onload = null;
- w.ii = null;
- if (w.bgi2) {
- w.bgi2 = null;
- }
- clearedBg = true;
- }
- if (w.ggbg) {
- w.ggbg = false;
- }
- if (w.gbgi && !clearedGlow) {
- w.gbgi.src = "";
- w.gbgi.onload = null;
- w.gbgi = null;
- if (w.gbgmc) {
- w.gbgmc = null;
- }
- clearedGlow = true;
- }
- setTimeout(clearBg, 50);
- }
- // Update game
- function updateGame() {
- if (positionHUD) {
- positionHUD.textContent = "X: " + (~~w.view_xx || 0) + " Y: " + (~~w.view_yy || 0);
- }
- if (fpsHUD && gameFPS) {
- fpsHUD.textContent = gameFPS;
- }
- if (ipHUD && w.bso) {
- ipHUD.textContent = "IP: " + w.bso.ip + ":" + w.bso.po;
- }
- setGame();
- setTimeout(updateGame, 500);
- }
- // Init
- init();
- })(window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement