Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setTimeout(function() {
- "use strict";
- window.botServer='SmartBots-esaelyt.codeanyapp.com:8081';
- window.bot = {x:0, y:0, ip:null, byteLength:0};
- WebSocket.prototype.Asend = WebSocket.prototype.send;
- WebSocket.prototype.send = function(arrayBuffer) {
- this.Asend(arrayBuffer);
- var dataView = new DataView(arrayBuffer);
- if(dataView.byteLength === 21) {
- if(dataView.getUint8(0) === 16) {
- bot.x = dataView.getFloat64(1, true);
- bot.y = dataView.getFloat64(9, true);
- bot.byteLength = dataView.byteLengthsocket
- }
- };
- if(dataView.byteLength === 13) {
- if(dataView.getUint8(0) === 16) {
- bot.x = dataView.getInt32(1, true);
- bot.y = dataView.getInt32(5, true);
- bot.byteLength = dataView.byteLength
- }
- };
- if(dataView.byteLength === 5 || dataView.byteLength < 4) {
- if(dataView.getUint8(0) === 16) {
- bot.x = dataView.getInt16(1, true);
- bot.y = dataView.getInt16(3, true);
- bot.byteLength = dataView.byteLength
- }
- };
- if(this.url !== null) {
- bot.ip = this.url;
- console.log(bot.ip)
- }
- };
- if(window.botServer) {//Olaf4Snow customization. Added window.botServer line.
- var socket = io.connect('ws://' + window.botServer);
- } else {
- var socket = io.connect("ws://127.0.0.1:8081"); // <---- localhost:8081 // 127.0.0.1:8081 // if u want to use on vps ? UrVpsIp:8081
- }
- document.addEventListener("keydown", function(keyboardEvent) {
- if(keyboardEvent.key) {//Olaf4Snow customization. Added support for keyboardEvent.key
- switch(keyboardEvent.key) {
- case "e":
- socket.emit("split");
- break;
- case "r":
- socket.emit("eject");
- break;
- case "z":
- socket.emit("spam");
- break;
- }
- //Olaf4Snow customization.
- } else {
- var keyCharacterValue = keyboardEvent.keyCode || keyboardEvent.which;
- switch(keyCharacterValue) {
- case 69://Olaf4Snow customization. Was 69 ("E").
- socket.emit("split");
- break;
- case 82://Olaf4Snow customization. Was 82 ("R").
- socket.emit("eject");
- break;
- case 67://Olaf4Snow customization. Was 67 ("C").
- socket.emit("spam");
- break
- }
- }
- });
- setInterval(function() {
- socket.emit("movement", {x:bot.x, y:bot.y, byteLength:bot.byteLength})
- }, 100);
- setTimeout(function() {
- $( "#overlays" ).after( "<div style='box-shadow: 0px 0px 20px black;z-index:9999999; background-color: #0036FF; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.7; zoom: 1; width: 350px; top: 10px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; font-family: castellar;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>SmartBots</a></div> <div style=' color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bots Online: <a id='minionCount'>0</a> / 250</div><button id='start-bots' style='display: block;border-radius: 5px;border: 2px solid #6495ED;background-color: green;height: 50px;width: 120px;margin: auto;text-align: center;'>Start Bots</button><button id='stop-bots' style='display:none;border-radius: 5px;border: 2px solid #6495ED;background-color: red;height: 50px;width: 120px;margin: auto;text-align: center;'>Stop Bots</button></div>" );
- document.getElementById("start-bots").onclick = function() {
- socket.emit("start", {ip:bot.ip!== null?bot.ip:0, origin:location.origin})
- document.getElementById("start-bots").style.display = "none";//Olaf4Snow customization. Added bot "stop" button.
- document.getElementById("stop-bots").style.display = "inline-block";//Olaf4Snow customization. Added bot "stop" button.
- }
- document.getElementById("stop-bots").onclick = function() {//Olaf4Snow customization. Added bot "stop" button.
- socket.emit("stop")
- document.getElementById("stop-bots").style.display = "none";
- document.getElementById("start-bots").style.display = "inline-block";
- }
- }, 2000);
- socket.on("botCount", function(botCount) {
- $("#minionCount").html(botCount)
- })
- }, 200)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement