Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name #1 CLONE
- // @version 1.0
- // @description Bots For Cellcraft.io
- // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js
- // @author TrapKilloYT
- // @match http://cellcraft.io/*
- // @match http://agar.bio/
- // @match http://agarios.org/*
- // @grant none
- // ==/UserScript==
- setTimeout(function() {
- window.Client = {
- ip: null,
- x: 0,
- y: 0,
- log: false,
- byteLength: 0
- };
- const cmd = io("ws://localhost:8081");//ws://TrapBot-killotrap265412.codeanyapp.com:8081
- function KeyOf(letter){
- return letter.charCodeAt(0);
- }
- window.addEventListener("keydown", (e) => {
- if(e.keyCode == KeyOf("E")){
- cmd.emit("split", true);
- }
- if(e.keyCode == KeyOf("R")){
- cmd.emit("eject", true);
- }
- });
- cmd.on('count', function(count) {
- $('#botCount').html(count);
- });
- cmd.on('origin', {
- "origin": location.origin
- });
- _WebSocket = window.WebSocket;
- $("#canvas").after("<div style='box-shadow: 0px 0px 20px black;z-index:9999999; background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.7; zoom: 1; width: 205px; top: 300px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; font-family: Ubuntu;border: 2px solid #0c31d4;'> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1;font-size: 22px; filter:alpha(opacity=100); padding: 10px;'><a>Trap Client</a></div> <div style=' color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Minions: <a id='botCount'>Offline</a> </div><button id='start-Bots' style='display: block;border-radius: 5px;border: 2px solid #6495ED;background-color: #BCD2EE;height: 50px;width: 120px;margin: auto;text-align: center;'>StartBots </button><marquee>TrapKillo - Owner</marquee> </div>");
- function refer(master, slave, prop) {
- Object.defineProperty(master, prop, {
- get: function(){
- return slave[prop];
- },
- set: function(val) {
- slave[prop] = val;
- },
- enumerable: true,
- configurable: true
- });
- }
- window.WebSocket = function(url, protocols) {
- if (protocols === undefined) {
- protocols = [];
- }
- var ws = new _WebSocket(url, protocols);
- refer(this, ws, 'binaryType');
- refer(this, ws, 'bufferedAmount');
- refer(this, ws, 'extensions');
- refer(this, ws, 'protocol');
- refer(this, ws, 'readyState');
- refer(this, ws, 'url');
- this.send = function(data) {
- if(Client.log) console.log(new Uint8Array(data));
- let msg = new DataView(arguments[0]);
- if(msg.byteLength == 21){ // Most clones
- if(msg.getInt8(0, true) == 16){
- Client.x = msg.getFloat64(1, true);
- Client.y = msg.getFloat64(9, true);
- Client.byteLength = msg.byteLength;
- }
- } else {
- if(msg.byteLength == 13){ // Agar.re, agarioforums.io, (maybe) warlis.io
- if(msg.getUint8(0, true) == 16){
- Client.x = msg.getFloat64(1, true);
- Client.y = msg.getFloat64(5, true);
- Client.byteLength = msg.byteLength;
- }
- }
- }
- cmd.emit("clientPosition", {
- x: Client.x,
- y: Client.y,
- byteLength: Client.byteLength
- });
- return ws.send.call(ws, data);
- };
- this.close = function() {
- return ws.close.call(ws);
- };
- this.onopen = function(event) {};
- this.onclose = function(event) {};
- this.onerror = function(event) {};
- this.onmessage = function(event) {};
- ws.onopen = function(event) {
- if(this.url !== null) Client.ip = this.url;
- start = function() {
- cmd.emit("serverIP", {
- ip: Client.ip
- });
- };
- if (this.onopen) return this.onopen.call(ws, event);
- }.bind(this);
- ws.onmessage = function(event) {
- if (this.onmessage) return this.onmessage.call(ws, event);
- }.bind(this);
- ws.onclose = function(event) {
- if (this.onclose) return this.onclose.call(ws, event);
- }.bind(this);
- ws.onerror = function(event) {
- console.log("[CLIENT]: WebSocker Error");
- if (this.onerror) return this.onerror.call(ws, event);
- }.bind(this);
- };
- document.getElementById('start-Bots').onclick = function() {
- start();
- };
- window.WebSocket.prototype = _WebSocket;
- },3000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement