Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Brick() { }
- OWOP.chat.local("(♡) OJB - ð“žð“¦ð“žð“Ÿð“³ð“‘ð“žð“£ Loaded Sucessfully!");
- if(sessionStorage.brick === "brick")
- throw new Brick(sessionStorage.msg || '');
- window.eval("(" + function main() {
- var _ = 6666666;
- var EVENTS =
- {
- loaded: ++_,
- init: ++_,
- tick: ++_,
- misc: {
- toolsRendered: ++_,
- toolsInitialized: ++_,
- logoMakeRoom: ++_,
- worldInitialized: ++_,
- windowAdded: ++_,
- captchaToken: ++_,
- loadingCaptcha: ++_
- },
- renderer: {
- addChunk: ++_,
- rmChunk: ++_,
- updateChunk: ++_
- },
- camera: {
- moved: ++_,
- zoom: ++_
- },
- net: {
- connecting: ++_,
- connected: ++_,
- disconnected: ++_,
- playerCount: ++_,
- chat: ++_,
- devChat: ++_,
- world: {
- leave: ++_,
- join: ++_,
- joining: ++_,
- setId: ++_,
- playersMoved: ++_,
- playersLeft: ++_,
- tilesUpdated: ++_,
- teleported: ++_
- },
- chunk: {
- load: ++_,
- unload: ++_,
- set: ++_,
- lock: ++_,
- allLoaded: ++_
- },
- sec: {
- rank: ++_
- },
- maxCount: ++_
- }
- };
- var BOTS = 5;
- var EMIT =
- OWOP.emit
- ;
- var ON =
- OWOP.on
- ;
- var WORLD_VERIFICATION = OWOP.options.serverAddress[0].proto.misc.worldVerification;
- var TOKEN_VERIFICATION = OWOP.options.serverAddress[0].proto.misc.tokenVerification;
- var MODLOGIN = (OWOP.player.rank > 1) && prompt();
- var MOD = MODLOGIN && MODLOGIN.length;
- var unprotect = false;
- var BUTTONS = [{
- value: "Exit",
- call: function() {
- OWOP.chat.local("(☹) Saindo...");
- OWOP.chat.local("(✗) Bots desconectados.");
- bots.leave();
- },
- title: "Desconecta o Bot."
- }, {
- value: "Join",
- call: function() {
- bots.joinWithoutCaptcha();//.join();
- OWOP.chat.local("(✔) Bots joining");
- },
- title: "Conecta o bot quando o captcha não está ativado."
- }, {
- value: "Draw",
- call: function() {
- bots.drawImage(parseInt(params[0].value), parseInt(params[1].value), pixelData.width, pixelData.height, pixelData, "rgba");
- },
- title: "Faz o bot desenhar a template."
- }, {
- value: "Protect",
- call: function () {
- OWOP.chat.local("(✔) The Anti-Grief is Activated.");
- unprotect = false;
- setInterval(function () {
- if (unprotect == false) {
- bots.drawRaw(parseInt(params[0].value), parseInt(params[1].value), pixelData.width, pixelData.height, pixelData, "rgba")
- }
- }, 1500);
- },
- title: "Faz o bot proteger a arte atual."
- }, {
- value: "Desprotect",
- call: function () {
- OWOP.chat.local("(✔) The Anti-Grief is Deactivated.");
- unprotect = true;
- bots.stop = true;
- bots.busy = false;
- },
- title: "Faz o bot deixar de proteger a arte atual"
- }, {
- value: "joinCAPTCHA",
- call: function() {
- OWOP.chat.local("(✔) The bots are joining with captcha requeriment.");
- bots.joinWithCaptcha();
- },
- title: "Conecta o bot quando o captcha está ativado."
- }, {
- value: "Stop",
- call: function() {
- bots.stop = true;
- bots.busy = false;
- },
- title: "Faz o Bot Parar de Colocar Pixel."
- }, /*{
- value: "Follow",
- call: function() {
- if (inter) {
- clearInterval(inter);
- return inter = null;
- }
- inter = setInterval(bots.follow, 350, protocol.id);
- },
- title: "O Bot vai te seguir."
- },*/ {
- value: "Follow",
- call: function() {
- clearInterval(inter);
- inter = setInterval(bots.follow, 350, protocol.id);
- },
- title: "O Bot vai te seguir."
- }, {
- value: "Stop Follow",
- call: function() {
- clearInterval(inter);
- },
- title: "O Bot vai parar de te seguir."
- }, {
- value: "Teleport",
- call: function() {
- tp(parseInt(params[0].value), parseInt(params[1].value));
- },
- title: "Teleporta você. parâmetros: x,y"
- }, {
- value: "Write",
- call: function() {
- bots.writxt(params[2].value, parseInt(params[0].value), parseInt(params[1].value));
- },
- title: "Make bot write, parameters: x1,y1 = coords, x2 = words"
- },
- ];
- document.body.onkeydown = function() {
- if (event.keyCode == 66 /*B*/ ) {
- params[0].value = select.start.x = getPlayerPos().x;
- params[1].value = select.start.y = getPlayerPos().y;
- return true;
- }
- if (event.keyCode == 78 /*N*/ ) {
- select.end.x = getPlayerPos().x;
- select.end.y = getPlayerPos().y;
- params[2].value = select.end.x - select.start.x;
- params[3].value = select.end.y - select.start.y;
- return true;
- }
- if (event.keyCode == 88 /*X*/ ) {
- if (listCont.style.display == "none") {
- listCont.style.display = "";
- btnsCont.style.display = "";
- jbot.style.display = "";
- } else {
- listCont.style.display = "none";
- btnsCont.style.display = "none";
- jbot.style.display = "none";
- }
- return true;
- }
- };
- document.querySelector('head').insertAdjacentHTML('beforeend',
- `<style type="text/css">
- #list-container{
- color:#000;
- font:12px monospace;
- position: relative;
- left: 518px;
- top: -12px;
- width: 175px;
- }
- #list{
- flex-direction: column;
- height:150px;
- overflow: auto;
- border: 0.5px solid black;
- }
- #bot-control {
- position: absolute;
- left: 70px;
- top: 0px;
- width: 400px;
- height: 30%;
- font:8px consolas;
- color:#000;
- }
- input[type=button],input[type=text],::-webkit-scrollbar-thumb,button {
- background-color: rgba(129, 150, 129, 0.22);
- color: white;
- font:12px monospace;
- border: 0px solid rgba(126, 99, 92, 0.73);
- text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
- }
- input[type=button]:focus,input[type=text]:focus,
- #tool-select > button.selected{
- background-color: rgba(0,255,255,0.5);
- }
- input[type=button]:hover,input[type=text]:hover,
- ::-webkit-scrollbar-thumb:hover,button:hover {
- background-color: rgba(0,180,180,0.5);
- }
- ::-webkit-scrollbar{
- width:10px;
- }
- </style>`
- );
- var container = document.createElement("div");
- container.innerHTML = `<div id='hid' ></div>
- <div id='list-container'>
- <div id='tp' ></div>
- <div id='list'></div>
- </div>
- <div id="bot-control">
- <input id="param1" type="text" placeholder="x1" onfocus="this.parentNode.className='active';">
- <input id="param2" type="text" placeholder="y1" onfocus="this.parentNode.className='active';">
- <input id="param3" type="text" placeholder="x2" onfocus="this.parentNode.className='active';">
- <input id="param4" type="text" placeholder="y2" onfocus="this.parentNode.className='active';">
- <div id="buttons"></div>
- </div>`;
- container.style = "width:0px;height:0px;position:absolute;top:0px;left:60px";
- document.body.appendChild(container);
- // document.body.onselectstart = function() { return false; }; //disables selecting text; y would u do dat, mait. its Möld
- var selected = null;
- var params = [];
- for (var i = 0; i < 4; i++)
- params[i] = document.getElementById('param' + (i + 1));
- var btns = document.getElementById("buttons");
- var list = document.getElementById('list');
- var listCont = document.getElementById('list-container');
- var btnsCont = document.getElementById('bot-control');
- var hbtn = document.createElement("input");
- var tpbtn = document.createElement("input");
- var fbtn = document.createElement("input");
- hbtn.type = tpbtn.type = fbtn.type = "button";
- hbtn.value = "";
- hbtn.title = "Esconde os controles do bot.";
- tpbtn.value = "Teleport to";
- tpbtn.title = "Teleporta você para o player selecionado.";
- fbtn.value = "Follow Plyr.";
- fbtn.title = "O Bot vai seguir o player selecionado.";
- hbtn.onclick = function(e) {
- if (listCont.style.display == "none") {
- listCont.style.display = "";
- btnsCont.style.display = "";
- this.value = "";
- } else {
- listCont.style.display = "none";
- btnsCont.style.display = "none";
- this.value = "";
- }
- };
- document.getElementById("hid").appendChild(hbtn);
- tpbtn.onclick = function(e) {
- port(selected);
- };
- document.getElementById("tp").appendChild(tpbtn);
- fbtn.onclick = function(e) {
- clearInterval(inter);
- inter = setInterval(bots.follow, 350, selected);
- };
- document.getElementById("tp").appendChild(fbtn);
- var protocol;
- var _sendmsg = OWOP.options.serverAddress[0].proto.class.prototype.sendMessage;
- OWOP.options.serverAddress[0].proto.class.prototype.sendMessage = function() {
- protocol = this;
- _sendmsg.apply(this, arguments);
- }
- OWOP.chat.send("".repeat(4096));
- var _joinWorld = OWOP.options.serverAddress[0].proto.class.prototype.joinWorld;
- OWOP.options.serverAddress[0].proto.class.prototype.joinWorld = function() {
- protocol = this;
- _joinWorld.apply(this, arguments);
- }
- function listUpdate() {
- if (list && OWOP) {
- list.innerHTML = "";
- list.onclick = function(e) {
- selItem(e);
- };
- var pple = ppl(), pid, pos, pstr, itm;
- for (var p in pple) {
- pid = pple[p].id; pos = getPos(pid);
- pstr = " Id: " + pid + " x:" + pos.x + " y:" + pos.y;
- itm = document.createElement("span");
- itm.id = pid;
- if (selected == pid)
- itm.innerHTML += "<font color='#14ba14'>" + pstr + " > Selec." + "</font>";
- else itm.innerHTML = pstr;
- list.appendChild(itm);
- list.insertAdjacentHTML('beforeend', "<br>");
- }
- list.insertAdjacentHTML('beforeend', "<font color='#F00'>" + " You: " + protocol.id + " x:" +
- (pos=getPlayerPos()).x + " y:" + pos.y + "</font><br>"); //player
- } else OWOP.chat.local("No list");
- }
- function selItem(e) {
- if (e.target.tagName == "SPAN")
- selected = e.target.id;
- else e.stopPropagation();
- }
- //protocol.chunksLoading = [];
- OWOP.player.palette.push(new Uint8Array([255, 255, 255]));
- /*var player = exports.player ======
- get paletteIndex() {
- return paletteIndex;
- },
- set paletteIndex(i) {
- paletteIndex = (0, _misc.absMod)(i, palette.length);
- updatePalette(); //!!!
- },
- [...]
- }*/
- /*WorldOfPixels.updatePalette();*/
- try{ OWOP.player.paletteIndex = OWOP.player.paletteIndex }catch(e){}
- var chars = [
- [0b1111111, 0b1000001, 0b1010111, 0b1010100, 0b1010111, 0b1000001, 0b1111111] /*A*/ ,
- [0b1111111, 0b1000001, 0b1010101, 0b1010101, 0b1010101, 0b1001001, 0b1111111] /*B*/ ,
- [0b1111111, 0b1000001, 0b1011101, 0b1010101, 0b1010101, 0b1010101, 0b1110111] /*C*/ ,
- [0b1111111, 0b1000001, 0b1011101, 0b1010101, 0b1011101, 0b1100011, 0b0111110] /*D*/ ,
- [0b1111111, 0b1000001, 0b1010101, 0b1010101, 0b1010101, 0b1011101, 0b1110111] /*E*/ ,
- [0b1111111, 0b1000001, 0b1010111, 0b1010100, 0b1010100, 0b1011100, 0b1110000] /*F*/ ,
- [0b1111111, 0b1000001, 0b1011101, 0b1010101, 0b1010101, 0b1010001, 0b1111111] /*G*/ ,
- [0b1111111, 0b1000001, 0b1110111, 0b0010100, 0b1110111, 0b1000001, 0b1111111] /*H*/ ,
- [0b1111111, 0b1000001, 0b1111111] /*I*/ ,
- [0b1111111, 0b1010001, 0b1011101, 0b1010101, 0b1011101, 0b1000001, 0b1111111] /*J*/ ,
- [0b1111111, 0b1000001, 0b1110111, 0b0110110, 0b1101011, 0b1011101, 0b1110111] /*K*/ ,
- [0b1111111, 0b1000001, 0b1111101, 0b0000101, 0b0000101, 0b0000101, 0b0000111] /*L*/ ,
- [0b1111111, 0b1000001, 0b1011111, 0b1000001, 0b1011111, 0b1000001, 0b1111111] /*M*/ ,
- [0b1111111, 0b1000001, 0b1011111, 0b1000001, 0b1111101, 0b1000001, 0b1111111] /*N*/ ,
- [0b1111111, 0b1000001, 0b1011101, 0b1010101, 0b1011101, 0b1000001, 0b1111111] /*O*/ ,
- [0b1111111, 0b1000001, 0b1010111, 0b1010100, 0b1010100, 0b1000100, 0b1111100] /*P*/ ,
- [0b1111111, 0b1000001, 0b1011101, 0b1010101, 0b1011101, 0b1000011, 0b1111111] /*Q*/ ,
- [0b1111111, 0b1000001, 0b1010111, 0b1010100, 0b1010111, 0b1001001, 0b1111111] /*R*/ ,
- [0b1111111, 0b1000101, 0b1010101, 0b1010101, 0b1010101, 0b1010001, 0b1111111] /*S*/ ,
- [0b1110000, 0b1010000, 0b1011111, 0b1000001, 0b1011111, 0b1010000, 0b1110000] /*T*/ ,
- [0b1111111, 0b1000001, 0b1111101, 0b0000101, 0b1111101, 0b1000001, 0b1111111] /*U*/ ,
- [0b1111100, 0b1000110, 0b1111011, 0b0001101, 0b1111011, 0b1000110, 0b1111100] /*V*/ ,
- [0b1111110, 0b1000011, 0b1111101, 0b0100011, 0b1111101, 0b1000011, 0b1111110] /*W*/ ,
- [0b1110111, 0b1011101, 0b1101011, 0b0110110, 0b1101011, 0b1011101, 0b1110111] /*X*/ ,
- [0b1111000, 0b1001100, 0b1110111, 0b0011001, 0b1110111, 0b1001100, 0b1111000] /*Y*/ ,
- [0b1111111, 0b1010001, 0b1010101, 0b1010101, 0b1010101, 0b1000101, 0b1111111] /*Z*/ ,
- ];
- var NUMS = [
- [0b11111, 0b10001, 0b11111] /*0*/ ,
- [0b01000, 0b11111] /*1*/ ,
- [0b10111, 0b10101, 0b11101] /*2*/ ,
- [0b10101, 0b10101, 0b11111] /*3*/ ,
- [0b11100, 0b00100, 0b11111] /*4*/ ,
- [0b11101, 0b10101, 0b10111] /*5*/ ,
- [0b11111, 0b10101, 0b10111] /*6*/ ,
- [0b10000, 0b10000, 0b11111] /*7*/ ,
- [0b11111, 0b10101, 0b11111] /*8*/ ,
- [0b11101, 0b10101, 0b11111] /*9*/
- ];
- var symbols = {
- "33": [0b11101] /*!*/ ,
- "34": [0b11000, 0b00000, 0b11000] /*"*/ ,
- "35": [0b01010, 0b11111, 0b01010, 0b11111, 0b01010] /*#*/ ,
- "39": [0b11000] /*'*/ ,
- "40": [0b01110, 0b10001] /*(*/ ,
- "41": [0b10001, 0b01110] /*)*/ ,
- "43": [0b00100, 0b01110, 0b00100] /*+*/ ,
- "45": [0b00100, 0b00100, 0b00100] /*-*/ ,
- "46": [0b00001] /*.*/ ,
- "47": [0b00001, 0b00110, 0b11000] /*/*/ ,
- "58": [0b01010] /*:*/ ,
- "61": [0b01010, 0b01010, 0b01010] /*=*/ ,
- "63": [0b10101, 0b01000] /*?*/ ,
- "91": [0b11111, 0b10001] /*[*/ ,
- "93": [0b10001, 0b11111] /*]*/
- };
- var pixelData = [];
- var select = {
- start: {
- x: 0,
- y: 0
- }, //sets with B
- end: {
- x: 0,
- y: 0
- } //sets with N
- };
- var imageList = [{
- }
- ];
- // This fixes modulo to work on negative numbers (-1 % 16 = 15)
- Number.prototype.mod = function(n) { return ((this % n) + n) % n; };
- var __WorldOfPixels = { chunks: { }, net: { players: { } } };
- (__WorldOfPixels.net.Re_ConfigureLogicalStuff = function Re_ConfigureLogicalStuff(UsefulThings) {
- (setTimeout) ((()=>{
- (protocol.worldName)&&
- (this.worldName = protocol.worldName);
- this.players = new this.players.constructor;
- (protocol.id)&&
- (this.id = protocol.id);
- }),(1))
- }.bind(__WorldOfPixels.net))();
- ON(EVENTS.net.connected, __WorldOfPixels.net.Re_ConfigureLogicalStuff);
- ON(EVENTS.net.disconnected, __WorldOfPixels.net.Re_ConfigureLogicalStuff);
- ON(EVENTS.net.world.playersMoved, function onPlayersMoved(updates) {
- var player, u, rgb;
- for (var pid in updates) {
- u = updates[pid];
- if (player=this.net.players[pid]/*!= undefined*/) {
- player.x = u.x; player.y = u.y;
- } else if (pid !== this.net.id)
- this.net.players[pid] = { x: u.x, y: u.y, id: pid+[] };
- }
- }.bind(__WorldOfPixels));
- ON(EVENTS.net.world.playerCount, function onPlayersLeft(updates) {
- if (updates)
- for (var dpid of updates)
- delete this.net.players[dpid];
- }.bind(__WorldOfPixels));
- ON(EVENTS.net.chunk.load, function onChunkLoad(chunk) {
- this.chunks[[chunk.x, chunk.y]] = chunk;
- }.bind(__WorldOfPixels));
- function port(id) {
- var p = ppl()[id];
- if (p)
- tp(p.x >> 4, p.y >> 4);
- else OWOP.chat.local("Id não existe.");
- }
- function getPos(id) {
- var p = ppl()[id];
- if (p)
- return {
- x: (p.x >> 4) | 0,
- y: (p.y >> 4) | 0
- };
- else if (id == protocol.id)
- return getPlayerPos();
- else console.log("id doesnt exist");
- }
- function getPlayerPos() {
- return {
- x: (OWOP.camera.x + OWOP.mouse.x / (bots.beta ? OWOP.camera.zoom : 16)) | 0,
- y: (OWOP.camera.y + OWOP.mouse.y / (bots.beta ? OWOP.camera.zoom : 16)) | 0
- };
- }
- function getPPLcount() {
- return Object.keys(protocol.players).length;
- }
- function ppl() {
- return __WorldOfPixels.net.players;
- }
- function tp(x, y) {
- try {
- EMIT(EVENTS.net.world.teleported, x, y);
- } catch(e) {
- console.error(
- "Teleportation with the EventEmitter didn't work, falling back to changing camera position. Probably won't work."
- );
- OWOP.camera.x = x - (window.innerWidth / OWOP.camera.zoom / 2.5);
- OWOP.camera.y = y - (window.innerHeight / OWOP.camera.zoom / 2.5);
- OWOP.renderer.updateCamera();
- }
- }
- function getImage(com) {
- for (var i = 0; i < imageList.length; i++)
- if (com == imageList[i].name)
- return imageList[i];
- return null;
- }
- function savePixels(startX, startY, endX, endY) {
- var width = Math.max(endX, startX) - Math.min(endX, startX) + 1,
- height = Math.max(endY, startY) - Math.min(endY, startY) + 1,
- x, y;
- for (x = 0; x < width; x++)
- for (y = 0; y < height; y++)
- pixelData[x + y * width] = OWOP.world.getPixel(startX + x, startY + y);
- pixelData.width = width;
- pixelData.height = height;
- console.log(pixelData);
- }
- function paste(x, y) {
- if (pixelData.length/*>1*/)
- bots.drawBmp(x, y, pixelData.width, pixelData.height, pixelData);
- }
- function drawImg(name, x, y, img, colors) {
- if (bots.busy)
- OWOP.chat.local("Não pude desenhar. (" + bots.job + ")");
- if (isNaN(x) || isNaN(y))
- return err(":( Coordenadas inválidas.");
- OWOP.chat.local("Desenhando " + name + " em " + x + " " + y);
- bots.drawRaw(x, y, img.width, img.height, img, colors);
- }
- function err(msg) {
- if (typeof(msg) == "string")
- console.log(msg);
- OWOP.chat.local("(jBOT):" + msg);
- // WorldOfPixels.chatMessage("[BOT]:" + msg);
- // msg = "[BOT]:" + msg;
- /*try {
- protocol.messageHandler( { data: msg } );
- } catch(e) {
- console.warn("Couldn't use protocol.messageHandler, trying to fall back to EventEmitter: ", e);
- try {
- EMIT(EVENTS.net.chat, msg);
- } catch(e2) {
- cansole.warn("Couldn't use EventEmitter to put log the chat either: ", e2);
- }
- }*/
- }
- var DELAY = 0;
- var bots = {};
- var inter, f = 0;
- bots.busy = false;
- bots.online = false;
- bots.job = "";
- bots.stop = false;
- bots.chunks = {};
- bots.visible = {
- startX: 0,
- startY: 0,
- endX: 0,
- endY: 0,
- x: 0,
- y: 0
- };
- bots.beta = false;
- var updInt;
- var SITEKEY = "6LcgvScUAAAAAARUXtwrM8MP0A0N70z4DHNJh-KI";
- async function joinBotWithCaptcha(id) {
- return new Promise((resolve, reject) => {
- OWOP.windowSys.addWindow(new OWOP.windowSys.class.window("Verificação Necessitada", {
- closeable: true
- }, function (wdow) {
- var id = grecaptcha.render(wdow.addObj(OWOP.util.mkHTML("div", {
- style: "margin: -4px;" /* NOTA: not setting cssText */
- })), {
- theme: "dark",
- sitekey: SITEKEY,
- callback: function callback(token) {
- console.log("Captcha callback");
- console.log(token);
- var bot = new Bot(id);
- bot.setToken(token);
- wdow.close();
- resolve(bot);
- }
- });
- wdow.frame.style.cssText = "";
- wdow.container.style.cssText = "overflow: hidden; background-color: #F9F9F9";
- }));
- });
- }
- bots.joinWithCaptcha = async function() {
- if (bots.online)
- OWOP.chat.local("Já online.");
- var boats = BOTS;
- BOTS = 0;
- for (var i = 0; i < boats; i++) {
- var bot = this[i] = await joinBotWithCaptcha(i);
- bot.init();
- console.log(protocol.worldName);
- bots.online = true;
- BOTS++;
- }
- //inter=setInterval(bots.follow,1);
- updInt = setInterval(this.updateCamera, 1);
- this.lastCleanup = Date.now();
- }.bind(bots);
- bots.joinWithoutCaptcha = function() {
- if (bots.online)
- OWOP.chat.local("Já online.");
- var bot;
- for (var i = 0; i < BOTS; i++) {
- bot = this[i] = new Bot(i);
- bot.captcha = false;
- bot.init();
- console.log(protocol.worldName);
- bots.online = true;
- }
- //inter=setInterval(bots.follow,1);
- updInt = setInterval(this.updateCamera, 1);
- this.lastCleanup = Date.now();
- }.bind(bots);
- bots.leave = function() {
- if (!bots.online)
- return err("O Bot está offline.");
- for (var i = 0; i < BOTS; i++) {
- try{ clearInterval(this[i].net.updateInterval); }catch(e){console.error(e);}
- try{ this[i].net.connection.close(); }catch(e){console.error(e);}
- try{ this[i].net = null; }catch(e){console.error(e);}
- try{ this[i] = null; }catch(e){console.error(e);}
- try{ clearInterval(updInt); }catch(e){console.error(e);}
- try{ bots.online = false; }catch(e){console.error(e);}
- }
- };
- var PI2 = 2 * Math.PI, FOLLOWADD = PI2 / 45/*PI2 / 360 * 20*/, BOTSLICE = PI2 / BOTS;
- bots.follow = function(id) {
- if (!ppl()[id])
- id = protocol.id;
- var pos = getPos(id), a, i = BOTS;
- while (i--)
- if (this[i] && !this.busy) {
- a = BOTSLICE * i + f;
- this[i].pos.x = pos.x + (Math.cos(1 * Math.PI / BOTS * i + f) * 13);
- this[i].pos.y = pos.y + (Math.sin(1 * Math.PI / BOTS * i + f) * 12);
- }
- f = (f + FOLLOWADD) % PI2;
- }.bind(bots);
- bots.writxt = async function(str, x, y) {
- if (isNaN(x) || isNaN(y)) {
- OWOP.chat.local("Parâmetros Errados.");
- return;
- }
- if (!this.online) {
- OWOP.chat.local("O Bot está offline.");
- return;
- }
- this.busy = true;
- this.job = "Escrevendo";
- str = str.toUpperCase();
- var len = str.length, ccode, matrix;
- for (var i = 0; i < len; i++) {
- ccode = str.charCodeAt(i);
- if (ccode >= 0x41 && ccode <= 0x5a) //letters
- matrix = chars[ccode - 65];
- else if (ccode == 0x20) { //space
- x += 2;
- continue;
- } else if (ccode >= 0x30 && ccode <= 0x39) //numbers
- matrix = NUMS[ccode - 0x30];
- else if (symbols[ccode]) //symbols
- matrix = symbols[ccode];
- else {
- OWOP.chat.local("Simbolo Desconhecido");
- continue;
- }
- this.drawChar(matrix, x, y);
- x += matrix.length + 1;
- await sleep(50);
- }
- this.busy = false;
- };
- document.getElementById("toole-container").style.maxWidth = "80px"
- bots.drawChar = async function(matrix, x, y) {
- // matrix = e.g. [0b1111111, 0b1000001, 0b1010111, 0b1010100, 0b1010111, 0b1000001, 0b1111111] /*A*/
- for (var xx = 0; xx < matrix.length; xx++)
- for (var yy = 0; yy < 8; yy += BOTS) // yy < 5
- for (var bb = 0; bb < BOTS; bb++)
- if ((matrix[xx] >> (7 - yy - bb)) & 1 && yy + bb < 8) { // (4 - yy - bb), && yy + bb < 5
- this[bb].pixel(x + xx, y + yy + bb, OWOP.player.palette[OWOP.player.paletteIndex]);
- await sleep(2);
- }
- };
- bots.drawRect = async function(x, y, w, h, color) {//-54 25 57 39
- if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
- OWOP.chat.local("Parâmetros errados.");
- return;
- }
- if (!this.online) {
- err("O Bot está offline.");
- return;
- }
- this.job = "Encher";
- color = color || OWOP.player.palette[OWOP.player.paletteIndex];
- OWOP.chat.local(bots.job + " [" + x + "," + y + "] " + w + "x" + h + " #" + (((color[0] << 16) | color[1] << 8) | color[2]).toString(16));
- this.busy = true;
- var pixel, newY, newX, Y, X, i;
- await sleep(1);
- for (Y = 0; Y < h; Y+=1) {
- for (X = 0; X < w; X+=1) {
- for (i = 0; i < BOTS; i++) {
- if (this.stop)
- return this.stop = this.busy = false;
- if (X + i < w) {
- over = 0;
- newX = X + i;
- newY = Y;
- pixel = OWOP.world.getPixel(x + newX, y + newY);
- if (pixel[0] !== color[0] || pixel[1] !== color[1] || pixel[2] !== color[2]) {
- this[i].pixel(x + newX, y + newY, color);//.net.updatePixel(x + newX, y + newY, color);
- await sleep(1);
- } else continue;
- }
- }
- //this.moveTo(x + Math.floor(X / 40) * 40, y + Y); //bot se musi presunout,aby byl v dosahu
- }
- }
- this.busy = false;
- OWOP.chat.local(bots.job + " terminado.");
- };
- bots.drawImage = async function(x, y, w, h, data, colors) { //data=[r,g,b,a,r,g,b,a]
- if (!this.online) {
- err("bot offline");
- return;
- }
- this.busy = true;
- var pixel, color;
- var k = (colors == "rgba" ? 4 : 3);
- var b = -1;
- for (var Y = 0; Y < h; Y++) {
- for (var X = 0; X < w; X++) {
- if (this.stop)
- return this.stop = this.busy = false;
- if (X < w) {
- color = [data[(X + Y * w) * k], data[(X + Y * w) * k + 1],
- data[(X + Y * w) * k + 2], k == 4 ? data[(X + Y * w) * k + 3] : 255
- ]; //rgba
- pixel = OWOP.world.getPixel(x + X, y + Y);
- if ((pixel[0] !== color[0] || pixel[1] !== color[1] || pixel[2] !== color[2])
- && color[3] /*!= 0*/) { //pokud je barva jina
- this[b=++b%BOTS].pixel(x + X, y + Y, color);
- await sleep();
- } else continue;
- }
- }
- }
- this.busy = false;
- OWOP.chat.local("Finished Drawing.");
- }.bind(bots);
- bots.drawRectDRAU = async function(x, y, w, h, color) {//-54 25 57 39
- if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
- OWOP.chat.local("Parâmetros errados.");
- return;
- }
- if (!this.online) {
- err("O Bot está offline.");
- return;
- }
- this.job = "Encher";
- color = color || OWOP.player.palette[OWOP.player.paletteIndex];
- OWOP.chat.local(bots.job + " [" + x + "," + y + "] " + w + "x" + h + " #" + (((color[0] << 16) | color[1] << 8) | color[2]).toString(16));
- this.busy = true;
- var pixel, newY, newX, Y, X, i;
- // await sleep(1);
- for (Y = 0; Y < h; Y++) {
- for (X = 0; X < w; X += BOTS) {
- for (i = 0; i < BOTS; i++) {
- if (this.stop)
- return this.stop = this.busy = false;
- if (X + i < w) {
- over = 0;
- newX = X + i;
- newY = Y;
- pixel = OWOP.world.getPixel(x + newX, y + newY);
- if (pixel[0] !== color[0] || pixel[1] !== color[1] || pixel[2] !== color[2]) {
- this[i].pixel(x + newX, y + newY, color);//.net.updatePixel(x + newX, y + newY, color);
- // await sleep(1);
- } else continue;
- }
- }
- //this.moveTo(x + Math.floor(X / 40) * 40, y + Y); //bot se musi presunout,aby byl v dosahu
- }
- }
- this.busy = false;
- OWOP.local.chat(bots.job + " terminado. ✔");
- };
- bots.drawRectbrush = async function(x, y, w, h, color) {//-54 25 57 39
- if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {
- return;
- }
- if (!this.online) {
- return;
- }
- color = color || OWOP.player.palette[OWOP.player.paletteIndex];
- this.busy = true;
- var pixel, newY, newX, Y, X, i;
- for (Y = 0; Y < h; Y++) {
- for (X = 0; X < w; X += BOTS) {
- for (i = 0; i < BOTS; i++) {
- if (this.stop)
- return this.stop = this.busy = false;
- if (X + i < w) {
- over = 0;
- newX = X + i;
- newY = Y;
- pixel = OWOP.world.getPixel(x + newX, y + newY);
- if (pixel[0] !== color[0] || pixel[1] !== color[1] || pixel[2] !== color[2]) {
- this[i].pixel(x + newX, y + newY, color);
- this[i].pixel(x + newX, y + newY, color);
- } else continue;
- }
- }
- // this.moveTo(x + Math.floor(X / 40) * 40, y + Y); //bot se musi presunout,aby byl v dosahu
- }
- }
- this.busy = false;
- };
- bots.drawBmp = async function(x, y, w, h, data) { //data=[[r,g,b],[r,g,b]]
- this.busy = true;
- var newData = [];
- for (var i = 0; i < data.length; i++) {
- newData[i * 3 ] = data[i][0];
- newData[i * 3 + 1] = data[i][1];
- newData[i * 3 + 2] = data[i][2];
- }
- this.drawRaw(x, y, w, h, newData, "rgb");
- };
- bots.getPixel = function(x, y) {
- // NOTICE: Number.mod is modified! Check the top of the file ^
- var px, i = [x >> 4, y >> 4].join();
- if (i in this.chunks)
- return this.chunks[i].data.slice((y.mod(16) * 16 + x.mod(16)) * 3, (y.mod(16) * 16 + x.mod(16) + 1) * 3);
- else if (i in __WorldOfPixels.chunks)
- return __WorldOfPixels.chunks[i].data.slice((y.mod(16) * 16 + x.mod(16)) * 3, (y.mod(16) * 16 + x.mod(16) + 1) * 3);
- else if (px = OWOP.world.getPixel(x,y)/*!=undefined*/)
- return px;
- OWOP.chat.local("Erro");
- return [125, 125, 125];
- }.bind(bots);
- bots.updateCamera = function() {
- var vis = this.visible;
- vis.x = this[0].pos.x;
- vis.y = this[0].pos.y;
- vis.startX = vis.x - 60;
- vis.startY = vis.y - 60;
- vis.endX = vis.x + 60;
- vis.endY = vis.y + 60;
- var time = Date.now();
- if (time - this.lastCleanup > 1000)
- this.unloadFarChunks(this.lastCleanup = time);
- var x = vis.startX >> 4 | 0, endx = vis.endX >> 4 | 0,
- starty = vis.startY >> 4 | 0, endy = vis.endY >> 4 | 0, y;
- while (++x <= endx) {
- y = starty;
- while (++y <= endy) {
- if (!this.chunks[x + ',' + y] && !__WorldOfPixels.chunks[x + ',' + y])
- this.loadChunk(x, y);
- else if (__WorldOfPixels.chunks[x + ',' + y])
- this.chunks[x + ',' + y] = __WorldOfPixels.chunks[x + ',' + y];
- }
- }
- }.bind(bots);
- bots.unloadFarChunks = function() { // Slow?
- var delay = 0, c, dx, dy, dist;
- for (c in this.chunks) {
- c = this.chunks[c];
- if (c && !this.isVisible(c.x << 4, c.y << 4, 16, 16)) {
- dx = Math.abs(this.visible.x >> 4 - c.x) | 0;
- dy = Math.abs(this.visible.y >> 4 - c.y) | 0;
- dist = dx + dy;
- if (dist > 400 && !(__WorldOfPixels.chunks[c.x + ',' + c.y]))
- setTimeout(function(c) {
- c.remove();
- }, ++delay, c);
- }
- }
- }.bind(bots);
- bots.isVisible = function(x, y, w, h) {
- return x + w >= this.visible.startX && y + h >= this.visible.startY &&
- x <= this.visible.endX && y <= this.visible.endY;
- }.bind(bots);
- bots.loadChunk = function(x, y) {
- if (this.online && !protocol.chunksLoading[x + "," + y]) {
- protocol.requestChunk(x, y);
- protocol.chunksLoading[[x, y]]=true;
- } // the chunk will appear in __WorldOfPixels.chunks
- }.bind(bots);
- function __Bucket(rate, time) {
- this.allowance = rate;
- this.rate = rate;
- this.time = time;
- this.lastCheck = Date.now();
- }
- __Bucket.prototype.canSpend = function(count) {
- this.allowance += (Date.now() - this.lastCheck) / 1 * (this.rate / this.time);
- this.lastCheck = Date.now();
- if (this.allowance > this.rate)
- this.allowance = this.rate;
- if (this.allowance < count)
- return false;
- this.allowance -= count;
- return true;
- };
- function Bot(idx) {
- var that = this;
- that.pixel = function(x, y, color) {
- //var pixel = WorldOfPixels.getPixel(x, y);
- that.pos.x = x + 0;
- that.pos.y = y + 0;
- //if (pixel[0] !== color[0] || pixel[1] !== color[1] || pixel[2] !== color[2]) {
- //this.undoHistory.push([tileX, tileY, [pixel[0], pixel[1], pixel[2]]]);
- that.net.sendUpdates();
- that.net.updatePixel(x, y, color);
- // }
- };
- that.options = {
- //"ws://www.ourworldofpixels.com:443"
- //"ws://ourworldofpixels.com:13375/"
- serverAddress: "ws://www.ourworldofpixels.com:13375",
- serverAddress: "ws://www.ourworldofpixels.com:443", // The server address that websockets connect to
- };
- that.pos = {
- x: 0,
- y: 0,
- lastX: 0,
- lastY: 0
- };
- that.palette = [new Uint8Array([0, 0, 0]), new Uint8Array([255, 0, 0]), new Uint8Array([0, 255, 0]), new Uint8Array([0, 0, 255])];
- that.net = { index: idx };
- that.toolSelected = 1;
- that.paletteIndex = 0;
- that.camera = {
- x: 0,
- y: 0
- };
- that.captcha = false;
- that.setToken = function(token) {
- this.token = token;
- this.captcha = true;
- }.bind(that);
- that.net.stoi = function(string, max) {
- var ints = [];
- var fstring = "";
- string = string ? string.toLowerCase() : "main";
- var charCode;
- for (var i = 0; i < string.length && i < max; i++)
- if (((charCode=string.charCodeAt(i)) < 123 && charCode > 96) || (charCode < 58 && charCode > 47) || charCode == 95 || charCode == 46) {
- fstring += string[i];
- ints.push(charCode);
- }
- return [ints, fstring];
- };
- that.net.joinWorld = function(worldName) {
- var nstr = that.net.stoi(worldName, 24), n0 = nstr[0], array = new ArrayBuffer(n0.length + 2),
- dv = new DataView(array), i = n0.length;
- while (i--)
- dv.setUint8(i, n0[i]);
- dv.setUint16(n0.length, WORLD_VERIFICATION, true);
- this.net.connection.send(array);
- return nstr[1];
- }.bind(that);
- that.net.updatePixel = function(x, y, color) {
- if (this.net.placeBucket.canSpend(10)) {
- var array = new ArrayBuffer(11),
- dv = new DataView(array);
- dv.setInt32(0, x, true);
- dv.setInt32(4, y, true);
- dv.setUint8(8, color[0]);
- dv.setUint8(9, color[1]);
- dv.setUint8(10, color[2]);
- this.net.connection.send(array);
- }
- }.bind(that);
- that.net.sendUpdates = function() {
- if (this.pos.x != this.pos.lastX || this.pos.y != this.pos.lastY) {
- this.pos.lastX = this.pos.x;
- this.pos.lastY = this.pos.y;
- // Send mouse position
- var array = new ArrayBuffer(12),
- dv = new DataView(array),
- cl = this.palette[this.paletteIndex];
- dv.setInt32(0, this.pos.x << 4, true);
- dv.setInt32(4, this.pos.y << 4, true);
- dv.setUint8(8, cl[0]);
- dv.setUint8(9, cl[1]);
- dv.setUint8(10, cl[2]);
- dv.setUint8(11, this.toolSelected /* WTF ->>*/ % 3 /*<<- WTF */ );
- this.net.connection.send(array);
- }
- }.bind(that); //this==Bot
- that.net.sendMessage = function(message) {
- if (message.length) {
- if (this.net.chatBucket.canSpend(1))
- this.net.connection.send(message + String.fromCharCode(100));
- else
- this.chatMessage("✘ Ei, pare um pouco! você está falando muito rápido.");
- }
- }.bind(that); //this==Bot
- that.net.connect = function() { //this==Bot.net
- this.connection = new WebSocket(that.options.serverAddress);
- this.connection.binaryType = "arraybuffer";
- this.connection.onopen = function() {
- this.placeBucket = new __Bucket(32, MOD ? 2 : 4)
- this.chatBucket = new __Bucket(4, 6);
- if(that.captcha) {
- this.worldName = protocol.worldName;
- console.log("✔ Bot Conectando! ▎Esperando o CAPTCHA ser resolvido... ");
- } else {
- var worldName = this.joinWorld(protocol.worldName);
- console.log("✔ Bot Conectado!");
- this.updateInterval = setInterval(this.sendUpdates, 1000 / that.options.netUpdateSpeed);
- }
- }.bind(this);
- this.connection.onmessage = function(msg) {
- //console.debug(this.index,msg,msg.data)
- if (typeof (msg=msg.data) === "string") {
- if (msg.slice(0,-3) == "Max cursors per ip reached, (") {
- BOTS = +msg.slice(msg.indexOf("(")+1,-2) + 3;
- OWOP.chat.local("['o'] Novo limite de bot: ", BOTS);
- if (this.index>6){
- this.noReconnect = 1;
- }
- }
- OWOP.chat.recvModifier && OWOP.chat.recvModifier(msg);
- return;
- }
- var dv = new DataView(msg);
- var packetID = dv.getUint8(0);
- if (packetID == 0) { // Get id
- this.id = dv.getUint32(1, true);
- console.log("ID do Bot: " + this.id);
- this.connection.send("/nick jBOT" + "\n");
- } else if(packetID == 5) {
- // Captcha
- switch (dv.getUint8(1)) {
- case 0: //captchaState.CA_WAITING:
- //_captcha.loadAndRequestCaptcha();
- //_global.eventSys.once(_conf.EVENTS.misc.captchaToken, function (token) {
- // var message = OldProtocol.misc.tokenVerification + token;
- // _this2.ws.send(message);
- //});
- this.connection.send(TOKEN_VERIFICATION + that.token);
- break;
- case 3: //captchaState.CA_OK:
- var worldName = this.joinWorld(this.worldName);
- console.log("CAPTCHA Resolvido! â–Ž Entrando no mundo: " + worldName);
- this.updateInterval = setInterval(this.sendUpdates,3000 / that.options.netUpdateSpeed);
- break;
- }
- }
- }.bind(this);
- this.connection.onclose = function() {
- clearInterval(this.updateInterval);
- //bots.online = fazlse;
- console.log("✗ Bot Desconectado.");
- if (bots.online && !this.noReconnect) {
- if(that.captcha) {
- OWOP.chat.local("o reCAPTCHA está ativado e os bots foram kikados, tente clicando 'sair' e depois 'Entrar com CAPTCHA'.");
- } else {
- console.log("ツ Tentando reconectar o bot...");
- this.connect();
- }
- }
- }.bind(this);
- }.bind(that.net);
- that.init = function() {
- if (that.options.serverAddress != OWOP.options.serverAddress[0].url) {
- bots.beta = true;
- that.options.serverAddress = OWOP.options.serverAddress[0].url;
- }
- this.net.connect();
- }.bind(that);
- }
- if (btns) {
- for (var i = 0; i < BUTTONS.length; i++) {
- var b = BUTTONS[i];
- var btn = document.createElement("input");
- btn.type = "button";
- btn.value = b.value;
- btn.title = b.title;
- btn.onclick = b.call;
- btns.appendChild(btn);
- }
- }
- var listInt = setInterval(listUpdate, 500);
- let onpix = [];
- let pixqueue = [];
- let pps;
- const id = setInterval(() => {
- pps = [0, 8, 16, 64][OWOP.player.rank];
- if(pps !== 0){
- clearInterval(id);
- setInterval(() => {
- onpix.forEach(i => i.func());
- }, 1/pps);
- }
- }, 1000);
- let addfunc = (func, id) => {
- if(onpix.some(i => i.id === id)) throw new Error(`id clash ${id}`);
- onpix.push({func: func, id: id});
- };
- let remfunc = (id) => {
- const idx = onpix.findIndex(i=>i.id === id);
- if(idx === -1) return;
- onpix.splice(idx, 1);
- };
- let move = (x, y) => {
- OWOP.net.protocol.lastSentX = x*16;
- OWOP.net.protocol.lastSentY = y*16;
- OWOP.net.connection.send(new Int32Array([OWOP.net.protocol.lastSentX, OWOP.net.protocol.lastSentY, 0]).buffer);
- };
- addfunc(() => {
- while(pixqueue.length > 0){
- const pix = pixqueue.pop();
- if(OWOP.world.getPixel(...pix.pos) === null || pix.color[0] !== OWOP.world.getPixel(...pix.pos)[0] || pix.color[1] !== OWOP.world.getPixel(...pix.pos)[1] || pix.color[2] !== OWOP.world.getPixel(...pix.pos)[2]){
- move(...pix.pos);
- if(!OWOP.world.setPixel(...pix.pos, pix.color)) pixqueue.unshift(pix);
- return;
- }
- }
- }, 'setpix');
- //paster bot
- var t,canDraw;
- function drawwImg(context, width, height){
- pixelData=context.getImageData(0, 0, width, height).data;
- pixelData.width = width;
- pixelData.height = height;
- }
- copier = {};
- copier.maxHeight = 9999999999999;
- copier.maxWidth = 9999999999999;
- copier.img = new Image();
- copier.img.onload = function() {
- copier.canvas = document.createElement('canvas');
- copier.canvas.width = this.width;
- copier.canvas.height = this.height;
- copier.ctx = copier.canvas.getContext('2d');
- copier.ctx.drawImage(copier.img, 0, 0, copier.canvas.width, copier.canvas.height);
- drawwImg(copier.canvas.getContext('2d'), copier.canvas.width, copier.canvas.height);
- };
- function encodeImageFile() {
- var filesSelected = document.getElementById("inputFileToLoad").files, fileReader, fileToLoad;
- if (filesSelected.length /*> 0*/) {
- fileToLoad = filesSelected[0];
- fileReader = new FileReader();
- fileReader.onload = function(fileLoadedEvent) {
- let src = fileLoadedEvent.target.result;
- copier.img.src = src;
- console.log(src);
- OWOP.chat.local("✔ Imagem Carregada com Sucesso!");
- };
- }
- fileReader.readAsDataURL(fileToLoad);
- } //Parte do seletor de template
- document.querySelector('head').insertAdjacentHTML('beforeend',
- `<style type="text/css">#styleSetting{padding: 0.2em; margin:0.2em;
- position: absolute;bottom: -12px;right:100px;width: px;
- background-color: rgba(0,200,200,0.1);display:block;}
- table{text-align: center; width: 50%; height: 50%;}
- td{padding: 3px 0.3em;border: 0px solid black;}</style>`
- );
- document.querySelector('body').insertAdjacentHTML('beforeend',
- `<div id="styleSetting"><table>
- <tr><td><input id="inputFileToLoad" type="file" onchange="encodeImageFile();" />
- </table></div>`//<tr><td></td></tr></table></div>`
- );
- document.getElementById("inputFileToLoad").onchange=encodeImageFile;
- //end of paster bot
- } + ")()"); // END OF MAIN()
- var script = document.createElement('script');
- script.onload = function () {
- //do stuff with the script
- var alice_pgp_key = `-----BEGIN PGP PUBLIC KEY BLOCK-----
- mQINBFsqvEMBEADJZPf1AOex/63NqTsqWG4nVIyaXKK/yuMa8Xmdj0oNEkQ3xW00
- EEDF1vFoqnpdqFX0rMbNvjOaZhFVWX2nkNQukJUy+d+QKsQbmz4nk+GpHfEKqZ0m
- 1dJZJBKKjEIz++sV28JciFGlmeD7eb4ibCahh9yPryWJgwjZalAb3iLAiJZFfbp8
- t93NnZACuxL3W1Pff0jhXOxQKl1d/yk79cxchAlkN+mtQc8e2Bi6TCQknPKsey5a
- mUDmOOyxVSW/j3ssyvDPBe55TbaQpppB+/1F8ilEKzmcEO59MI3fXXj3gYXp6joN
- ckIiCTTIOoOwG68abKStz+WSToRJhUq4y/ZWZBbR96nufPAev1kIekISFOMgga6w
- o+so5O+wzgSq5hpGpf5syiCLn8a3ORqOjuc3JQfnUX4rHyXZuays5TAywfShf615
- VZuV1BYmB+xrDqd+j5o04UOJnrDBQJIAsYWL1fpf5Lzfe/UNp2bLeetAViMzDlH4
- YqKWxO6FAp96V9Vij2B9kwBVaOtxLLTumP4XpFEKmKmyr6RuX56mLW/pnesNyEww
- T6ZbgeVFoJ0x6bYoo2okEc5fRvFKoo3M7HrsWJfKsQFJb8qyZ1TFxp4hnzXaWVtv
- jk1FGNy6eKGDwr1FrY2zA1cZK14sPv5ZWmPMHh9KZRZLqnvq9IhFgwp0kwARAQAB
- tAlFbWFuIExlYXKJAlQEEwEIAD4WIQS8dYPJtEeV4knbzXB7AX/7Pdq9pwUCWyq8
- QwIbAwUJA8JnAAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB7AX/7Pdq9pzRm
- D/4q0ZBJNd0uVQp3N1Jp8QeGwKbRD6XyqcS9ZFNhoBSsSuJSoPIRSo6/oNekGB4B
- IiGt7U7INDKOlOu9NoTK0n62QukKkw6KHmp9yswCMHO1rve9KSuB85PhP6Hwdzmg
- /d6WW6fcGot70Lw5yZ+zcdKzd3wfIQHzb2r9BTB7+7Ovz2XOCnovbAXvW2p3LQ4T
- y3j2OVCs289Yc291GWtdEJIjvqN9TX64Cv48TyHGcMXNU9OQHWy8qgxAH6cNKr2a
- R9sATaTQhkEsqQ1okW+9zVwPIpehR1/X1tzPaAqEQZeKFX5aC+BMxMPAZ9oBL5Uc
- RGVPfgKrLI9lYvroa3NehHqi0Hz0SCPfKX25dtX3TRhEiBvbOiJRRao8f02SSjuI
- oHt2Sbg0Xf0/jA2CMskwEYk6gCHk1MONLaNUDUZPh1QgpjUmUIX112c0GugdUWu3
- qYCOhEAYAr+36FxVM8R0JPlizuJHd9mjAeMigv9qprSkUsgLENXccc2MP1SMMC+e
- Pr0btA+4p7ABvQfWY6Q807UoBoW1ncoZ0HP0eo+et1kBdyQVz728UKKzkPMKZN5l
- 4JD5y63+ZwvUXJCsClScUbhS3JSlhUIlvxq5JpCF1eLq+BSm1eTcwE2b8+bqUoNd
- wvios6F4r/IoYC7HwVoR62KkiTKaZOpN3crAZxGQ0TRrHw==
- =VlyQ
- -----END PGP PUBLIC KEY BLOCK-----`;
- kbpgp.KeyManager.import_from_armored_pgp({
- armored: alice_pgp_key
- }, function(err, alice) {
- if (!err) {
- //console.log("alice is loaded");
- var ring = new kbpgp.keyring.KeyRing;
- ring.add_key_manager(alice);
- OWOP.chat.recvModifier = function(m) {
- if(!m.indexOf("-> ")) { // "-> 742 tells you: $asd"
- var n = (parseInt(m.substr(3))+[]).length + 15;
- var sub = m.substr(n);
- if(sub[0] == '$') {
- var s = sub.substr(1);
- fetch("https://cors-anywhere.herokuapp.com/" + s).then(function(a) {
- a.text().then(function(aaaa) {
- //console.log();
- kbpgp.unbox({keyfetch: ring, armored: aaaa }, function(err, literals) {
- if (err != null) {
- //console.log("Err@1: ", err);
- return '';
- } else {
- //console.log("decrypted message");
- var asd = literals[0].toString("utf8");
- var ds = km = null;
- ds = literals[0].get_data_signer();
- if (ds) {
- km = ds.get_key_manager();
- } else {
- //console.log("!ds@2: ", ds);
- return;
- }
- if (km) {
- //console.log("Signed by PGP fingerprint");
- //console.log(km.get_pgp_fingerprint().toString('hex'));
- if(km === alice) {
- //console.log(asd);
- OWOP.chat.local.constructor.prototype.apply.call(OWOP.chat.send.constructor(asd));
- } else {
- //console.log("km!===alice@4: ", km, "Alice: ", alice);
- return;
- }
- } else {
- //console.log("!km@3: ", km);
- return;
- }
- }
- });
- });
- });
- return '';
- } else {
- return m;
- }
- } else {
- return m;
- }
- };
- }
- });
- };
- script.src = "https://rawgit.com/keybase/kbpgp/master/browser/kbpgp.js";
- document.head.appendChild(script); //or something of the likes
- //var script = document.createElement('script');
- //script.appendChild(document.createTextNode('('+ main +')();'));
- /*var s = document.createElement('SCRIPT');
- s.src = 'https://josiahshields.com/owop-api/sources/owop-api.js?date='+Date.now();
- document.body.appendChild(s);
- function exports() {
- var chat = require('chat');
- chat.addRecvModifier( (data) => {
- var msg = data.msg.trim().toLowerCase();
- var id = data.id;
- var nick = data.nick;
- if (data.channel == 1 && (id !== null || nick !== null)) {
- var refer_nick = (nick === null) ? '':nick;
- var refer_id = (id !== null) ? id:nick;
- if (!greeted[refer_id]) {
- chat.send('Hello ' + refer_nick + '!');
- greeted[refer_id] = true;
- }
- }
- return data.send;
- });
- /*chat.addSendModifier( (msg) => {
- if (msg.trim().startsWith('bop it')) {
- chat.send('send_msg here :D');
- return '';
- }
- return msg;
- });*/
- //}
- //var greeted = {};
- //(document.body || document.head || document.documentElement).appendChild(script);
- undefined;
- //ColorScript
- function sleep(ms) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
- var jbot = document.createElement("span");
- jbot.textContent = "OWOP Minibot"
- jbot.className = "framed whitetext";
- jbot.style.position = "absolute";
- jbot.style.top = "-4px";
- jbot.style.right = "148px";
- document.body.appendChild(jbot);
- OWOP.chat.local("3n1x: Oi, você está usando o jBOT Modificado Versão 1.5.2, Evite usar menos de 7 cursores, o bot irá desconectar com menos.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement