// ==UserScript==
// @name Miracle Scripts For cellcraft.io
// @namespace Miracle script, developed by mod's of cc...
// @version 5.1.2
// @description Best Cellcraft.io Script!
// @author Devadmin,vfamily,dexan,naath
// @license MIT
// @icon https://abload.de/img/mh3k8o.png
// @match https://cellcraft.io/
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'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(`
`);
$(".dash-tab-settings").click(function(e) {
$("#roleSettings").css("display", "block");
$("#cLinesplitOverlay").removeAttr("disabled").parent().parent().css("display", "block");
});
$(".hotkey-col").eq(1).append(`Linesplit overlay
`);
$("#roleSettings").append(` Linesplit overlay
`);
$("#cLinesplitOverlay").change(function(e) {
let enabled = $(this).is(':checked');
settings.set("enabled", enabled);
$("#linesplit_overlay").css("display", enabled ? "block" : "none");
});
if (settings.get('enabled')) $("#cLinesplitOverlay").attr("checked", "");
$("#keyLinesplitOverlay").html(KEY_TABLE[settings.get("binding")]);
$("#keyLinesplitOverlay").click(function(e) {
$(this).addClass("selected");
current_key = true;
});
$("#keyLinesplitOverlay").contextmenu(function(e) {
$(this).addClass("selected");
settings.set("binding", null);
$(this).html("");
setTimeout(() => {
$(this).removeClass("selected");
}, 50);
current_key = false;
return false;
});
$(window).keyup(function(e) {
if (e.keyCode == settings.get("binding")) {
$("#linesplit_overlay").css("display", settings.get("enabled") ? "block" : "none");
pressing = false;
}
});
$(window).keydown(function(e) {
if (current_key) {
$("#keyLinesplitOverlay").html(KEY_TABLE[e.keyCode]);
settings.set("binding", e.keyCode);
setTimeout(() => {
$("#keyLinesplitOverlay").removeClass("selected");
}, 50);
current_key = false;
} else {
if (e.keyCode == settings.get("binding") && document.activeElement == document.body) {
$("#linesplit_overlay").css("display", !settings.get("enabled") ? "block" : "none");
pressing = true;
}
}
});
$(window).resize(function(e) {
let [w, h] = [window.innerWidth, window.innerHeight];
$("#point-top").css("left", `${window.innerWidth / 2}px`).css("top", `${0}px`);
$("#point-right").css("left", `${window.innerWidth}px`).css("top", `${window.innerHeight / 2}px`);
$("#point-bottom").css("left", `${window.innerWidth / 2}px`).css("top", `${window.innerHeight}px`);
$("#point-left").css("left", `${0}px`).css("top", `${window.innerHeight / 2}px`);
});
swal({
title: "Welcome",
text: 'New Update linesplit overlays dot! put cursor to dot and do a perfect linesplit!. Write :miracle to show script!',
type: "warning",
showCancelButton: true,
confirmButtonColor: "#4CAF50",
confirmButtonText: "Continue",
cancelButtonText: "Close"
}, function() {
localStorage.setItem('miracleScripts', '');
swal({
title: "Success",
text: 'Your now able to write the command :miracle write in chat and it will show the script feature!.',
type: "success"
});
});
console.log('๐ธ Miracle Scripts Settings Resetter successfully loaded!');
window.miracleScripts = {
// News icon:
news: 'News! Admin is doing an update next week! Were expecting to be crafting as much people wanted that! Please Be Patient, More coming soon!.',
// Source: http://stackoverflow.com/questions/1772179/get-character-value-from-keycode-in-javascript-then-trim#answer-23377822
keyboardMap: [
'', // [0]
'', // [1]
'', // [2]
'CANCEL', // [3]
'', // [4]
'', // [5]
'HELP', // [6]
'', // [7]
'BACK_SPACE', // [8]
'TAB', // [9]
'', // [10]
'', // [11]
'CLEAR', // [12]
'ENTER', // [13]
'ENTER_SPECIAL', // [14]
'', // [15]
'SHIFT', // [16]
'CONTROL', // [17]
'ALT', // [18]
'PAUSE', // [19]
'CAPS_LOCK', // [20]
'KANA', // [21]
'EISU', // [22]
'JUNJA', // [23]
'FINAL', // [24]
'HANJA', // [25]
'', // [26]
'ESCAPE', // [27]
'CONVERT', // [28]
'NONCONVERT', // [29]
'ACCEPT', // [30]
'MODECHANGE', // [31]
'SPACE', // [32]
'PAGE_UP', // [33]
'PAGE_DOWN', // [34]
'END', // [35]
'HOME', // [36]
'LEFT', // [37]
'UP', // [38]
'RIGHT', // [39]
'DOWN', // [40]
'SELECT', // [41]
'PRINT', // [42]
'EXECUTE', // [43]
'PRINTSCREEN', // [44]
'INSERT', // [45]
'DELETE', // [46]
'', // [47]
'0', // [48]
'1', // [49]
'2', // [50]
'3', // [51]
'4', // [52]
'5', // [53]
'6', // [54]
'7', // [55]
'8', // [56]
'9', // [57]
'COLON', // [58]
'SEMICOLON', // [59]
'LESS_THAN', // [60]
'EQUALS', // [61]
'GREATER_THAN', // [62]
'QUESTION_MARK', // [63]
'AT', // [64]
'A', // [65]
'B', // [66]
'C', // [67]
'D', // [68]
'E', // [69]
'F', // [70]
'G', // [71]
'H', // [72]
'I', // [73]
'J', // [74]
'K', // [75]
'L', // [76]
'M', // [77]
'N', // [78]
'O', // [79]
'P', // [80]
'Q', // [81]
'R', // [82]
'S', // [83]
'T', // [84]
'U', // [85]
'V', // [86]
'W', // [87]
'X', // [88]
'Y', // [89]
'Z', // [90]
'OS_KEY', // [91] Windows Key (Windows) or Command Key (Mac)
'', // [92]
'CONTEXT_MENU', // [93]
'', // [94]
'SLEEP', // [95]
'NUMPAD0', // [96]
'NUMPAD1', // [97]
'NUMPAD2', // [98]
'NUMPAD3', // [99]
'NUMPAD4', // [100]
'NUMPAD5', // [101]
'NUMPAD6', // [102]
'NUMPAD7', // [103]
'NUMPAD8', // [104]
'NUMPAD9', // [105]
'MULTIPLY', // [106]
'ADD', // [107]
'SEPARATOR', // [108]
'SUBTRACT', // [109]
'DECIMAL', // [110]
'DIVIDE', // [111]
'F1', // [112]
'F2', // [113]
'F3', // [114]
'F4', // [115]
'F5', // [116]
'F6', // [117]
'F7', // [118]
'F8', // [119]
'F9', // [120]
'F10', // [121]
'F11', // [122]
'F12', // [123]
'F13', // [124]
'F14', // [125]
'F15', // [126]
'F16', // [127]
'F17', // [128]
'F18', // [129]
'F19', // [130]
'F20', // [131]
'F21', // [132]
'F22', // [133]
'F23', // [134]
'F24', // [135]
'', // [136]
'', // [137]
'', // [138]
'', // [139]
'', // [140]
'', // [141]
'', // [142]
'', // [143]
'NUM_LOCK', // [144]
'SCROLL_LOCK', // [145]
'WIN_OEM_FJ_JISHO', // [146]
'WIN_OEM_FJ_MASSHOU', // [147]
'WIN_OEM_FJ_TOUROKU', // [148]
'WIN_OEM_FJ_LOYA', // [149]
'WIN_OEM_FJ_ROYA', // [150]
'', // [151]
'', // [152]
'', // [153]
'', // [154]
'', // [155]
'', // [156]
'', // [157]
'', // [158]
'', // [159]
'CIRCUMFLEX', // [160]
'EXCLAMATION', // [161]
'DOUBLE_QUOTE', // [162]
'HASH', // [163]
'DOLLAR', // [164]
'PERCENT', // [165]
'AMPERSAND', // [166]
'UNDERSCORE', // [167]
'OPEN_PAREN', // [168]
'CLOSE_PAREN', // [169]
'ASTERISK', // [170]
'PLUS', // [171]
'PIPE', // [172]
'HYPHEN_MINUS', // [173]
'OPEN_CURLY_BRACKET', // [174]
'CLOSE_CURLY_BRACKET', // [175]
'TILDE', // [176]
'', // [177]
'', // [178]
'', // [179]
'', // [180]
'VOLUME_MUTE', // [181]
'VOLUME_DOWN', // [182]
'VOLUME_UP', // [183]
'', // [184]
'', // [185]
'SEMICOLON', // [186]
'EQUALS', // [187]
'COMMA', // [188]
'MINUS', // [189]
'PERIOD', // [190]
'SLASH', // [191]
'BACK_QUOTE', // [192]
'', // [193]
'', // [194]
'', // [195]
'', // [196]
'', // [197]
'', // [198]
'', // [199]
'', // [200]
'', // [201]
'', // [202]
'', // [203]
'', // [204]
'', // [205]
'', // [206]
'', // [207]
'', // [208]
'', // [209]
'', // [210]
'', // [211]
'', // [212]
'', // [213]
'', // [214]
'', // [215]
'', // [216]
'', // [217]
'', // [218]
'OPEN_BRACKET', // [219]
'BACK_SLASH', // [220]
'CLOSE_BRACKET', // [221]
'QUOTE', // [222]
'', // [223]
'META', // [224]
'ALTGR', // [225]
'', // [226]
'WIN_ICO_HELP', // [227]
'WIN_ICO_00', // [228]
'', // [229]
'WIN_ICO_CLEAR', // [230]
'', // [231]
'', // [232]
'WIN_OEM_RESET', // [233]
'WIN_OEM_JUMP', // [234]
'WIN_OEM_PA1', // [235]
'WIN_OEM_PA2', // [236]
'WIN_OEM_PA3', // [237]
'WIN_OEM_WSCTRL', // [238]
'WIN_OEM_CUSEL', // [239]
'WIN_OEM_ATTN', // [240]
'WIN_OEM_FINISH', // [241]
'WIN_OEM_COPY', // [242]
'WIN_OEM_AUTO', // [243]
'WIN_OEM_ENLW', // [244]
'WIN_OEM_BACKTAB', // [245]
'ATTN', // [246]
'CRSEL', // [247]
'EXSEL', // [248]
'EREOF', // [249]
'PLAY', // [250]
'ZOOM', // [251]
'', // [252]
'PA1', // [253]
'WIN_OEM_CLEAR', // [254]
'' // [255]
],
banned: ['idemon'],
watermark: 'โ',
// Don't remove the spaces, they are used as separators! Source: https://emojiterra.com/de/liste/
emojis: '๐ ๐ ๐ ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ โบ๏ธ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ถ ๐ ๐ ๐ฌ ๐ ๐ ๐ช ๐ด ๐ท ๐ต ๐ ๐ ๐ ๐ฎ ๐ฏ ๐ฒ ๐ณ ๐ฆ ๐ง ๐จ ๐ฐ ๐ฅ ๐ข ๐ญ ๐ฑ ๐ ๐ฃ ๐ ๐ ๐ฉ ๐ซ ๐ค ๐ก ๐ ๐ ๐ฟ ๐ ๐ฉ ๐น ๐บ ๐ป ๐ฝ ๐พ ๐บ ๐ธ ๐น ๐ป ๐ผ ๐ฝ ๐ ๐ฟ ๐พ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ โค๏ธ ๐ ๐ ๐ ๐ ๐ฏ ๐ข ๐ฅ ๐ซ ๐ฆ ๐จ ๐ฃ ๐ฌ ๐ญ ๐ค ๐ โ ๐ โ๏ธ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ โ ๐ ๐ ๐ ๐ ๐ ๐
๐ช ๐ ๐ ๐ ๐
๐ ๐ถ ๐ฆ ๐ง ๐ฑ ๐จ ๐ฉ ๐ด ๐ต ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ฎ ๐ ๐ท ๐ธ ๐ณ ๐ฒ ๐ฐ ๐ผ ๐
๐ ๐ ๐ถ ๐ ๐ ๐ฏ ๐ ๐ ๐ ๐ฃ ๐ ๐ด ๐ต ๐ ๐ญ ๐ซ ๐ฌ ๐ ๐ ๐ช ๐ค ๐ฅ ๐ฃ ๐ต ๐ ๐ถ ๐ ๐ฉ ๐บ ๐ฑ ๐ ๐ฏ ๐
๐ ๐ด ๐ ๐ฎ ๐ ๐ ๐ ๐ท ๐ ๐ ๐ฝ ๐ ๐ ๐ ๐ช ๐ซ ๐ ๐ญ ๐ ๐ ๐น ๐ฐ ๐ ๐ป ๐จ ๐ผ ๐พ ๐ ๐ ๐ฃ ๐ค ๐ฅ ๐ฆ ๐ง ๐ธ ๐ ๐ข ๐ ๐ฒ ๐ ๐ณ ๐ ๐ฌ ๐ ๐ ๐ก ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ธ ๐ฎ ๐น ๐บ ๐ป ๐ผ ๐ท ๐ฑ ๐ฒ ๐ณ ๐ด ๐ต ๐พ ๐ฟ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
๐ ๐ฝ ๐ ๐ฐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ณ ๐ฒ ๐ฑ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ข ๐ฃ ๐ค ๐ฅ ๐ก ๐ฆ ๐ง ๐จ ๐ฉ ๐ช ๐ ๐ฐ ๐ซ ๐ฌ ๐ญ ๐ฎ ๐ฏ ๐ผ โ ๐ต ๐ถ ๐ท ๐ธ ๐น ๐บ ๐ป ๐ด ๐ช ๐ ๐ ๐ ๐ ๐พ ๐ ๐ป ๐ ๐ก ๐ข ๐ฃ ๐ค ๐ฅ ๐ฆ ๐จ ๐ฉ ๐ช ๐ซ ๐ฌ ๐ญ ๐ฏ ๐ฐ ๐ ๐ผ ๐ฝ โช โฒ โบ ๐ ๐ ๐ ๐
๐ ๐ ๐ โจ๏ธ ๐ ๐ก ๐ข ๐ ๐ช ๐ ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฒ ๐ โฝ ๐จ ๐ฅ ๐ฆ ๐ง โ โต ๐ค ๐ข โ๏ธ ๐บ ๐ ๐ ๐ ๐ก ๐ โ โณ โ โฐ ๐ ๐ง ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ก ๐ ๐ข ๐ ๐ฃ ๐ ๐ค ๐ ๐ฅ ๐ ๐ฆ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ โญ ๐ ๐ ๐ โ๏ธ โ
๐ ๐ ๐ โ โก โ๏ธ โ ๐ฅ ๐ง ๐ ๐ ๐ ๐ ๐ โจ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ซ ๐ โฝ โพ ๐ ๐ ๐ ๐พ ๐ณ โณ ๐ฃ ๐ฝ ๐ฟ ๐ฏ ๐ฑ ๐ฎ ๐ฎ ๐ฐ ๐ฒ โ ๏ธ โฅ๏ธ โฆ๏ธ โฃ๏ธ ๐ ๐ ๐ด ๐ญ ๐จ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ก ๐ข ๐ ๐ ๐ฉ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ข ๐ฃ ๐ฏ ๐ ๐ ๐ผ ๐ต ๐ถ ๐ค ๐ง ๐ป ๐ท ๐ธ ๐น ๐บ ๐ป ๐ฑ ๐ฒ โ๏ธ ๐ ๐ ๐ ๐ ๐ ๐ป ๐ฝ ๐พ ๐ฟ ๐ ๐ฅ ๐ฌ ๐บ ๐ท ๐น ๐ผ ๐ ๐ ๐ก ๐ฆ ๐ฎ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฐ ๐ ๐ ๐ฐ ๐ด ๐ต ๐ถ ๐ท ๐ธ ๐ณ ๐น ๐ฑ ๐ฒ โ๏ธ ๐ง ๐จ ๐ฉ ๐ค ๐ฅ ๐ฆ ๐ซ ๐ช ๐ฌ ๐ญ ๐ฎ โ๏ธ โ๏ธ ๐ ๐ผ ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ ๐ ๐ ๐ ๐จ ๐ซ ๐ง ๐ฉ ๐ ๐ฌ ๐ญ ๐ก ๐ ๐ ๐ช ๐ฝ ๐ฟ ๐ ๐ฌ ๐ฟ ๐ง ๐ฎ ๐ฐ โฟ ๐น ๐บ ๐ป ๐ผ ๐พ ๐ ๐ ๐ ๐
โ ๏ธ ๐ธ โ ๐ซ ๐ณ ๐ญ ๐ฏ ๐ฑ ๐ท ๐ต ๐ โฌ๏ธ โ๏ธ โก๏ธ โ๏ธ โฌ๏ธ โ๏ธ โฌ
๏ธ โ๏ธ โ๏ธ โ๏ธ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฏ โ โ โ โ โ โ โ โ โ โ โ โ โ ๐ ๐ ๐ โถ๏ธ โ๏ธ ๐ผ ๐ฝ ๐ฆ ๐ถ ๐ณ ๐ด โป๏ธ ๐ฑ ๐ ๐ฐ โญ โ
โ๏ธ โ๏ธ โ โ โ โ โ โฐ โฟ ใฝ๏ธ โณ๏ธ โด๏ธ โ๏ธ โผ๏ธ โ๏ธ โ โ โ โ ใฐ๏ธ ยฉ๏ธ ยฎ๏ธ โข๏ธ ๐ ๐ก ๐ข ๐ฃ ๐ค ๐
ฐ๏ธ ๐ ๐
ฑ๏ธ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ ๐
พ๏ธ ๐ ๐
ฟ๏ธ ๐ ๐ ๐ ๐ ๐๏ธ ๐ท๏ธ ๐ถ ๐ฏ ๐ ๐น ๐ ๐ฒ ๐ ๐ธ ๐ด ๐ณ ใ๏ธ ใ๏ธ ๐บ ๐ต ๐ด ๐ต โซ โช โฌ โฌ โผ๏ธ โป๏ธ โพ โฝ โช๏ธ โซ๏ธ ๐ถ ๐ท ๐ธ ๐น ๐บ ๐ป ๐ ๐ ๐ณ ๐ฒ ๐ ๐ฉ ๐',
settings: null,
hotkeys: null,
mouse : {
x: 0,
y: 0,
lastMovedAt: null,
},
init: function() {
var self = this;
this.setupPolyfills();
this.hotkeys = JSON.parse(localStorage.getItem('hotkeys'));
this.auth();
this.config();
this.originalDrawImage = CanvasRenderingContext2D.prototype.drawImage;
CanvasRenderingContext2D.prototype.drawImage = this.drawImage;
document.querySelector('body').addEventListener('mousemove', function(event) {
self.mouse.x = event.clientX;
self.mouse.y = event.clientY;
self.mouse.lastMovedAt = Date.now();
});
this.moveRespawnBtn();
this.players();
this.animation();
this.chatLog();
this.halt();
this.dance();
this.favSkins();
this.paste();
this.replacements();
this.fpsPing();
this.timer();
this.alive();
this.skinChanger();
this.skinApplier();
this.nameCopier();
this.ultraSplit();
this.lineSplit();
this.waste();
this.guessing();
this.nameColor();
this.wearablesToggle();
this.keyboardLayout();
this.help();
this.commands();
console.log('๐ธ Miracle Scripts successfully loaded!');
},
config: function() {
var self = this;
var settings = null;
var loadSettings = function (stringifiedSettings) {
var defaultSettings = {
// To get keycodes: https://keycode.info
bindings: {
ultraSplit: 85, // U
wearables: 36, // POS1
animation: 17, // CTRL
paste: 33, // PAGE UP
dance: 34, // PAGE DOWN,
halt: 72, // H,
chatLog: 76, // L
skin1: 49, // 1
skin2: 50, // 2
skin3: 51, // 3
skin4: 52, // 4
skin5: 53, // 5
skin6: 54, // 6
skin7: 55, // 7
skin8: 56, // 8
skin9: 57, // 9
},
replacements: ":D|:smile:\n:*(|:sob:\n:'D|:sweat_smile:\nxD|:joy:\nmiracle|uses ๐๐ช๐ณ๐ข๐ค๐ญ๐ฆ ๐๐ค๐ณ๐ช๐ฑ๐ต,Install script from ๐๐ณ๐ฆ๐ข๐ด๐บ๐ง๐ฐ๐ณ๐ฌ.๐ฐ๐ณ๐จ/scripts/417832!",
primaryColor: '#f9138b',
targetLanguage: 'en',
favSkins: [],
quickSkins: [],
players: [],
showClock: true,
changeKeyboardLayout: false,
};
if (stringifiedSettings == null || stringifiedSettings == undefined || stringifiedSettings === '') {
settings = defaultSettings;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
} else {
settings = JSON.parse(stringifiedSettings);
if (settings === null || Object.getOwnPropertyNames(settings).length == 0) {
settings = defaultSettings;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
// Update for settings:
if (typeof settings.primaryColor === 'undefined') {
settings.primaryColor = defaultSettings.primaryColor;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.bindings.chatLog === 'undefined') {
settings.bindings.chatLog = defaultSettings.bindings.chatLog;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.favSkins === 'undefined') {
settings.favSkins = defaultSettings.favSkins;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.targetLanguage === 'undefined') {
settings.targetLanguage = defaultSettings.targetLanguage;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.quickSkins === 'undefined') {
settings.quickSkins = [];
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.installedVersion === 'undefined') {
settings.installedVersion = 1;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.players === 'undefined') {
settings.players = [];
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.bindings.skin1 === 'undefined') {
settings.bindings.skin1 = defaultSettings.bindings.skin1;
settings.bindings.skin2 = defaultSettings.bindings.skin2;
settings.bindings.skin3 = defaultSettings.bindings.skin3;
settings.bindings.skin4 = defaultSettings.bindings.skin4;
settings.bindings.skin5 = defaultSettings.bindings.skin6;
settings.bindings.skin6 = defaultSettings.bindings.skin6;
settings.bindings.skin7 = defaultSettings.bindings.skin7;
settings.bindings.skin8 = defaultSettings.bindings.skin8;
settings.bindings.skin9 = defaultSettings.bindings.skin9;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.showClock === 'undefined') {
settings.showClock = false;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.showKeyboardLayout === 'undefined') {
settings.showKeyboardLayout = false;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.bindings.ultraSplit === 'undefined') {
settings.bindings.ultraSplit = 85;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.bindings.wearables === 'undefined') {
settings.bindings.wearables = 36;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
if (typeof settings.bindings.halt === 'undefined') {
settings.bindings.halt = defaultSettings.bindings.halt;
localStorage.setItem('miracleScripts', JSON.stringify(settings));
}
}
self.settings = settings;
};
loadSettings(localStorage.getItem('miracleScripts'));
if (settings.installedVersion < this.getVersionAsInt()) {
if (settings.installedVersion > 1) { // We do not want to inform new scripts user of past updates
if (settings.installedVersion < this.getVersionAsInt('2.4.3')) {
window.alert('๐ข Miracle Scripts Update: \n\n' +
'As of version 2.4.3 the nickname color change feature has been removed ' +
'according to an official decision of the Agma team.\n\n' +
'To avoid trouble for its users Miracle Scripts respects this decision. ' +
'Therefore Miracle Scripts is a legit extension for Agma and using it is safe.'
);
}
if (settings.installedVersion < this.getVersionAsInt('2.5.6')) {
self.swal(
'Miracle Scripts Update',
'You may now use 20 slots for skins (previously: 15). Type /skin16 - /skin20 in the chat box!');
}
if (settings.installedVersion < this.getVersionAsInt('2.5.8')) {
self.swal(
'Miracle Scripts Update',
'New: You may now assign aliases and notes to players. The alias will be displayed in the friends list. To add an alias right click on a player\'s name in the chat or a cell and then click on "Show profile".');
}
if (settings.installedVersion < this.getVersionAsInt('2.6.0')) {
self.swal(
'Miracle Scripts Update',
'New: You may now bind keys to skin slots. Per default the keys 1 - 9 are bound to /skin1 - /skin9 .');
}
if (settings.installedVersion < this.getVersionAsInt('2.6.1')) {
self.swal(
'Miracle Scripts Update',
'New: Right click on a cell. Then click on Use Player\'s Wearables to use the same wearables as that player. (Of course you have to own the wearables.)');
}
if (settings.installedVersion < this.getVersionAsInt('2.6.4')) {
self.swal(
'Miracle Scripts Update',
'New: Want to see how late it is? Activate the clock in the settings!');
}
if (settings.installedVersion < this.getVersionAsInt('3.0.0')) {
self.swal(
'Miracle Scripts Update',
'ATTENTION! This script won\'t get any new features! The Agma staff keeps making new restrictions to this script, so there is no point to continue development. With this update, the /say command has been removed, as the Agma staff enforced this.');
}
if (settings.installedVersion < this.getVersionAsInt('3.1.3')) {
self.swal(
'Miracle Scripts Update',
'Just a friendly hint: Agma has a new powerup! It\'s called "Tactical Nuke" and can be found in the shop. Attention: It\'s the first of April ๐');
}
if (settings.installedVersion < this.getVersionAsInt('3.1.6')) {
self.swal(
'Miracle Scripts Update',
'New: Type /players in the chat to see how many players are online in Agma!');
}
if (settings.installedVersion < this.getVersionAsInt('3.3.0')) {
self.swal(
'Miracle Scripts Update',
'New: You may now see your keyboard layout as an overlay! Go to the settings to activate it.');
}
if (settings.installedVersion < this.getVersionAsInt('3.4.0')) {
self.swal(
'Miracle Scripts Update',
'New: ULTRA split! Press U to make an ultra split, which can split 1 cell to 64!! (The server has to support that!)');
}
if (settings.installedVersion < this.getVersionAsInt('3.6.0')) {
self.swal(
'Miracle Scripts Update',
'New: Toggle "wearables on/off" with a key! Default is POS1!');
}
if (settings.installedVersion < this.getVersionAsInt('4.0.0')) {
self.swal(
'Miracle Scripts Update',
'New: Type /guess to start a little guessing game in the chat! ๐ก Note that it only works with browsers that can display emojis.');
}
if (settings.installedVersion < this.getVersionAsInt('4.2.2')) {
self.swal(
'Miracle Scripts Update',
'New: Right click on a player to copy the player\'s name to the chat! (PS: You cannot use the name as your own name though!)');
}
if (settings.installedVersion < this.getVersionAsInt('4.3.2')) {
self.swal(
'Miracle Scripts Announcement',
'Prepare for some insane new Miracle features! This time it will be mind-blowing. To be released soon.');
}
if (settings.installedVersion < this.getVersionAsInt('5.0.2')) {
window.swal({
title: 'Miracle Scripts Update',
text: 'Today we released a great new feature to celebrate Miracle\'s 1 year anniversary :Free self-freezing ! ' +
'VIDEO ' +
' Press H to use it!',
html: true
});
}
if (settings.installedVersion < this.getVersionAsInt('5.0.6')) {
self.swal(
'Miracle Scripts Update',
'New: Anti-AFK! Doubling the countdown time till you get disconnected for being AFK from 5 to 10 minutes!!!');
}
}
settings.installedVersion = this.getVersionAsInt();
localStorage.setItem('miracleScripts', JSON.stringify(settings));
self.settings = settings;
}
var defaultNews = 'Looking for a content manager for agma.io instagram. Apply here';
var $newsElement = $('#cnt_panel .navbar p.text-center');
if ($newsElement.text().trim() === defaultNews) {
$newsElement.css('margin-bottom', '20px');
$newsElement.css('padding', '10px');
$newsElement.css('background-color', 'rgba(0, 0, 0, 0.5)');
$newsElement.html(self.news);
var $metaElement = $('AGMA News
');
$newsElement.parent().prepend($metaElement);
$metaElement.css('background-color', '#B5B9C0');
$metaElement.css('color', 'black');
}
var applyPrimaryColor = function () {
var primaryColorCss = '.miracle-primary-color-font { color: ' + self.settings.primaryColor + ' !important } .miracle-primary-color-background { background-color: ' + self.settings.primaryColor + ' !important }; ';
$('body').append('');
};
applyPrimaryColor();
// General fix for the size of the FontAwesome Icons in the context menu
$('body').append('');
// We need to have a delay, because the menu is not loaded right away
setTimeout(function () {
var $playButton = $('#playBtn');
var $specateButton = $('#spectateBtn');
$playButton.get(0).style.width = '40%';
$specateButton.get(0).style.width = '40%';
var $settingsButton = $('๐ ');
$settingsButton.insertAfter($specateButton);
var changeKey = function (event) {
var name = this.name.substr(4);
$(this).val(self.keyboardMap[event.keyCode]);
self.settings.bindings[name] = event.keyCode;
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
var deleteKey = function () {
var action = $(this).attr('data-action');
$('#miracle-settings input[name=key_' + action + ']').val('undefined');
self.settings.bindings[action] = null;
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
// Weird Agma scripting... press enter in the replacements textarea and the chat box gets focused!
// Therefore catch the keydown event (that happens earlier) and insert the linebreak manually,
// focus again (delayed) and go to the end of the text where the linebreak is.
// We can improve this later on...
var addReturn = function (event) {
if (event.keyCode === 13) {
var textarea = this;
$(textarea).text($(this).text() + '\n').focus();
setTimeout(function () {
$(textarea).focus();
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
}, 1);
}
};
var changeReplacements = function () {
self.settings.replacements = $(this).val();
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
var changePrimaryColor = function () {
self.settings.primaryColor = $(this).val();
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
applyPrimaryColor();
};
var changeTargetLanguage = function () {
self.settings.targetLanguage = $(this).val();
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
var changeClock = function() {
self.settings.showClock = $(this).is(':checked');
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
var changeKeyboardLayout = function() {
self.settings.showKeyboardLayout = $(this).is(':checked');
localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
};
var $modal = $('
');
$modal.append('Miracle Scripts For cellcraft.io ');
if (GM_info) {
$modal.append('Version ' + GM_info.script.version + ' ');
}
var $firstRow = $('');
var $secRow = $(' ');
var $thirdRow = $(' ');
var $element = $(' ').keyup(changeKey);
$firstRow.append(' Ultra-Split-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$firstRow.append(' Animation-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$firstRow.append(' Paste-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$firstRow.append(' Dance-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$firstRow.append(' Halt-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$firstRow.append(' Chat-Log-Key: ', $element);
$element = $('โ ').click(deleteKey);
$firstRow.append($element);
$element = $(' ').keyup(changeKey);
$secRow.append(' Use-First-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$secRow.append($element);
$element = $(' ').keyup(changeKey);
$secRow.append(' Use-Second-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$secRow.append($element);
$element = $(' ').keyup(changeKey);
$secRow.append(' Use-Third-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$secRow.append($element);
$element = $(' ').keyup(changeKey);
$secRow.append(' Use-Fourth-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$secRow.append($element);
$element = $(' ').keyup(changeKey);
$secRow.append(' Use-Fifth-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$secRow.append($element);
$element = $(' ').keyup(changeKey);
$thirdRow.append(' Use-Sixth-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$thirdRow.append($element);
$element = $(' ').keyup(changeKey);
$thirdRow.append(' Use-Seventh-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$thirdRow.append($element);
$element = $(' ').keyup(changeKey);
$thirdRow.append(' Use-Eighth-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$thirdRow.append($element);
$element = $(' ').keyup(changeKey);
$thirdRow.append(' Use-Ninth-Skin-Key: ', $element);
$element = $('โ ').click(deleteKey);
$thirdRow.append($element);
$element = $(' ').keyup(changeKey);
$thirdRow.append(' Toggle-Wearables-Key: ', $element);
$element = $('โ ').click(deleteKey);
$thirdRow.append($element);
var $table = $('