Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Polar's Minions
- // @namespace PolarsBots.Tk
- // @version 1.0
- // @description New & Improved FULL CREDITS TO: G
- // @author Orad
- // @match *.agariofun.com/*
- // @match *.cellcraft.io/*
- // @match *.agar.io/*
- // @match *.agar.pro/*
- // @match *.agarabi.com/*
- // @match *.warball.co/*
- // @match *.agariom.net/*
- // @match *.agar.re/*
- // @match *.agarpx.com/*
- // @match *.easyagario.com/*
- // @match *.playagario.org/*
- // @match *.agariofr.com/*
- // @match *.agario.xyz/*
- // @match *.agarios.org/*
- // @match *.agariowun.com/*
- // @match *.usagar.com/*
- // @match *.agarioplay.com/*
- // @match *.privateagario.net/*
- // @match *.agariorage.com/*
- // @match *.blong.io/*
- // @match *.agar.blue/*
- // @match *.agar.bio/*
- // @match *.agario.se/*
- // @match *.nbkio.com/*
- // @match *.agariohit.com/*
- // @match *.agariomultiplayer.com/*
- // @match *.agariogameplay.com/*
- // @match *.agariowow.com/*
- // @match *.bestagario.net/*
- // @match *.tytio.com/*
- // @match *.kralagario.com/*
- // @match *.agario.zafer2.com/*
- // @match *.agarprivateserver.net/*
- // @match *.agarca.com/*
- // @match *.agarioplay.mobi/*
- // @match *.agario.mobi*
- // @match *.abs0rb.me/*
- // @match *.agario.us/*
- // @match *.agariojoy.com/*
- // @match *.agario.ch/*
- // @match *.ioagar.us/*
- // @match *.play.agario0.com/*
- // @match *.agario.run/*
- // @match *.agarpvp.us/*
- // @match *.agario.pw/*
- // @match *.ogario.net/*
- // @match *.ogario.net/*
- // @match *.nbk.io/*
- // @match *.agario.info/*
- // @match *.inciagario.com/*
- // @match *.agar.io.biz.tr/*
- // @match *.agariown.com/*
- // @match *.agario.dk/*
- // @match *.agario.lol/*
- // @match *.agario.gen.tr/*
- // @match *.agarioprivateserver.us/*
- // @match *.agariot.com/*
- // @match *.agarw.com/*
- // @match *.agario.city/*
- // @match *.agario.ovh/*
- // @match *.feedy.io/*
- // @match *.agar.zircon.at/*
- // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- setTimeout(function() {
- window.__WebSocket = window.WebSocket;
- window._WebSocket = window.WebSocket = function(){return {};};
- window.__botclonsData = {};
- window.__botclonsData.mx = 0;
- window.__botclonsData.my = 0;
- window.__botclonsData.ml = 0;
- window.__botclonsData.socketaddr = null;
- window.onload = function(){
- // код инжектинга
- if(!window.OldSocket)
- OldSocket = window.__WebSocket;
- _WebSocket = WebSocket = function(ip){
- var ws = new OldSocket(ip);
- ws.binaryType="arraybuffer"
- var fakeWS = {};
- for(var i in ws)
- fakeWS[i] = ws[i];
- fakeWS.send = function(){
- //console.log("перехватили передачу! " + arguments[0]);
- var msg = new DataView(arguments[0]);
- if(msg.byteLength==21){ // Most clones
- if(msg.getInt8(0, true) == 16){
- window.__botclonsData.mx = msg.getFloat64(1, true);
- window.__botclonsData.my = msg.getFloat64(9, true);
- window.__botclonsData.ml = msg.byteLength;
- }
- } else {
- if(msg.byteLength==13){ // Agar.re, agarioforums.io, (maybe) warlis.io
- if(msg.getUint8(0, true) == 16){
- window.__botclonsData.mx = msg.getInt32(1, true);
- window.__botclonsData.my = msg.getInt32(5, true);
- window.__botclonsData.ml = msg.byteLength;
- }else{
- if(msg.byteLength>4){ // gota.io
- if(msg.getUint8(0, true) == 16){
- window.__botclonsData.mx = msg.getInt16(1, true);
- window.__botclonsData.my = msg.getInt16(3, true);
- window.__botclonsData.ml = msg.byteLength;
- }
- }
- }
- }
- }
- return ws.send.apply(ws, arguments);
- };
- ws.onmessage = function(){
- //console.log("перехватили прием! " + arguments[0].data);
- fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
- };
- ws.onopen = function(){
- window.__botclonsData.socketaddr = ws.url;
- //console.log("перехватили подключение!");
- fakeWS.readyState = 1;
- fakeWS.onopen.apply(ws, arguments);
- };
- ws.onclose = function(){
- fakeWS.onclose.apply(ws, arguments);
- };
- return fakeWS;
- }
- }
- var real_minx = -7071;
- var real_miny = -7071;
- var real_maxx = 7071;
- var real_maxy = 7071;
- var lastsent = {
- minx: 0,
- miny: 0,
- maxx: 0,
- maxy: 0
- };
- function valcompare(Y, Z) {
- return 0.01 > Y - Z && -0.01 < Y - Z
- }
- var socket = io.connect('ws://www.polarbotv7-ohpolarv7.c9users.io:8081');
- var canMove = true;
- var movetoMouse = true;
- var moveEvent = new Array(2);
- var canvas = document.getElementById("canvas");
- last_transmited_game_server = null;
- socket.on('force-login', function(data) {
- socket.emit("login", {
- "uuid": client_uuid,
- "type": "client"
- });
- transmit_game_server()
- });
- $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=40); zoom: 1; width: 205px; top: 10px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <div style='color:#FB694A; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><a>Polar's Minions</a></div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bots: <a id='minionCount' >Online</a> </div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Move To Mouse: <a id='ismoveToMouse' >On</a> </div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Stop Movement: <a id='isStopMove' >Off</a> </div>" );
- socket.on('spawn-count', function(data) {
- document.getElementById('minionCount').innerHTML = data
- });
- var client_uuid = localStorage.getItem('client_uuid');
- if (client_uuid == null) {
- console.log("generating a uuid for this user");
- client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
- localStorage.setItem('client_uuid', client_uuid)
- }
- socket.emit("login", client_uuid);
- $("#instructions").replaceWith('<br><div class="input-group"><span class="input-group-addon" id="basic-addon1">UUID</span><input type="text" value="' + client_uuid + '" readonly class="form-control"</div>');
- function isMe(cell) {
- for (var i = 0; i < window.agar.myCells.length; i++) {
- if (window.agar.myCells[i] == cell.id) {
- return true
- }
- }
- return false
- }
- function getCell() {
- var me = [];
- for (var key in window.agar.allCells) {
- var cell = window.agar.allCells[key];
- if (isMe(cell)) {
- me.push(cell)
- }
- }
- return me[0]
- }
- var skin_var = 0;
- function emitPosition() {
- socket.emit("pos", {
- "x": window.__botclonsData.mx,
- "y": window.__botclonsData.my,
- "l": window.__botclonsData.ml,
- "dimensions": [-7071, -7071, 7071, 7071]
- })
- }
- function emitSplit() {
- socket.emit("cmd", {
- "name": "split"
- })
- }
- function emitMassEject() {
- socket.emit("cmd", {
- "name": "eject"
- })
- }
- function toggleMovement() {
- canMove = !canMove;
- switch (canMove) {
- case true:
- canvas.onmousemove = moveEvent[0];
- moveEvent[0] = null;
- canvas.onmousedown = moveEvent[1];
- moveEvent[1] = null;
- break;
- case false:
- canvas.onmousemove({
- clientX: innerWidth / 2,
- clientY: innerHeight / 2
- });
- moveEvent[0] = canvas.onmousemove;
- canvas.onmousemove = null;
- moveEvent[1] = canvas.onmousedown;
- canvas.onmousedown = null;
- break
- }
- }
- interval_id = setInterval(function() {
- emitPosition()
- }, 100);
- interval_id2 = setInterval(function() {
- transmit_game_server_if_changed()
- }, 5000);
- document.addEventListener('keydown', function(e) {
- var key = e.keyCode || e.which;
- switch (key) {
- case 65:
- movetoMouse = !movetoMouse;
- if(movetoMouse) { document.getElementById('ismoveToMouse').innerHTML = "On"; } else { document.getElementById('ismoveToMouse').innerHTML = "Off"; }
- break;
- case 68:
- toggleMovement();
- if(!canMove) { document.getElementById('isStopMove').innerHTML = "On"; } else { document.getElementById('isStopMove').innerHTML = "Off"; }
- break;
- case 69:
- emitSplit();
- break;
- case 82:
- emitMassEject();
- break
- }
- });
- function transmit_game_server_if_changed() {
- if (last_transmited_game_server != window.__botclonsData.socketaddr) {
- transmit_game_server()
- }
- }
- function transmit_game_server() {
- last_transmited_game_server = window.__botclonsData.socketaddr;
- socket.emit("cmd", {
- "name": "connect_server",
- "ip": window.__botclonsData.socketaddr,
- "origin": location.origin
- })
- }
- var mouseX = 0;
- var mouseY = 0;
- $("body").mousemove(function(event) {
- mouseX = event.clientX;
- mouseY = event.clientY
- });
- }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement