Slither.io script (Tariq)

s to pause, q to split 16, left mouse click is to feed.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Slither.io script (Tariq)
// @namespace    http://tampermonkey.net/
// @version      1.15
// @description s to pause, q to split 16, left mouse click is to feed. 
// @author       All credits belong to Ali Ahfad Mehdi, I only edited a few lines and modified it to pause whenever a user is typing in chat.- GoogleFutanari.
// @match        http://slither.io/*
// @grant        none
// @run-at       document-end
// @license MIT
// ==/UserScript==
window.addEventListener('keydown', keydown);
window.addEventListener('keyup', keyup);
var Feed = false;
var Speed = 25;
 
//Funtions
function split() {
    $("body").trigger($.Event("keydown", { keyCode: 32}));
   // $("body").trigger($.Event("keyup", { keyCode: 32}));
}
function mass() {
    if (Feed) {
        window.onkeydown({keyCode: 87});
        window.onkeyup({keyCode: 87});
        setTimeout(mass, Speed);
    }
}
 
function keydown(event) {
    // Feed Macro
    var dummyEl = document.getElementById('chat_textbox');
    //only execute the following code if the chatbox is not active.
    console.log(dummyEl == document.activeElement);
    if(!(dummyEl == document.activeElement)){
    if (event.keyCode == 69 )                                        // E
    {
        Feed = true;
        setTimeout(mass, Speed);
    }// Center(this pauses your blob)
    if (event.keyCode == 83) {                                       // S
       var  X = window.innerWidth/2;
       var  Y = window.innerHeight/2;
        $("canvas").trigger($.Event("mousemove", {clientX: X, clientY: Y}));
 
    }
    // Tricksplit
    if (event.keyCode == 81) {                // q
        split();
        setTimeout(split, Speed);
        setTimeout(split, Speed*2);
        setTimeout(split, Speed*3);
        setTimeout(split, Speed*4);
 
    } // Triplesplit
    if (event.keyCode == 32) {         // spacebar
        split();
        setTimeout(split, Speed);
        setTimeout(split, Speed*2);
    } // Doublesplit
    if (event.keyCode == 48) {         // d for double split
        split();
        setTimeout(split, Speed);
    }// Split
    if (event.keyCode == 'yourkey' || event.keyCode == 'yourkey2') { // Put in Your Key
        split();
    }
    }
 
} // When Player Lets Go Of E, It Stops Feeding
function keyup(event) {
    if (event.keyCode == 69 || event.keyCode == 83) {
        Feed = false;
    }
}
 
//Mouse Clicks
(function() {
    document.getElementById("canvas").addEventListener("mousedown", function(event) {
        if (event.which == 1) {
            Feed = true;
            setTimeout(mass, Speed);
        }
        else if (event.which == 2) {
            split();
            setTimeout(split, Speed);
            setTimeout(split, Speed*2);
            setTimeout(split, Speed*3);
        }
   
    });
 
    document.getElementById("canvas").addEventListener("mouseup", function(event) {
        if (event.which == 1) {
            Feed = false;
        }
    });
    $('#canvas').bind('contextmenu', function(e) {
        e.preventDefault();
    });
}());
//Go Ahead, Mess Around. ( ͡ᵔ ͜ʖ ͡ᵔ )
//CREDITS TO: JACK BURCH AND TOM BURRIS
//Thanks Guys You Inspired Me.