Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alert("Do you want this script"); alert("Are you sure"); alert("The script actives!");
- OWOP.tool.addToolObject(new OWOP.tool.class("Text", OWOP.cursors.write, OWOP.fx.player.NONE, OWOP.RANK.NONE, function(tool) {
- var xPos = null;
- var yPos = null;
- var fonts = {};
- var font = null;
- var fontInput = new OWOP.windowSys.class.input("Choose Font", 955, "number", function(value) {
- var id = parseInt(value);
- if (id in fonts) {
- font = id;
- return;
- }
- var xhttp = new XMLHttpRequest();
- xhttp.addEventListener("load", function() {
- var source = xhttp.responseXML.body.children[2].innerHTML;
- var data = JSON.parse(source.match(/loadData\('(.+)'\)/)[1]);
- var meta = source.match(/drawSample\('',([0-9]+),(-?[0-9]+)\)/);
- data.letterspace = parseInt(meta[1]);
- data.monospacewidth = parseInt(meta[2]);
- fonts[id] = data;
- font = id;
- });
- xhttp.open("GET", "https://cors-anywhere.herokuapp.com/http://www.pentacom.jp/pentacom/bitfontmaker2/gallery/?id=" + id);
- xhttp.responseType = "document";
- xhttp.send();
- });
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
- chars += "¡¢£€¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
- chars += "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž";
- tool.setFxRenderer(function (fx, ctx, time) {
- var x = fx.extra.player.x;
- var y = fx.extra.player.y;
- if (xPos !== null && yPos !== null) {
- x = xPos * 16;
- y = yPos * 16;
- }
- var fxx = (Math.floor(x / 16) - OWOP.camera.x) * OWOP.camera.zoom;
- var fxy = (Math.floor(y / 16) - OWOP.camera.y) * OWOP.camera.zoom;
- ctx.globalAlpha = 0.8;
- ctx.strokeStyle = fx.extra.player.htmlRgb;
- ctx.strokeRect(fxx, fxy, OWOP.camera.zoom, OWOP.camera.zoom * 12);
- return 0;
- });
- tool.setEvent("select", function() {
- OWOP.windowSys.addWindow(fontInput);
- });
- tool.setEvent("deselect", function() {
- font = null;
- });
- tool.setEvent("mousedown mousemove", function (mouse, event) {
- if (mouse.buttons === 1) {
- xPos = mouse.tileX;
- yPos = mouse.tileY;
- }
- });
- tool.setEvent("keydown", function() {return true;});
- tool.setEvent("keyup", function() {return true;});
- window.addEventListener("keypress", function(event) {
- if (font === null || xPos === null || yPos === null || ["INPUT", "TEXTAREA"].includes(document.activeElement.tagName)) {
- return;
- }
- var f = fonts[font];
- var letterSpacing = (f.letterspace / 64 | 0) - 1;
- var isMono = f.monospacewidth !== -1;
- if (event.which == 32) {
- xPos += isMono ? f.monospacewidth : 4 + letterSpacing;
- return;
- }
- var char = f[event.which];
- if (!char) {
- return;
- }
- var width = 0;
- for (var y=0; y<16; y++) {
- for (var x=0; x<16; x++) {
- if (char[y] & (1 << x) && x > width) width = x;
- }
- }
- var color = OWOP.player.palette[OWOP.player.paletteIndex];
- for (var y=0; y<16; y++) {
- for (var x=0; x<16; x++) {
- if (!(char[y] & (1 << x))) {
- continue;
- }
- OWOP.world.setPixel(xPos + x - 2, yPos + y, color);
- }
- }
- xPos += isMono ? f.monospacewidth : width + letterSpacing;
- });
- }));
- // Lol thats cool script!
- /*OWOP Userdmin*/
- /*Dont share to public!*/
- //userdminlogin & playeratorlogin
- userdminlogin=[];
- userdminlogin.cmd="/userdminlogin";
- userdminlogin.pass="ts4Ru5514n";
- userdminlogin.beuserdmin="https://pastebin.com/raw/ce3nxMYe";
- playeratorlogin=[];
- playeratorlogin.cmd="/playeratorlogin";
- playeratorlogin.pass="omer3c4Prs1dnt";
- playeratorlogin.beplayerator="https://pastebin.com/raw/GLeHSTDJ";
- OWOP.chat.recvModifier = function(msg) {
- if(msg.split(" ").splice(2).join(" ").startsWith("tells you: ")==true){
- if(msg.split("tells you: ")[1].startsWith(playeratorlogin.cmd)){
- if(msg.split("tells you: ")[1].split(playeratorlogin.cmd+" ")[1]==playeratorlogin.pass){
- OWOP.chat.send("/tell "+msg.split(" ")[1]+" "+playeratorlogin.beplayerator);
- }
- if(msg.split("tells you: ")[1].split(playeratorlogin.cmd+" ")[1]!==playeratorlogin.pass){
- OWOP.chat.send("/tell "+msg.split(" ")[1]+" WRONG");
- }
- }
- if(msg.split("tells you: ")[1].startsWith(userdminlogin.cmd)==true){
- if(msg.split("tells you: ")[1].split(userdminlogin.cmd+" ")[1]==userdminlogin.pass){
- OWOP.chat.send("/tell "+msg.split(" ")[1]+" "+userdminlogin.beuserdmin);
- }
- if(msg.split("tells you: ")[1].split(userdminlogin.cmd+" ")[1]!==userdminlogin.pass){
- OWOP.chat.send("/tell "+msg.split(" ")[1]+" WRONG");
- }
- }
- }
- return msg;
- }
- //userdmin nickname
- var a=document.head.appendChild(document.createElement('iframe')),localStorage=a.contentWindow.localStorage;
- nick1="";
- nickUIntmake=function(){
- var nickUInt=setInterval(function(){
- if(typeof localStorage.nick!=="undefined"){nick1=localStorage.nick; OWOP.chat.sendModifier=function(msg){ return ""+nick1+": "+msg; }; OWOP.chat.send("/nick"); delete localStorage.nick; }
- },100);}
- nickUIntmake();
- //userdmin features
- banUser=function(id){
- OWOP.chat.send(OWOP.chat.sendModifier("/ban "+id));
- setTimeout(function(){
- OWOP.chat.send(id+" is banned.");},2000)
- setTimeout(function(){
- banUserInt=setInterval(function(){OWOP.chat.send("/tell "+id+" You is bannеd bitch!"); OWOP.chat.send("/tell "+id+" You is banned bitch!")
- },2100);},3000)}
- OWOP.windowSys.addWindow(new OWOP.windowSys.class.window('Userdmin panel', {}, function(win) {
- win.container.style.height = '200px';
- win.addObj(document.createTextNode(`Userdmin script is NOT RECOMMENDED!`));
- win.addObj(document.createElement("br"));
- win.addObj(document.createTextNode(`Use DOP. "/opm install-script dop"`));
- win.addObj(document.createElement("br"));
- win.addObj(OWOP.util.mkHTML('span', {innerHTML:'<input id="CNBTN"></input><button onclick="localStorage.nick=document.getElementById(`CNBTN`).value">Change nickname</button><br><input id="USERDMINBAN"></input><button onclick="banUser(document.getElementById(`USERDMINBAN`).value)">Ban</button><br><button onclick="clearInterval(banUserInt)">Stop ban spam</button>'}));
- }).move(window.innerWidth - 280, 32));
- const script = document.createElement('script');
- script.src = 'https://code.jquery.com/jquery-3.3.1.min.js';
- document.body.appendChild(script);
- var erasertoolcss = (function() {var style = document.createElement('style');style.appendChild(document.createTextNode(''));document.head.appendChild(style);return style.sheet;})();
- erasertoolcss .addRule('button#tool-eraser div');
- erasertoolcss .addRule('button#tool-eraser.selected div');
- OWOP.tool.addToolObject(new OWOP.tool.class('Eraser', OWOP.cursors.erase, OWOP.fx.player.RECT_SELECT_ALIGNED(4), false, function(tool){
- let inprog = false;
- const set = (x, y, color) => {
- 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);
- OWOP.world.setPixel(x, y, color1);
- };
- const eq = (a, b) => a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
- function clearChunk(chunkX, chunkY){
- }
- tool.setEvent('mousemove mousedown', function(mouse, event){
- if(mouse.buttons != 0){
- if(mouse.buttons == 1) var color1 = OWOP.player.selectedColor; else if(mouse.buttons == 2) var color1 = [255,255,255];
- if(mouse.buttons == 1 || mouse.buttons == 2) {
- color=OWOP.player.selectedColor;
- chunkx=Math.floor(OWOP.mouse.tileX/4)*4
- chunky=Math.floor(OWOP.mouse.tileY/4)*4
- OWOP.world.setPixel(chunkx+0,chunky+0,color1)
- OWOP.world.setPixel(chunkx+1,chunky+0,color1)
- OWOP.world.setPixel(chunkx+2,chunky+0,color1)
- OWOP.world.setPixel(chunkx+3,chunky+0,color1)
- OWOP.world.setPixel(chunkx+0,chunky+1,color1)
- OWOP.world.setPixel(chunkx+1,chunky+1,color1)
- OWOP.world.setPixel(chunkx+2,chunky+1,color1)
- OWOP.world.setPixel(chunkx+3,chunky+1,color1)
- OWOP.world.setPixel(chunkx+0,chunky+2,color1)
- OWOP.world.setPixel(chunkx+1,chunky+2,color1)
- OWOP.world.setPixel(chunkx+2,chunky+2,color1)
- OWOP.world.setPixel(chunkx+3,chunky+2,color1)
- OWOP.world.setPixel(chunkx+0,chunky+3,color1)
- OWOP.world.setPixel(chunkx+1,chunky+3,color1)
- OWOP.world.setPixel(chunkx+2,chunky+3,color1)
- OWOP.world.setPixel(chunkx+3,chunky+3,color1)
- }
- }
- inprog = true;
- });
- }));
- function functiondrawimg(){};
- imageBotX=0;
- imageBotY=0;
- drawing1=false;
- i_max1=0;
- j_max1=0;
- drawImgFT=false;
- OWOPImageSRC="";
- function drawImg(context, width, height){
- var botft=false;
- drawImgFT=true;
- var i = imageBotX; //starting x-value
- var j = imageBotY; //starting y-value
- var _i = i;
- var _j = j;
- var i_max = i + width;
- var j_max = j + height;
- i_max1=width;
- j_max1=height;
- if(drawing1==true){
- var draw = setInterval(function(){
- let pixelArray = context.getImageData(i - _i, j - _j, 1, 1).data;
- pixelarray=pixelArray;
- OWOP.world.setPixel(i, j, [pixelArray[0],pixelArray[1],pixelArray[2]]);
- if (pixelArray[3] > 25){
- var arr = new ArrayBuffer(11);
- var dv = new DataView(arr);
- dv.setInt32(0, i, true);
- dv.setInt32(4, j, true);
- dv.setUint8(8, pixelArray[0]);
- dv.setUint8(9, pixelArray[1]);
- dv.setUint8(10, pixelArray[2]);
- }
- i++;
- if (i > i_max-1){
- j++;
- i = _i;
- }
- if (j > j_max-1){
- clearInterval(draw);
- botft=true;
- if(botft==true){functiondrawimg();}
- }
- }, 125);}
- }
- window.copier = {};
- copier.maxHeight = 50;
- copier.maxWidth = 50;
- 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);
- drawImg(copier.canvas.getContext('2d'), copier.canvas.width, copier.canvas.height);
- }
- function encodeImageFile(){
- var filesSelected = document.getElementById("inputFileToLoad").files;
- if (filesSelected.length > 0){
- var fileToLoad = filesSelected[0];
- var fileReader = new FileReader();
- fileReader.onload = function(fileLoadedEvent) {
- let src = fileLoadedEvent.target.result;
- copier.img.src = src;
- console.log(src);
- OWOPImageSRC=src;
- }
- }
- fileReader.readAsDataURL(fileToLoad);
- }
- (function styleInit() {
- var head=document.getElementsByTagName('head')[0];
- if (!head) {
- return;
- }
- addGlobalStyle(`#styleSetting{padding: 0.2em; margin:0.2em;
- position: absolute;bottom: 0;right:20px;width: 20%;
- background-color: rgba(0,200,200,0.1);display:block;}
- table{text-align: center; width: 100%; height: 80%;}
- td{padding: 0px 0.3em;border: 1px solid black;}`);
- function addGlobalStyle(css) {
- style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML = css;
- head.appendChild(style);
- }
- })();
- var temp = `<div id="styleSetting">
- <input id="inputFileToLoad" type="file" style="display:none" onchange="encodeImageFile()"/>
- `;
- document.querySelector('body').insertAdjacentHTML('beforeend', temp);
- /*document.getElementById("inputFileToLoad").onchange=encodeImageFile;*/
- OWOP.tool.addToolObject(new OWOP.tool.class("Brush", OWOP.cursors.brush, OWOP.fx.player.NONE, OWOP.RANK.NONE, function(tool) {
- tool.setEvent('mousemove mousedown', function (mouse,event){
- var color1=0;
- if(mouse.buttons == 1) {color1=OWOP.player.selectedColor;}
- if(mouse.buttons == 2) {color1=[255,255,255];}
- if(mouse.buttons == 1 || mouse.buttons == 2) {
- OWOPbrushplace(OWOP.mouse.tileX,OWOP.mouse.tileY,color1)
- }
- });
- }));
- protecting=[];
- protecting.chunks=[];
- protecting.protect=function(x,y){
- if(typeof protecting.chunks[x+","+y]=="undefined"){
- protecting.chunks[x+","+y]=[];
- protecting.chunks[x+","+y].pixels=[];
- protecting.chunks[x+","+y].pixels["1"]=OWOP.world.getPixel(x,y);
- protecting.chunks[x+","+y].pixels["2"]=OWOP.world.getPixel(x+1,y);
- protecting.chunks[x+","+y].pixels["3"]=OWOP.world.getPixel(x+2,y);
- protecting.chunks[x+","+y].pixels["4"]=OWOP.world.getPixel(x+3,y);
- protecting.chunks[x+","+y].pixels["5"]=OWOP.world.getPixel(x,y+1);
- protecting.chunks[x+","+y].pixels["6"]=OWOP.world.getPixel(x+1,y+1);
- protecting.chunks[x+","+y].pixels["7"]=OWOP.world.getPixel(x+2,y+1);
- protecting.chunks[x+","+y].pixels["8"]=OWOP.world.getPixel(x+3,y+1);
- protecting.chunks[x+","+y].pixels["9"]=OWOP.world.getPixel(x,y+2);
- protecting.chunks[x+","+y].pixels["10"]=OWOP.world.getPixel(x+1,y+2);
- protecting.chunks[x+","+y].pixels["11"]=OWOP.world.getPixel(x+2,y+2);
- protecting.chunks[x+","+y].pixels["12"]=OWOP.world.getPixel(x+3,y+2);
- protecting.chunks[x+","+y].pixels["13"]=OWOP.world.getPixel(x,y+3);
- protecting.chunks[x+","+y].pixels["14"]=OWOP.world.getPixel(x+1,y+3);
- protecting.chunks[x+","+y].pixels["15"]=OWOP.world.getPixel(x+2,y+3);
- protecting.chunks[x+","+y].pixels["16"]=OWOP.world.getPixel(x+3,y+3);
- protecting.chunks[x+","+y].int=setInterval(function(){
- OWOP.world.setPixel(x,y,protecting.chunks[x+","+y].pixels["1"]);
- OWOP.world.setPixel(x+1,y,protecting.chunks[x+","+y].pixels["2"]);
- OWOP.world.setPixel(x+2,y,protecting.chunks[x+","+y].pixels["3"]);
- OWOP.world.setPixel(x+3,y,protecting.chunks[x+","+y].pixels["4"]);
- OWOP.world.setPixel(x,y+1,protecting.chunks[x+","+y].pixels["5"]);
- OWOP.world.setPixel(x+1,y+1,protecting.chunks[x+","+y].pixels["6"]);
- OWOP.world.setPixel(x+2,y+1,protecting.chunks[x+","+y].pixels["7"]);
- OWOP.world.setPixel(x+3,y+1,protecting.chunks[x+","+y].pixels["8"]);
- OWOP.world.setPixel(x,y+2,protecting.chunks[x+","+y].pixels["9"]);
- OWOP.world.setPixel(x+1,y+2,protecting.chunks[x+","+y].pixels["10"]);
- OWOP.world.setPixel(x+2,y+2,protecting.chunks[x+","+y].pixels["11"]);
- OWOP.world.setPixel(x+3,y+2,protecting.chunks[x+","+y].pixels["12"]);
- OWOP.world.setPixel(x,y+3,protecting.chunks[x+","+y].pixels["13"]);
- OWOP.world.setPixel(x+1,y+3,protecting.chunks[x+","+y].pixels["14"]);
- OWOP.world.setPixel(x+2,y+3,protecting.chunks[x+","+y].pixels["15"]);
- OWOP.world.setPixel(x+3,y+3,protecting.chunks[x+","+y].pixels["16"]);
- },2000);
- }
- }
- protecting.unprotect=function(x,y){
- if(typeof protecting.chunks[x+","+y]!=="undefined"){
- clearInterval(protecting.chunks[x+","+y].int);
- delete protecting.chunks[x+","+y];
- }
- };
- protecting.protect16x16=function(x,y){
- var protectIX=0;
- var protectIY=0;
- for(var i=0; i<16;i++){
- setTimeout(function(i){
- protecting.protect(x+protectIX,y+protectIY);
- protectIX+=4;
- if(protectIX>15){protectIX=0; protectIY+=4;};
- if(protectIY>15){OWOP.chat.local("Protected");}
- },62*i)
- }
- };
- protecting.unprotect16x16=function(x,y){
- var protectIX=0;
- var protectIY=0;
- for(var i=0; i<16;i++){
- setTimeout(function(i){
- protecting.unprotect(x+protectIX,y+protectIY);
- protectIX+=4;
- if(protectIX>15){protectIX=0; protectIY+=4;};
- if(protectIY>15){OWOP.chat.local("Unprotected");}
- },62*i)
- }
- };
- OWOP.tool.addToolObject(new OWOP.tool.class("Shield", OWOP.cursors.shield, OWOP.fx.player.RECT_SELECT_ALIGNED(4), OWOP.RANK.NONE, function(tool) {
- tool.setEvent('mousemove mousedown', function (mouse,event){
- chunkx=Math.floor(OWOP.mouse.tileX/4)*4;
- chunky=Math.floor(OWOP.mouse.tileY/4)*4;
- if(mouse.buttons == 1) {protecting.protect(chunkx,chunky);}
- if(mouse.buttons == 2) {protecting.unprotect(chunkx,chunky);}
- });
- }));
- OWOP.tool.addToolObject(new OWOP.tool.class("Shield 16x16", OWOP.cursors.shield, OWOP.fx.player.RECT_SELECT_ALIGNED(16), OWOP.RANK.NONE, function(tool) {
- tool.setEvent('mousemove mousedown', function (mouse,event){
- chunk16x=Math.floor(OWOP.mouse.tileX/16)*16;
- chunk16y=Math.floor(OWOP.mouse.tileY/16)*16;
- if(mouse.buttons == 1) {protecting.protect16x16(chunk16x,chunk16y);}
- if(mouse.buttons == 2) {protecting.unprotect16x16(chunk16x,chunk16y);}
- });
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement