Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Help:
- // Shift + Left Arrow - Reverse String
- // Shift + F2 - String to Hex
- // Shift + F4 - Hex to String
- // This made by Nurutomo
- // Discord @Nurutomo #6541
- // Version 0.8
- // Chat text reverser
- setTimeout(function () {
- OWOP.chat.local('Chat tools by Nurutomo Activated!');
- },3000);
- chatinput = document.getElementById('chat-input');
- chatinput.addEventListener("keydown", function (event) {
- var keyCode = event.which || event.keyCode;
- switch (keyCode) {
- case 37:
- // Left Arrow
- if (event.shiftKey) {
- chatinput.value = reverseString(chatinput.value);
- }
- break;
- case 113:
- // F2 Key
- if (event.shiftKey) {
- chatinput.value = stringToHex(chatinput.value);
- }
- break;
- case 115:
- // F4 Key
- if (event.shiftKey) {
- chatinput.value = hexToString(chatinput.value);
- }
- break;
- }
- });
- // Found on Internet
- function reverseString(str) {
- return str.split("").reverse().join("");
- }
- // By Kit
- // Convert String to Hex
- function stringToHex(str) {
- return str.split("").map(c => ("00"+c.charCodeAt(0).toString(16)).substr(-2)).join("").toUpperCase();
- }
- // Convert Hex to String
- function hexToString(str) {
- return str.match(/[a-f0-9]{2}/gi).map(x => String.fromCharCode(parseInt(x, 16))).join("");
- }
- /* Userscript is still BETA! */
- // ==UserScript==
- // @name OWOP Chat Tools by Nurutomo v0.8
- // @version 0.8
- // @description With this you can reverse, hex to string, and others
- // @copyright 2018,Nurutomo
- // @author Nurutomo
- // @homepage https://pastebin.com/cCv4pSXM
- // updateURL https://pastebin.com/raw/cCv4pSXM
- // downloadURL https://pastebin.com/raw/cCv4pSXM
- // @updateURL https://pastebin.com/raw/cCv4pSXM
- // @downloadURL https://pastebin.com/raw/cCv4pSXM
- // @connect ourworldofpixels.com/*
- // @match ourworldofpixels.com/*
- // ==/UserScript==
- /* Userscript is still BETA! */
Advertisement
Add Comment
Please, Sign In to add comment