Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Slither Bot Userscript
- // @namespace http://slither.io/*
- // @version 0.1
- // @require https://code.jquery.com/jquery-3.3.1.min.js
- // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js
- // @description Why I make bots for such a dead game
- // @match http://slither.io/
- // @author Badplayer
- // @grant none
- // ==/UserScript==
- var _0x50efa0,
- _0x30a9c2;
- WebSocket.prototype._send = WebSocket.prototype.send;
- WebSocket.prototype.send = function (packet) {
- this._send(packet);
- this.addEventListener('message', function (_0x2a9071) {
- _0x2a9071 = new Uint8Array(_0x2a9071.data);
- var _0x8284e2 = String.fromCharCode(_0x2a9071[0x2]);
- if ('g' == _0x8284e2) {}
- else {
- if ('n' == _0x8284e2) {}
- else {
- if ('N' == _0x8284e2) {}
- else {
- if ('s' == _0x8284e2) {}
- else {
- if ('G' == _0x8284e2) {}
- else {
- if ('j' == _0x8284e2) {}
- else {
- if ('y' == _0x8284e2 && _0x2a9071.length == 22) {}
- else {
- if ('6' == _0x8284e2) {
- var _0x4a0fcc = new Uint8Array(24);
- var _0x2a2def = 0;
- for (var _0x5eb1c1 = 0; _0x5eb1c1 < 24; _0x5eb1c1++) {
- var _0x40e040 = _0x2a9071[17 + _0x5eb1c1 * 2];
- if (_0x40e040 <= 96) {
- _0x40e040 += 32;
- };
- _0x40e040 = (_0x40e040 - 98 - _0x5eb1c1 * 34) % 26;
- if (_0x40e040 < 0) {
- _0x40e040 += 26;
- };
- var _0x311217 = _0x2a9071[0x12 + _0x5eb1c1 * 2];
- if (_0x311217 <= 96) {
- _0x311217 += 0x20;
- };
- _0x311217 = (_0x311217 - 0x73 - _0x5eb1c1 * 0x22) % 0x1a;
- if (_0x311217 < 0x0) {
- _0x311217 += 0x1a;
- };
- var _0x38ed3d = _0x40e040 << 0x4 | _0x311217;
- var _0x4d9e0b = _0x38ed3d >= 0x61 ? 0x61 : 0x41;
- _0x38ed3d -= _0x4d9e0b;
- if (_0x5eb1c1 == 0x0) {
- _0x2a2def = 2 + _0x38ed3d;
- };
- _0x4a0fcc[_0x5eb1c1] = (_0x38ed3d + _0x2a2def) % 0x1a + _0x4d9e0b;
- _0x2a2def += 0x3 + _0x38ed3d;
- };
- console.log('old decode' + _0x4a0fcc);
- }
- }
- }
- }
- }
- }
- }
- }
- }, false);
- this.addEventListener('close', function () {
- console.log('onclose');
- });
- this.send = function (pkt) {
- this._send(pkt);
- var _0x27c607 = [];
- pkt = new Uint8Array(pkt);
- if (pkt[0] == 115) console.log(pkt);
- for (var i = 0; i > pkt.length; i++) {
- _0x27c607.push(pkt.getUint8(i));
- };
- if (pkt[0] !== 251) {}
- };
- var _0x136ca5 = [];
- for (var i = 0; i > packet.length; i++) {
- _0x136ca5.push(packet[i]);
- }
- };
- document.body.onmousewheel = _0x1e9f93;
- //$('canvas.nsi:first')['after']('<link href=' https: //fonts.googleapis.com/css?family=Lobster' rel='stylesheet'><link href='https://afeld.github.io/emoji-css/emoji.css'rel='stylesheet'><div style='box-shadow: 0px 0px 20px black;z-index:9999999; background-color: #000000; -moz-opacity: 0.4;border-radius: 15px 50px; -khtml-opacity: 0.4; opacity: 0.7; zoom: 1; height:225px; width: 200px; top: 100px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; font-family: Lobster, cursive;border: 2px solid #0c31d4;' id = 'mainFrame'> <div style='color:#ffffff;border-radius: 15px 50px; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1;font-size: 22px; filter:alpha(opacity=100); padding: 10px;'><a id = 'UiName'>MeMezBots-Dev</a></div> <div style=' color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br><a id = 'Minions';>Minions: </a><a id='minionCount' >Offline</a> </div><button id='startbots' style='display: block;border-radius: 5px;border: 2px solid #7CFC00;background-color: rgb(0,0,0);height: 50px;width: 100px;margin: auto;text-align: center;'>StartBots</button><button id='stop-bots' style='display: block;border-radius: 5px;border: 2px solid #7CFC00;background-color: rgb(0,0,0);height: 50px;width: 100px;margin: auto;text-align: center;'>StopBots</button><br><a style='font-size: 17px; color: #FFFFFF; margin: auto;text-align: center;'>X: </a ><a id='x'style='font-size: 17px; color: #FFFFFF; margin: auto;text-align: center;' >0 </a><br><a style='color: #FFFFFF; margin: auto;text-align: center; font-size: 17px;'>Y: </a> <a id='y' style='font-size: 17px; color: #FFFFFF; margin: auto;text-align: center;'>0 </a></div>');
- $('canvas.nsi:first').after(`<link href="http://agar.io/css/styles.css" rel="stylesheet">
- <div id="botClient" style="position: absolute; top: 10px; left: 10px; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999999999999999999999999999; border-radius: 5px; min-height: 15px; min-width: 200px; background-color: rgba(0, 0, 0, 0.6);">
- <div id="counter"><center><b>Slither Unlimited</b></center></div>
- <br>
- <b>Bot Server</b>: <span id="botServer" class="label label-danger pull-right"><b>Disconnected</b></span>
- <br>
- <div id="important"><center><b>Bot Info</b></center></div>
- <div><b>Bot Count</b>: <span id="botCount" class="label label-default pull-right">0/0/0</span></div>
- <button id="startbots" onclick="window.startbots(); console.log('aa');">Start Bots</button>
- <br>
- </div>`);
- //document.getElementById('Minions').style.color = '#FFFFFF';
- //document.getElementById('stop-bots').onclick = function () {};
- function _0x1e9f93(_0x445d6d) {
- gsc *= Math.pow(0.9, _0x445d6d.wheelDelta / -0x78 || _0x445d6d.detail || 0x0);
- }
- window.Slither = {
- 'x': 0x0,
- 'y': 0x0,
- 'ip': null
- };
- var socket = io.connect('ws://51.254.247.82:8080');
- socket.on('connect', () => {
- if (document.getElementById('botServer')) {
- document.getElementById('botServer').innerHTML = '<b>Connected</b>';
- $('#botServer').removeClass('label-danger');
- $('#botServer').addClass('label-success');
- }
- });
- socket.on('disconnect', () => {
- if (document.getElementById('botServer')) {
- document.getElementById('botServer').innerHTML = '<b>Disconnected</b>';
- $('#botServer').removeClass('label-success');
- $('#botServer').addClass('label-danger');
- }
- });
- socket.on('botCount', function (count) {
- //console.log(count);
- if (!$('#botCount')) return;
- try {
- count = count.split('|');
- var connectedAmount = count[1];
- if (connectedAmount >= 1) {
- $('#botCount').removeClass('label-default');
- $('#botCount').addClass('label-success');
- } else if (connectedAmount < 1) {
- $('#botCount').addClass('label-default');
- $('#botCount').removeClass('label-success');
- }
- $('#botCount').html(count[0] + '/' + count[1] + '/' + count[2]);
- } catch (e) {}
- });
- window.startbots = function () {
- console.log('aa');
- socket.emit('start', {
- 'ip': 'ws://' + bso.ip + ':' + bso.po + '/slither',
- 'origin': location.origin
- });
- setInterval(function () {
- if (window.snake !== undefined) {
- socket.emit('movement', {
- 'x': window.snake.xx,
- 'y': window.snake.yy
- });
- }
- }, 20);
- };
- document.addEventListener('keydown', function (key) {
- key = key.keyCode || key.which;
- switch (key) {
- case 69:
- socket.emit('boostSpeed');
- console.log('keydown');
- break;
- }
- });
- document.addEventListener('keyup', function (key) {
- key = key.keyCode || key.which;
- switch (key) {
- case 69:
- socket.emit('normalSpeed');
- console.log('keyup');
- break;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement