NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// ==UserScript==
// @name Drawaria.online Scripts
// @namespace http://tampermonkey.net/
// @version 1.5.7
// @description just a compilation of random scripts
// @match https://*.drawaria.online/*
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.3.0/chroma.min.js
// @icon https://www.google.com/s2/favicons?domain=drawaria.online
// @author Jkhenz
// @grant none
// ==/UserScript==


(function ($, undefined) {
$(function () {

let curUrl = location.href;
if(curUrl.includes('drawaria.online/avatar/builder')){

//Avatar Builder
let wait;
Start();

function Start(){
wait = setInterval(function(){
if($('.Canvas').length === 1){
Avatar();
AvatarAlt();
StopWaiting();


}
}, 200);
}

function StopWaiting(){
clearInterval(wait);
}

function Avatar(){
$('header').append('<label class="Button" for="image_input">Upload Image</label><input style="display:none" id="image_input" type="file" accept=".jfif, .jpg, .png">');
let uploaded_image;
$("#image_input").change(function() {
const reader = new FileReader();
let fileSize= this.files[0].size;
if(fileSize <=700000){
reader.addEventListener('load', function (){
uploaded_image = reader.result;
if(LOGGEDIN){
$.post("/saveavatar", {
"avatarsave_builder":(`${JSON.stringify(ACCOUNT_AVATARSAVE)}`),
"imagedata": (`${uploaded_image}`),
"fromeditor": false
})
}else{
localStorage.setItem("avatarimagedata",(`${uploaded_image}`));
$.removeCookie('wt', { path: '/' });

}
$('label')[0].innerHTML = "Saving...";


setInterval(function(){
$('label')[0].innerHTML = "Save OK!";
let curUrl = window.location.href;
let domain = curUrl.replace("avatar/builder/","");
window.location.href = domain;
}, 2500);


});
reader.readAsDataURL(this.files[0]);
}
else{
alert("image file size is too large");
}
});


}
function AvatarAlt(){
$('.Canvas').append('<label for="image_input2" style="width:128px; height:128px; position:absolute; cursor:pointer" ><input style="display:none" id="image_input2" type="file" accept="image/*" >');

let uploaded_image2;
$("#image_input2").change(function() {
const reader = new FileReader();

reader.addEventListener('load', function (){
uploaded_image2 = reader.result;
imgChange(uploaded_image2);

});
reader.readAsDataURL(this.files[0]);

});

}
function imgChange(imagePath) {
var canvas=document.getElementsByClassName("main")[0];
var ctx=canvas.getContext("2d");
var img=new Image();
img.onload = function(){
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img,0,0,canvas.width,canvas.width);
};
img.src=imagePath;
}

} else if(curUrl.includes('drawaria.online/gallery')){
}else{
let rightBar = $("#rightbar");
$('<div id="toolsPanel" style="overflow-y: scroll; height: 100%; " >').insertAfter(rightBar.children()[3]);

let wordDif = new RegExp('слов|Palabras|Word');
//join in a room
let joinRoomObserver = new MutationObserver(function(mutations) {
if(wordDif.test(mutations[0].target.textContent)){

AutoStar();
WordHints();
}else{
Token();
RainbowBrush();

}
Status();

joinRoomObserver.disconnect();
});
joinRoomObserver.observe($('#infotext')[0], {childList: true });

}


let refreshWordObserver = new MutationObserver(function(mutations) {

if (mutations[0].target.disabled) {
$('#wordchooser-refreshlist').prop("disabled",false);
}


});
refreshWordObserver.observe($('#wordchooser-refreshlist')[0], {attributes: true});

let launchStickerObserver = new MutationObserver(function(mutations) {

if (mutations[0].target.disabled) {
$('.fa-parachute-box').parent().prop("disabled",false);
}
});
launchStickerObserver.observe($('.fa-parachute-box').parent()[0], {attributes: true});

let checkPlayers = new MutationObserver(function(mutations) {
if($('.playerlist-name-loggedin').length!=0){
$("#give").prop("disabled",false);

}else{
$("#give").prop("disabled",true);
}
});
checkPlayers.observe($('#playerlist')[0], {childList: true});

let joinRoomObserver2 = new MutationObserver(function(mutations) {


let checkStatus = new MutationObserver(function(mutations) {
let statsCount = mutations[0].target.children.length;
if(statsCount == 0){
$('#remAll').prop("disabled",true);
}else{
$('#remAll').prop("disabled",false);
}
if(statsCount == 5){
$('#addAll').prop("disabled",true);
}else{
$('#addAll').prop("disabled",false);
}
});
checkStatus.observe($('.playerlist-name-self')[0].parentNode.children[3].children[3], {childList: true});
});
joinRoomObserver2.observe($('#infotext')[0], {childList: true });

//Token
function Token(){
let tokens = [
{val : 'random', text: 'Random'},
{val : 'fa-thumbs-up', text: 'Like'},
{val : 'fa-heart', text: 'Heart'},
{val : 'fa-paint-brush', text: 'Paint Brush '},
{val : 'fa-cocktail', text: 'Cocktail'},
{val : 'fa-hand-peace', text: 'Peace'},
{val : 'fa-feather-alt', text: 'Feather'},
{val : 'fa-trophy', text: 'Trophy'},
{val : 'fa-mug-hot', text: 'Coffee'},
{val : 'fa-gift', text: 'Gift'},
{val : 'lowest-token', text: 'Lowest'},
{val : 'highest-token', text: 'Highest'}
];
$("#toolsPanel").append('<div id="tokenPanel" style="margin-top:0.4rem; display: flex; flex-direction: column;"><button id="give">Give Token</button></div>');
let tokenSel = $('<select id="selToken"style="width:100%">').prependTo("#tokenPanel");

for(let i=0;i < tokens.length; i++){
tokenSel.append($('<option value="'+tokens[i].val+'">' + tokens[i].text+'</option>'));
if(i==0 || i==9){
tokenSel.append('<hr>');
}

}

$("#give").click(function() {
GiveToken();
});

if(localStorage.getItem('lastToken')==null){
localStorage.setItem('lastToken','random');
}
let selToken=$('#selToken')[0];
selToken.value = localStorage.getItem('lastToken');

function GiveToken(){
for(let i=0 ; i < $('.playerlist-name-loggedin').length;i++){
$('.playerlist-name-loggedin')[i].click();

if($('.playerlist-menu-playername')[i].textContent =="­" || selToken.value == "lowest-token"){
GetToken(i, 'lowest');
}else if(selToken.value == "highest-token"){
GetToken(i, 'highest');
}else if(selToken.value == "random"){
$('.playerlist-tokens > .' + tokens[Math.floor((Math.random() * 9) + 1)].val)[i].click();
}else{
$('.playerlist-tokens > .' + tokens[selToken.selectedIndex].val)[i].click();
}
}
localStorage.setItem('lastToken',selToken.value);
$('.playerlist-menu-hidebutton').click();
$("#give").prop("disabled",true);
setTimeout(function(){ $("#give").prop("disabled",false) }, 300)

function GetToken(playerIndex, choice){
let arr=[];
for(let j =0; j<9;j++){
if($('.playerlist-tokens > .' + tokens [j+1].val)[playerIndex].innerHTML==''){
arr.push(0);
}else{
arr.push(parseInt($('.playerlist-tokens > .' + tokens [j+1].val)[playerIndex].innerHTML));
}
}
let ind;
if(choice=='lowest'){
ind = arr.indexOf(Math.min.apply(Math, arr));
}else if(choice=='highest'){
ind = arr.indexOf(Math.max.apply(Math, arr));
}
$('.playerlist-tokens > .' + tokens[ind+1].val)[playerIndex].click();
}
}
}

//Status
function Status(){
let status = [
{val : 0, text: 'Music Enabled'},
{val : 1, text: 'AFK 1'},
{val : 2, text: 'AFK 2'},
{val : 3, text: 'Inventory Open'},
{val : 4, text: 'Friend List Open'}
];

let allStats = ['fas fa-music', 'far fa-moon', 'fas fa-moon', 'fas fa-box', 'fas fa-user-friends'];

$("#toolsPanel").append('<div id="statusPanel" style="margin-top:0.4rem; display: flex; flex-direction: column;"><button id="togStats">Toggle Status</button><div id="toggleAll" style="display: flex; flex-direction: row;justify:center;"><button style="flex:1" id="addAll" >Add All</button><button style="flex:1" id="remAll" disabled>Remove All</button></div></div>');

let statusSel = $('<select id="selStat" style="width:100%">').prependTo("#statusPanel");

for(let i=0;i < status.length; i++){
statusSel.append($('<option value="'+status[i].val+'">' + status[i].text +'</option>'));
}

if(localStorage.getItem('lastStat')==null){
localStorage.setItem('lastStat',0);
}
let selStat=$('#selStat')[0];
selStat.value = localStorage.getItem('lastStat');

$("#togStats").click(function() {
localStorage.setItem('lastStat',selStat.value);
ToggleStats($('#selStat').val());
});

$('#addAll').click(function() {
AddAllStats(true);
});
$('#remAll').click(function() {
AddAllStats(false);
});
function GetCurStats(){
let self = $('.playerlist-name-self')[0];
let playerStats = self.nextElementSibling.childNodes[3].childNodes;
let curStats=[];
for(let i = 0;i< playerStats.length;i++){
curStats.push(allStats.indexOf(playerStats[i].className));
}
return curStats;
}

function AddAllStats(cond){
let curStats=GetCurStats();
for(let i=0;i<=4;i++){
if(curStats.includes(i)!=cond){
PLAYERFLAGS_INVENTORYOPEN=i;
$('.extmenu-button')[1].click();
$('.close')[6].click();
}
}
PLAYERFLAGS_INVENTORYOPEN=3;
}

function ToggleStats(statsNum){
PLAYERFLAGS_INVENTORYOPEN=statsNum;
$('.extmenu-button')[1].click();
$('.close')[6].click();
PLAYERFLAGS_INVENTORYOPEN=3;
}
}


//Star Bot
function AutoStar(){
$("#toolsPanel").append('<div id="autoStarPanel" style="margin-top:0.4rem; display: flex; flex-direction: column;"><button id="autoStar">Auto Star: Off</button></div>');

$('#autoStar').click(function() {
if( this.textContent=='Auto Star: On'){
this.textContent='Auto Star: Off';
}
else{
this.textContent='Auto Star: On';
$('.ratedrawerbox-button').click();
}
});

let questionMarkObserver = new MutationObserver(function(mutations) {
if($('#autoStar')[0].textContent=='Auto Star: On'){
$('.ratedrawerbox-button').click();
}
});
questionMarkObserver.observe($('#targetword')[0], {attributes: true, attributeFilter:['style']});
}




function RainbowBrush(){
$("#toolsPanel").append('<hr><div id="cFlowPanel" style="margin-top:0.4rem; display: flex; flex-direction: column;"><p style="font-weight:bold">Rainbow Brush</p><select id="selPallete"><input type="range" class="custom-range" id="rainbow" min="0" max="650" step="13" value="0"></div><hr>');

let colorList;
GetPalletes();

let checkPalletes = new MutationObserver(function(mutations) {

if($('#palettechooser')[0].display="none"){
$('#selPallete').empty();
GetPalletes();
}

});


checkPalletes.observe($('#palettechooser')[0], {attributes: true, attributeFilter:['style']});

function GetPalletes(){
let colorList=[];
for(let i=0;i < $('#palettechooser-list').children().length; i++){
for(let j=0;j<13;j++){
if(j==12){
colorList.push(chroma($('.palettechooser-row')[i].children[1].children[0].style.background).hex());

}else{
colorList.push(chroma($('.palettechooser-row')[i].children[1].children[j].style.background).hex());
}

}
console.log(colorList);

$('#selPallete').append($('<option value="'+colorList+'">' + $('.palettechooser-row')[i].children[0].textContent +'</option>'));
colorList=[];
}

}





let drawColor;
let rainbowIndex=0;


$("#selPallete").change(function() {
Asss();
});


$( "#rainbow" ).change(function() {
Asss();
});

function Asss(){
drawColor = chroma.scale($('#selPallete').val().split(',')).mode('lch').colors(document.getElementById("rainbow").value);
document.getElementsByClassName("drawcontrols-arrow")[0].style.background = drawColor[0];
rainbowIndex=0;
$(".drawcontrols-arrow")[0].click();
rainbowIndex=0;
colorList=[];
}


const canvas = $('#canvas');

canvas.mousedown(function () {
canvas.mousemove(function () {
if($("#rainbow")[0].value!="0" && $('.fa-pencil-alt')[0].parentNode.className.includes('drawcontrols-arrow')){
document.getElementsByClassName("drawcontrols-arrow")[0].style.background = drawColor[rainbowIndex];
document.getElementsByClassName("drawcontrols-arrow")[0].click();
rainbowIndex++;
if(rainbowIndex>drawColor.length){

rainbowIndex=0;
}
document.getElementsByClassName("pcr-app")[0].classList.remove("visible");
}
});
}).mouseup(function () {
canvas.unbind('mousemove');
});

}



//WordHints
function WordHints(){
(async () => {
'use strict';
const sendButton=document.getElementById('chatattop-sendbutton');
const inputChat = document.getElementById('chatbox_textinput');
const targetWord = document.getElementsByClassName("topbox-content-targetword")[1];
const rightbar = document.getElementById('rightbar');

const refreshDelay = 500;
let wordList;
let targetWordVal = '';
let assistantPanel;
let hintBox;

const hintClick = (event) => {
const inputChatVal = inputChat.value;
inputChat.value = event.target.innerHTML;
sendButton.click();
};

const assist = (event, wordChanged = false) => {
let wordRegex = targetWord.textContent.replace(/_/g, '[^ \-"]');
wordRegex = '"'.concat(wordRegex, '"');
wordRegex = new RegExp(wordRegex, 'g');

let hints = wordList.match(wordRegex);

if (!hints) {
hintBox.innerHTML = '<span style="color:#f85e15; font-weight:bold">Sorry, no hints available!</span>';
return;
} else {
hintBox.innerHTML = '<span style="color:green; font-weight:bold">Click on a hint to submit it: </span><br>';
}

hints = hints.map((hint) => {
return hint.substring(1, hint.length - 1);
});
hints = hints.sort((a, b) => {
return a.toLowerCase().localeCompare(b.toLowerCase());
});

const inputChatVal = inputChat.value;
const inputList = [];

hints.forEach((hint) => {

const hintSpan = document.createElement('a');
hintSpan.innerHTML = hint;
hintSpan.style.color = 'royalblue';
hintSpan.style.backgroundColor = "#FDFD8F";
hintSpan.href = 'javascript:void(0);';
hintSpan.onclick = hintClick;

if (!(inputChatVal && hint.toLowerCase().search(inputChatVal.toLowerCase()) !== -1 )) {
hintSpan.style.display= 'none';
inputList.push(hint);
}else{
hintBox.appendChild(hintSpan);
hintBox.appendChild(document.createTextNode(', '));
}
});
inputList.forEach((hint) => {
const hintSpan = document.createElement('a');
hintSpan.innerHTML = hint;
hintSpan.style.backgroundColor = 'none';
hintSpan.href = 'javascript:void(0);';
hintSpan.onclick = hintClick;
hintBox.appendChild(hintSpan);
hintBox.appendChild(document.createTextNode(', '));
});

hintBox.removeChild(hintBox.lastChild);

};


const initialize = async () => {
let lang = localStorage.getItem("gamelang");
if(lang=="en"){
wordList = "https://api.npoint.io/ad0f597d93f623b99fd1";
}else if(lang == "ru"){
wordList = "https://api.npoint.io/017ae94efe00bcf568c1";
}else if (lang == "es"){
wordList = "https://api.npoint.io/3fc68fb47446d51a7b67";
}

try {
wordList = await fetch(wordList).then((response) => response.json());
} catch (e) {
await new Promise((resolve) => setTimeout(resolve, refreshDelay));
return initialize();
}

wordList = JSON.stringify(wordList);

wordList = wordList.substring(1, wordList.length - 1);

assistantPanel = document.createElement('p');

assistantPanel.style = `
display: none;
background: rgb(238, 238, 238);
overflow-wrap: anywhere;
border-radius: 2px;
border: 4px solid rgb(238, 238, 238);
width: 100%;
height: 100%;
overflow-y: scroll;
color: rgb(57, 117, 206);
margin: 8px 0 0 0;


`;

hintBox = document.createElement('span');
assistantPanel.appendChild(hintBox);

rightbar.insertBefore(
assistantPanel,
rightbar.childNodes[3]
);

inputChat.onkeyup = assist;

setInterval(() => {

if(document.getElementById('targetword_tip').style.display == "none"){
assistantPanel.style.display = "none";
$("#toolsPanel").show();
}else{
assistantPanel.style.display = "";
$("#toolsPanel").hide();
}

if (
targetWord &&
targetWord.textContent.indexOf('_') !== -1
) {
if (targetWordVal !== targetWord.textContent) {
hintBox.style.display = '';
assist(undefined, true);
targetWordVal = targetWord.textContent;
}
} else {
hintBox.style.display = 'none';
targetWordVal = '';

}
}, refreshDelay);
};
initialize();
})();
}

});
let regexL = new RegExp('^r[0-9]{6}');
let regexC = new RegExp('^comment_[0-9]{5}')
let keys = Object.keys(localStorage);
for(let i=0; i < keys.length ;i++){
if(regexL.test(keys[i]) || regexC.test(keys[i])){
localStorage.removeItem(keys[i]);
}
}
})(window.jQuery.noConflict(true));



     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.