// ==UserScript== // @name Cellcraft.io Best Linesplit // @namespace This Script helps you make a good straight linesplit // @version 1.1 // @description Linescript overlay for cellcraft.io by Cellcraft.io Mod's // @author Mod's Of cellcraft.io // @match https://cellcraft.io/ // @grant none // @downloadURL https://update.greasyfork.icu/scripts/418159/Cellcraftio%20Best%20Linesplit.user.js // @updateURL https://update.greasyfork.icu/scripts/418159/Cellcraftio%20Best%20Linesplit.meta.js // ==/UserScript== 'use strict'; let $ = window.$; const KEY_TABLE = { 0: "", 8: "BACKSPACE", 9: "TAB", 12: "CLEAR", 13: "ENTER", 16: "SHIFT", 17: "CTRL", 18: "ALT", 19: "PAUSE", 20: "CAPSLOCK", 27: "ESC", 32: "SPACE", 33: "PAGEUP", 34: "PAGEDOWN", 35: "END", 36: "HOME", 37: "LEFT", 38: "UP", 39: "RIGHT", 40: "DOWN", 44: "PRTSCN", 45: "INS", 46: "DEL", 65: "A", 66: "B", 67: "C", 68: "D", 69: "E", 70: "F", 71: "G", 72: "H", 73: "I", 74: "J", 75: "K", 76: "L", 77: "M", 78: "N", 79: "O", 80: "P", 81: "Q", 82: "R", 83: "S", 84: "T", 85: "U", 86: "V", 87: "W", 88: "X", 89: "Y", 90: "Z", 91: "WIN", 92: "WIN", 93: "CONTEXTMENU", 96: "NUM 0", 97: "NUM 1", 98: "NUM 2", 99: "NUM 3", 100: "NUM 4", 101: "NUM 5", 102: "NUM 6", 103: "NUM 7", 104: "NUM 8", 105: "NUM 9", 106: "NUM *", 107: "NUM +", 109: "NUM -", 110: "NUM .", 111: "NUM /", 144: "NUMLOCK", 145: "SCROLLLOCK" }; class Settings { constructor(name, default_value) { this.settings = {}; this.name = name; this.load(default_value); } load(default_value) { let raw_settings = localStorage.getItem(this.name); this.settings = Object.assign({}, default_value, this.settings, JSON.parse(raw_settings)); } save() { localStorage.setItem(this.name, JSON.stringify(this.settings)); } set(key, value) { if (value === undefined) { this.settings = key; } else { this.settings[key] = value; } this.save(); } get(key) { if (key === undefined) { return this.settings; } else { return this.settings[key]; } } } let settings = new Settings("linesplit_overlay", { enabled: true, binding: null }); let current_key = false, pressing = false; $("head").append(``); let [w, h] = [, window.innerHeight]; $("body").append(`