Miracle Scripts For cellcraft.io

Best Cellcraft.io Script!

  1. // ==UserScript==
  2. // @name Miracle Scripts For cellcraft.io
  3. // @namespace Miracle script, developed by mod's of cc...
  4. // @version 5.2.3
  5. // @description Best Cellcraft.io Script!
  6. // @author DevAdmin,Dexan,Samira
  7. // @license MIT
  8. // @icon data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxASEhUREhAWEBUVEhUQFhUWGBYWGhgVFxYXGBcWFRgYHCggGBonHRYWITEjJSkrLy4uFyEzODMtNyotLisBCgoKDg0OGhAQGyslICYxLS8wLS0rLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOEA4QMBEQACEQEDEQH/xAAcAAEAAQUBAQAAAAAAAAAAAAAABwECBQYIBAP/xABIEAABAwIDAwYIDQMDAwUAAAABAAIDBBEFEiEGBzETIkFRYbIUMjNCcXKBgiM1UlRzdJGSk6GxwtIWwfAVY6Jig+EkJURT0f/EABoBAQACAwEAAAAAAAAAAAAAAAAEBQECAwb/xAAwEQACAQIEBAQGAgMBAAAAAAAAAQIDEQQSMUEFEyFRMmFxgSI0QpGx8FKhFMHRM//aAAwDAQACEQMRAD8AnFAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAUKAgHeBsZiFPLNVAmWB8sk2aNziYw5xdaRvEWvxFxpxCiVISTuehwWKoTioNWfnuaOZ36c933iuN2WahD+KLfCH/Ld94pdjlw7IeEP+W77xS7HLh2Q8If8t33il2OXDsh4Q/5bvvFLscuHZHuwqhqqmVsEAfK93QCdB0lxJs1o6ysxUpOyOVWVGlHNNIn3drs3UUFM+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aGRxtjYL2axoa0XNzYDQaklbWNG23dn2QwEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEBj3Yi7UCIm2nHpvlA4fKuPZdQni31WR9P3t3O3KXcqzESSBkIB1BPDKdQTppoHH2dqzHFtySy6/vYw6VlqUOIHnANBsXDj8nPx00PM4dqf5Td0l3/q/l5GeWt2VfXuHmgDXiT/126NPF/NJYmS2/evl5GFTT3LGYi4+aNXNFgbkDS+nSOIv12WqxcnsZdJLcf6k62bJ+YtwB1d0dXpWP8yVr5f39/szyle1w7EXC92A62Avbpfxv6o9pWXi5LWP9+o5S7n1ZWnNlLQ0HNrfoBd0W/6fzXSOIeZJq36zR0+l7lv+oHXmDS5OvC3QdND1joutf8l9v37GeX5nppps7b8NSNDfgSND7FIpTzxzGko5XY+y6GoQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAWtaBw06ft1KwkloC5ZAQBAEAQFr2gixFwVhpNWYDGACwFgsRikrIFy2AQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAf//Z
  9. // @match https://cellcraft.io/
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.  
  15. 'use strict';
  16.  
  17. let $ = window.$;
  18. 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" };
  19. class Settings {
  20. constructor(name, default_value) {
  21. this.settings = {};
  22. this.name = name;
  23. this.load(default_value);
  24. }
  25. load(default_value) {
  26. let raw_settings = localStorage.getItem(this.name);
  27. this.settings = Object.assign({}, default_value, this.settings, JSON.parse(raw_settings));
  28. }
  29. save() {
  30. localStorage.setItem(this.name, JSON.stringify(this.settings));
  31. }
  32. set(key, value) {
  33. if (value === undefined) {
  34. this.settings = key;
  35. } else {
  36. this.settings[key] = value;
  37. }
  38. this.save();
  39. }
  40. get(key) {
  41. if (key === undefined) {
  42. return this.settings;
  43. } else {
  44. return this.settings[key];
  45. }
  46. }
  47. }
  48.  
  49. let settings = new Settings("linesplit_overlay", {
  50. enabled: true,
  51. binding: null
  52. });
  53. let current_key = false, pressing = false;
  54.  
  55. $("head").append(`<style>
  56. .hotkey-input-2.selected {
  57. background-color: #ff4;
  58. color: #444;
  59. }
  60. .hotkey-input-2:hover:not(.selected) {
  61. background-color: #f1a02d;
  62. }
  63. .hotkey-input-2 {
  64. background-color: #df901c;
  65. color: #fff;
  66. cursor: pointer;
  67. text-align: center;
  68. min-width: 40px;
  69. max-width: 60px;
  70. height: 18px;
  71. line-height: 18px;
  72. vertical-align: middle;
  73. border-radius: 9px;
  74. right: 5px;
  75. position: absolute;
  76. display: inline-block;
  77. padding: 0 5px;
  78. overflow: hidden;
  79. opacity: 1;
  80. }
  81. </style>`);
  82.  
  83. let [w, h] = [, window.innerHeight];
  84. $("body").append(`<div id="linesplit_overlay" style="z-index: 9999;display:${settings.get("enabled") ? "block" : "none"}">
  85. <div id="point-top" style="border: 2px solid white; border-radius: 55%; width: 10px; height: 10px; position: fixed; left: ${window.innerWidth / 2}px; top: ${0}px; transform: translate(-50%, -50%);"></div>
  86. <div id="point-right" style="border: 2px solid white; border-radius: 55%; width: 10px; height: 10px; position: fixed; left: ${window.innerWidth}px; top: ${window.innerHeight / 2}px; transform: translate(-50%, -50%);"></div>
  87. <div id="point-bottom" style="border: 2px solid white; border-radius: 55%; width: 10px; height: 10px; position: fixed; left: ${window.innerWidth / 2}px; top: ${window.innerHeight}px; transform: translate(-50%, -50%);"></div>
  88. <div id="point-left" style="border: 2px solid white; border-radius: 55%; width: 10px; height: 10px; position: fixed; left: ${0}px; top: ${window.innerHeight / 2}px; transform: translate(-50%, -50%);"></div>
  89. </div>`);
  90.  
  91. $(".dash-tab-settings").click(function(e) {
  92. $("#roleSettings").css("display", "block");
  93. $("#cLinesplitOverlay").removeAttr("disabled").parent().parent().css("display", "block");
  94. });
  95.  
  96. $(".hotkey-col").eq(1).append(`Linesplit overlay <div id="keyLinesplitOverlay" class="hotkey-input-2"></div><br>`);
  97. $("#roleSettings").append(`<div class="role-setting"><label><input id="cLinesplitOverlay" type="checkbox"}><span> Linesplit overlay</span></label><br></div>`);
  98.  
  99. $("#cLinesplitOverlay").change(function(e) {
  100. let enabled = $(this).is(':checked');
  101. settings.set("enabled", enabled);
  102. $("#linesplit_overlay").css("display", enabled ? "block" : "none");
  103. });
  104.  
  105. if (settings.get('enabled')) $("#cLinesplitOverlay").attr("checked", "");
  106.  
  107. $("#keyLinesplitOverlay").html(KEY_TABLE[settings.get("binding")]);
  108.  
  109. $("#keyLinesplitOverlay").click(function(e) {
  110. $(this).addClass("selected");
  111. current_key = true;
  112. });
  113.  
  114. $("#keyLinesplitOverlay").contextmenu(function(e) {
  115. $(this).addClass("selected");
  116. settings.set("binding", null);
  117. $(this).html("");
  118. setTimeout(() => {
  119. $(this).removeClass("selected");
  120. }, 50);
  121. current_key = false;
  122. return false;
  123. });
  124.  
  125. $(window).keyup(function(e) {
  126. if (e.keyCode == settings.get("binding")) {
  127. $("#linesplit_overlay").css("display", settings.get("enabled") ? "block" : "none");
  128. pressing = false;
  129. }
  130. });
  131.  
  132. $(window).keydown(function(e) {
  133. if (current_key) {
  134. $("#keyLinesplitOverlay").html(KEY_TABLE[e.keyCode]);
  135. settings.set("binding", e.keyCode);
  136. setTimeout(() => {
  137. $("#keyLinesplitOverlay").removeClass("selected");
  138. }, 50);
  139. current_key = false;
  140. } else {
  141. if (e.keyCode == settings.get("binding") && document.activeElement == document.body) {
  142. $("#linesplit_overlay").css("display", !settings.get("enabled") ? "block" : "none");
  143. pressing = true;
  144. }
  145. }
  146. });
  147.  
  148. $(window).resize(function(e) {
  149. let [w, h] = [window.innerWidth, window.innerHeight];
  150. $("#point-top").css("left", `${window.innerWidth / 2}px`).css("top", `${0}px`);
  151. $("#point-right").css("left", `${window.innerWidth}px`).css("top", `${window.innerHeight / 2}px`);
  152. $("#point-bottom").css("left", `${window.innerWidth / 2}px`).css("top", `${window.innerHeight}px`);
  153. $("#point-left").css("left", `${0}px`).css("top", `${window.innerHeight / 2}px`);
  154. });
  155.  
  156. swal({
  157. title: "Happy New Year!🥳!",
  158. text: "Happy New Year Cellcraft.io Community, we hope to make few more updates soon! We love ya guys! <3",
  159. icon: "success",
  160. button: "Thx",
  161. }, function() {
  162.  
  163. localStorage.setItem('miracleScripts', '');
  164.  
  165. swal({
  166. title: "We love ya!",
  167. text: 'Thank you for playing cellcraft.io new updates coming soon!',
  168. type: "success"
  169. });
  170. });
  171.  
  172. var input = $("#chtbox");
  173. var inputVal = input.val();
  174. var prefix = "/";
  175.  
  176. input.on("keydown", function (e) {
  177.  
  178. function announce(arg1, arg2) {
  179. var result;
  180. if (arg2 === true) {
  181. result = 'enabled';
  182. } else if (arg2 === false) {
  183. result = 'disabled';
  184. }
  185. if (result === 'enabled') {
  186. $("#curser").fadeIn().text('The setting "'+arg1+'" is now '+result+'!').css({color: '#00c000'});
  187. } else if (result === 'disabled') {
  188. $("#curser").fadeIn().text('The setting "'+arg1+'" is now '+result+'!').css({color: '#ff0000'});
  189. }
  190.  
  191. setTimeout(function() {
  192. $("#curser").fadeOut();
  193. }, 4000);
  194. }
  195.  
  196. inputVal = input.val();
  197. if ($(this).is(":focus") && e.keyCode == '13') {
  198. // Ignore if message doesn't start with prefix
  199. if (inputVal.indexOf(prefix) !== 0) return;
  200.  
  201. const args = inputVal.slice(prefix.length).trim().split(/ +/g);
  202. const command = args.shift().toLowerCase();
  203.  
  204. // commands
  205.  
  206. if (command === 'info') {
  207. window.open('https://www.youtube.com/channel/UCebt69ThNxtKH3v6Ev4JCxg', '_blank');
  208. $("#chtbox").val("")
  209. }
  210. }
  211. })
  212.  
  213. window.miracleScripts = {
  214.  
  215. // News icon: <img src="/img/new-icon.jpg" style="width: 30px;">
  216. news: '<a href="https://abload.de/img/bild_2020-12-11_21330i6kfx.png" target="_blank"><img src="https://abload.de/img/miraclexmasrakap.png"></a> <span style="font-size:12px;color:#666">Yesrs will see them too.<br>Skin made by Light.</span>',
  217.  
  218. // Player profiles
  219. profiles: {
  220. 'JoNaThAnKiD1O1' : {
  221. nickNameColor: '#00FF00',
  222. },
  223. 'LusualYT' : {
  224. nickNameColor: '#000000',
  225. nickNameStrokeColor: '#000000',
  226. nickNameStrokeWidth: 2,
  227. },
  228. 'inaaa' : {
  229. nickNameStrokeColor: 'deeppink',
  230. },
  231. },
  232.  
  233. banned: [],
  234.  
  235. // Source: http://stackoverflow.com/questions/1772179/get-character-value-from-keycode-in-javascript-then-trim#answer-23377822
  236. keyboardMap: [
  237. '', // [0]
  238. '', // [1]
  239. '', // [2]
  240. 'CANCEL', // [3]
  241. '', // [4]
  242. '', // [5]
  243. 'HELP', // [6]
  244. '', // [7]
  245. 'BACK_SPACE', // [8]
  246. 'TAB', // [9]
  247. '', // [10]
  248. '', // [11]
  249. 'CLEAR', // [12]
  250. 'ENTER', // [13]
  251. 'ENTER_SPECIAL', // [14]
  252. '', // [15]
  253. 'SHIFT', // [16]
  254. 'CONTROL', // [17]
  255. 'ALT', // [18]
  256. 'PAUSE', // [19]
  257. 'CAPS_LOCK', // [20]
  258. 'KANA', // [21]
  259. 'EISU', // [22]
  260. 'JUNJA', // [23]
  261. 'FINAL', // [24]
  262. 'HANJA', // [25]
  263. '', // [26]
  264. 'ESCAPE', // [27]
  265. 'CONVERT', // [28]
  266. 'NONCONVERT', // [29]
  267. 'ACCEPT', // [30]
  268. 'MODECHANGE', // [31]
  269. 'SPACE', // [32]
  270. 'PAGE_UP', // [33]
  271. 'PAGE_DOWN', // [34]
  272. 'END', // [35]
  273. 'HOME', // [36]
  274. 'LEFT', // [37]
  275. 'UP', // [38]
  276. 'RIGHT', // [39]
  277. 'DOWN', // [40]
  278. 'SELECT', // [41]
  279. 'PRINT', // [42]
  280. 'EXECUTE', // [43]
  281. 'PRINTSCREEN', // [44]
  282. 'INSERT', // [45]
  283. 'DELETE', // [46]
  284. '', // [47]
  285. '0', // [48]
  286. '1', // [49]
  287. '2', // [50]
  288. '3', // [51]
  289. '4', // [52]
  290. '5', // [53]
  291. '6', // [54]
  292. '7', // [55]
  293. '8', // [56]
  294. '9', // [57]
  295. 'COLON', // [58]
  296. 'SEMICOLON', // [59]
  297. 'LESS_THAN', // [60]
  298. 'EQUALS', // [61]
  299. 'GREATER_THAN', // [62]
  300. 'QUESTION_MARK', // [63]
  301. 'AT', // [64]
  302. 'A', // [65]
  303. 'B', // [66]
  304. 'C', // [67]
  305. 'D', // [68]
  306. 'E', // [69]
  307. 'F', // [70]
  308. 'G', // [71]
  309. 'H', // [72]
  310. 'I', // [73]
  311. 'J', // [74]
  312. 'K', // [75]
  313. 'L', // [76]
  314. 'M', // [77]
  315. 'N', // [78]
  316. 'O', // [79]
  317. 'P', // [80]
  318. 'Q', // [81]
  319. 'R', // [82]
  320. 'S', // [83]
  321. 'T', // [84]
  322. 'U', // [85]
  323. 'V', // [86]
  324. 'W', // [87]
  325. 'X', // [88]
  326. 'Y', // [89]
  327. 'Z', // [90]
  328. 'OS_KEY', // [91] Windows Key (Windows) or Command Key (Mac)
  329. '', // [92]
  330. 'CONTEXT_MENU', // [93]
  331. '', // [94]
  332. 'SLEEP', // [95]
  333. 'NUMPAD0', // [96]
  334. 'NUMPAD1', // [97]
  335. 'NUMPAD2', // [98]
  336. 'NUMPAD3', // [99]
  337. 'NUMPAD4', // [100]
  338. 'NUMPAD5', // [101]
  339. 'NUMPAD6', // [102]
  340. 'NUMPAD7', // [103]
  341. 'NUMPAD8', // [104]
  342. 'NUMPAD9', // [105]
  343. 'MULTIPLY', // [106]
  344. 'ADD', // [107]
  345. 'SEPARATOR', // [108]
  346. 'SUBTRACT', // [109]
  347. 'DECIMAL', // [110]
  348. 'DIVIDE', // [111]
  349. 'F1', // [112]
  350. 'F2', // [113]
  351. 'F3', // [114]
  352. 'F4', // [115]
  353. 'F5', // [116]
  354. 'F6', // [117]
  355. 'F7', // [118]
  356. 'F8', // [119]
  357. 'F9', // [120]
  358. 'F10', // [121]
  359. 'F11', // [122]
  360. 'F12', // [123]
  361. 'F13', // [124]
  362. 'F14', // [125]
  363. 'F15', // [126]
  364. 'F16', // [127]
  365. 'F17', // [128]
  366. 'F18', // [129]
  367. 'F19', // [130]
  368. 'F20', // [131]
  369. 'F21', // [132]
  370. 'F22', // [133]
  371. 'F23', // [134]
  372. 'F24', // [135]
  373. '', // [136]
  374. '', // [137]
  375. '', // [138]
  376. '', // [139]
  377. '', // [140]
  378. '', // [141]
  379. '', // [142]
  380. '', // [143]
  381. 'NUM_LOCK', // [144]
  382. 'SCROLL_LOCK', // [145]
  383. 'WIN_OEM_FJ_JISHO', // [146]
  384. 'WIN_OEM_FJ_MASSHOU', // [147]
  385. 'WIN_OEM_FJ_TOUROKU', // [148]
  386. 'WIN_OEM_FJ_LOYA', // [149]
  387. 'WIN_OEM_FJ_ROYA', // [150]
  388. '', // [151]
  389. '', // [152]
  390. '', // [153]
  391. '', // [154]
  392. '', // [155]
  393. '', // [156]
  394. '', // [157]
  395. '', // [158]
  396. '', // [159]
  397. 'CIRCUMFLEX', // [160]
  398. 'EXCLAMATION', // [161]
  399. 'DOUBLE_QUOTE', // [162]
  400. 'HASH', // [163]
  401. 'DOLLAR', // [164]
  402. 'PERCENT', // [165]
  403. 'AMPERSAND', // [166]
  404. 'UNDERSCORE', // [167]
  405. 'OPEN_PAREN', // [168]
  406. 'CLOSE_PAREN', // [169]
  407. 'ASTERISK', // [170]
  408. 'PLUS', // [171]
  409. 'PIPE', // [172]
  410. 'HYPHEN_MINUS', // [173]
  411. 'OPEN_CURLY_BRACKET', // [174]
  412. 'CLOSE_CURLY_BRACKET', // [175]
  413. 'TILDE', // [176]
  414. '', // [177]
  415. '', // [178]
  416. '', // [179]
  417. '', // [180]
  418. 'VOLUME_MUTE', // [181]
  419. 'VOLUME_DOWN', // [182]
  420. 'VOLUME_UP', // [183]
  421. '', // [184]
  422. '', // [185]
  423. 'SEMICOLON', // [186]
  424. 'EQUALS', // [187]
  425. 'COMMA', // [188]
  426. 'MINUS', // [189]
  427. 'PERIOD', // [190]
  428. 'SLASH', // [191]
  429. 'BACK_QUOTE', // [192]
  430. '', // [193]
  431. '', // [194]
  432. '', // [195]
  433. '', // [196]
  434. '', // [197]
  435. '', // [198]
  436. '', // [199]
  437. '', // [200]
  438. '', // [201]
  439. '', // [202]
  440. '', // [203]
  441. '', // [204]
  442. '', // [205]
  443. '', // [206]
  444. '', // [207]
  445. '', // [208]
  446. '', // [209]
  447. '', // [210]
  448. '', // [211]
  449. '', // [212]
  450. '', // [213]
  451. '', // [214]
  452. '', // [215]
  453. '', // [216]
  454. '', // [217]
  455. '', // [218]
  456. 'OPEN_BRACKET', // [219]
  457. 'BACK_SLASH', // [220]
  458. 'CLOSE_BRACKET', // [221]
  459. 'QUOTE', // [222]
  460. '', // [223]
  461. 'META', // [224]
  462. 'ALTGR', // [225]
  463. '', // [226]
  464. 'WIN_ICO_HELP', // [227]
  465. 'WIN_ICO_00', // [228]
  466. '', // [229]
  467. 'WIN_ICO_CLEAR', // [230]
  468. '', // [231]
  469. '', // [232]
  470. 'WIN_OEM_RESET', // [233]
  471. 'WIN_OEM_JUMP', // [234]
  472. 'WIN_OEM_PA1', // [235]
  473. 'WIN_OEM_PA2', // [236]
  474. 'WIN_OEM_PA3', // [237]
  475. 'WIN_OEM_WSCTRL', // [238]
  476. 'WIN_OEM_CUSEL', // [239]
  477. 'WIN_OEM_ATTN', // [240]
  478. 'WIN_OEM_FINISH', // [241]
  479. 'WIN_OEM_COPY', // [242]
  480. 'WIN_OEM_AUTO', // [243]
  481. 'WIN_OEM_ENLW', // [244]
  482. 'WIN_OEM_BACKTAB', // [245]
  483. 'ATTN', // [246]
  484. 'CRSEL', // [247]
  485. 'EXSEL', // [248]
  486. 'EREOF', // [249]
  487. 'PLAY', // [250]
  488. 'ZOOM', // [251]
  489. '', // [252]
  490. 'PA1', // [253]
  491. 'WIN_OEM_CLEAR', // [254]
  492. '' // [255]
  493. ],
  494.  
  495. banned: ['dexan'],
  496.  
  497. watermark: ' ',
  498.  
  499. // Don't remove the spaces, they are used as separators! Source: https://emojiterra.com/de/liste/
  500. emojis: '😀 😃 😄 😁 😆 😅 😂 😉 😊 😇 😍 😘 😗 ☺️ 😚 😙 😋 😛 😜 😝 😐 😑 😶 😏 😒 😬 😌 😔 😪 😴 😷 😵 😎 😕 😟 😮 😯 😲 😳 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 😤 😡 😠 😈 👿 💀 💩 👹 👺 👻 👽 👾 😺 😸 😹 😻 😼 😽 🙀 😿 😾 🙈 🙉 🙊 💋 💌 💘 💝 💖 💗 💓 💞 💕 💟 💔 ❤️ 💛 💚 💙 💜 💯 💢 💥 💫 💦 💨 💣 💬 💭 💤 👋 ✋ 👌 ✌️ 👈 👉 👆 👇 ☝️ 👍 👎 ✊ 👊 👏 🙌 👐 🙏 💅 💪 👂 👃 👀 👅 👄 👶 👦 👧 👱 👨 👩 👴 👵 🙍 🙎 🙅 🙆 💁 🙋 🙇 👮 💂 👷 👸 👳 👲 👰 👼 🎅 💆 💇 🚶 🏃 💃 👯 🏇 🏂 🏄 🚣 🏊 🚴 🚵 🛀 👭 👫 👬 💏 💑 👪 👤 👥 👣 🐵 🐒 🐶 🐕 🐩 🐺 🐱 🐈 🐯 🐅 🐆 🐴 🐎 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🐘 🐭 🐁 🐀 🐹 🐰 🐇 🐻 🐨 🐼 🐾 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🐸 🐊 🐢 🐍 🐲 🐉 🐳 🐋 🐬 🐟 🐠 🐡 🐙 🐚 🐌 🐛 🐜 🐝 🐞 💐 🌸 💮 🌹 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 🍀 🍁 🍂 🍃 🍇 🍈 🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍅 🍆 🌽 🍄 🌰 🍞 🍖 🍗 🍔 🍟 🍕 🍳 🍲 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🍡 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🍫 🍬 🍭 🍮 🍯 🍼 ☕ 🍵 🍶 🍷 🍸 🍹 🍺 🍻 🍴 🔪 🌍 🌎 🌏 🌐 🗾 🌋 🗻 🏠 🏡 🏢 🏣 🏤 🏥 🏦 🏨 🏩 🏪 🏫 🏬 🏭 🏯 🏰 💒 🗼 🗽 ⛪ ⛲ ⛺ 🌁 🌃 🌄 🌅 🌆 🌇 🌉 ♨️ 🎠 🎡 🎢 💈 🎪 🚂 🚃 🚄 🚅 🚆 🚇 🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🚲 🚏 ⛽ 🚨 🚥 🚦 🚧 ⚓ ⛵ 🚤 🚢 ✈️ 💺 🚁 🚟 🚠 🚡 🚀 ⌛ ⏳ ⌚ ⏰ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀️ 🌝 🌞 ⭐ 🌟 🌠 🌌 ☁️ ⛅ 🌀 🌈 🌂 ☔ ⚡ ❄️ ⛄ 🔥 💧 🌊 🎃 🎄 🎆 🎇 ✨ 🎈 🎉 🎊 🎋 🎍 🎎 🎏 🎐 🎑 🎀 🎁 🎫 🏆 ⚽ ⚾ 🏀 🏈 🏉 🎾 🎳 ⛳ 🎣 🎽 🎿 🎯 🎱 🔮 🎮 🎰 🎲 ♠️ ♥️ ♦️ ♣️ 🃏 🀄 🎴 🎭 🎨 👓 👔 👕 👖 👗 👘 👙 👚 👛 👜 👝 🎒 👞 👟 👠 👡 👢 👑 👒 🎩 🎓 💄 💍 💎 🔇 🔈 🔉 🔊 📢 📣 📯 🔔 🔕 🎼 🎵 🎶 🎤 🎧 📻 🎷 🎸 🎹 🎺 🎻 📱 📲 ☎️ 📞 📟 📠 🔋 🔌 💻 💽 💾 💿 📀 🎥 🎬 📺 📷 📹 📼 🔍 🔎 💡 🔦 🏮 📔 📕 📖 📗 📘 📙 📚 📓 📒 📃 📜 📄 📰 📑 🔖 💰 💴 💵 💶 💷 💸 💳 💹 💱 💲 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 ✏️ ✒️ 📝 💼 📁 📂 📅 📆 📇 📈 📉 📊 📋 📌 📍 📎 📏 📐 ✂️ 🔒 🔓 🔏 🔐 🔑 🔨 🔫 🔧 🔩 🔗 🔬 🔭 📡 💉 💊 🚪 🚽 🚿 🛁 🚬 🗿 🏧 🚮 🚰 ♿ 🚹 🚺 🚻 🚼 🚾 🛂 🛃 🛄 🛅 ⚠️ 🚸 ⛔ 🚫 🚳 🚭 🚯 🚱 🚷 📵 🔞 ⬆️ ↗️ ➡️ ↘️ ⬇️ ↙️ ⬅️ ↖️ ↕️ ↔️ 🔃 🔄 🔙 🔚 🔛 🔜 🔝 🔯 ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ⛎ 🔀 🔁 🔂 ▶️ ◀️ 🔼 🔽 🎦 📶 📳 📴 ♻️ 🔱 📛 🔰 ⭕ ✅ ☑️ ✖️ ❌ ❎ ➕ ➖ ➗ ➰ ➿ 〽️ ✳️ ✴️ ❇️ ‼️ ⁉️ ❓ ❔ ❕ ❗ 〰️ ©️ ®️ ™️ 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 🆔 Ⓜ️ 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🈷️ 🈶 🈯 🉐 🈹 🈚 🈲 🉑 🈸 🈴 🈳 ㊗️ ㊙️ 🈺 🈵 🔴 🔵 ⚫ ⚪ ⬛ ⬜ ◼️ ◻️ ◾ ◽ ▪️ ▫️ 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲 🏁 🚩 🎌',
  501.  
  502. settings: null,
  503.  
  504. hotkeys: null,
  505.  
  506. mouse : {
  507. x: 0,
  508. y: 0,
  509. lastMovedAt: null,
  510. },
  511.  
  512. init: function() {
  513. var self = this;
  514.  
  515. this.setupPolyfills();
  516.  
  517. this.hotkeys = JSON.parse(localStorage.getItem('hotkeys'));
  518.  
  519. this.auth();
  520.  
  521. this.config();
  522.  
  523. this.originalDrawImage = CanvasRenderingContext2D.prototype.drawImage;
  524. CanvasRenderingContext2D.prototype.drawImage = this.drawImage;
  525.  
  526. document.querySelector('body').addEventListener('mousemove', function(event) {
  527. self.mouse.x = event.clientX;
  528. self.mouse.y = event.clientY;
  529. self.mouse.lastMovedAt = Date.now();
  530. });
  531.  
  532. this.moveRespawnBtn();
  533. this.players();
  534. this.animation();
  535. this.chatLog();
  536. this.halt();
  537. this.dance();
  538. this.favSkins();
  539. this.paste();
  540. this.replacements();
  541. this.fpsPing();
  542. this.timer();
  543. this.alive();
  544. this.skinChanger();
  545. this.skinApplier();
  546. this.nameCopier();
  547. this.ultraSplit();
  548. this.lineSplit();
  549. this.waste();
  550. this.guessing();
  551. this.nameColor();
  552. this.wearablesToggle();
  553. this.keyboardLayout();
  554. this.help();
  555. this.commands();
  556.  
  557. console.log('🌸 Miracle Scripts successfully loaded!');
  558. },
  559.  
  560. config: function() {
  561. var self = this;
  562. var settings = null;
  563.  
  564. var loadSettings = function (stringifiedSettings) {
  565. var defaultSettings = {
  566. // To get keycodes: https://keycode.info
  567. bindings: {
  568. ultraSplit: 85, // U
  569. wearables: 36, // POS1
  570. animation: 17, // CTRL
  571. paste: 33, // PAGE UP
  572. dance: 34, // PAGE DOWN,
  573. halt: 72, // H,
  574. chatLog: 76, // L
  575. skin1: 49, // 1
  576. skin2: 50, // 2
  577. skin3: 51, // 3
  578. skin4: 52, // 4
  579. skin5: 53, // 5
  580. skin6: 54, // 6
  581. skin7: 55, // 7
  582. skin8: 56, // 8
  583. skin9: 57, // 9
  584. },
  585. replacements: ":D|:smile:\n:*(|:sob:\n:'D|:sweat_smile:\nxD|:joy:\n/miracle|uses 𝘔𝘪𝘳𝘢𝘤𝘭𝘦 𝘚𝘤𝘳𝘪𝘱𝘵,Install script from 𝘎𝘳𝘦𝘢𝘴𝘺𝘧𝘰𝘳𝘬.𝘰𝘳𝘨/scripts/417832!\n/xp|is currently level {amount} with █████▒▒▒▒▒ {percent%} of the next level completed",
  586. primaryColor: '#f9138b',
  587. targetLanguage: 'en',
  588. favSkins: [],
  589. quickSkins: [],
  590. players: [],
  591. showClock: true,
  592. changeKeyboardLayout: false,
  593. };
  594.  
  595. if (stringifiedSettings == null || stringifiedSettings == undefined || stringifiedSettings === '') {
  596. settings = defaultSettings;
  597. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  598. } else {
  599. settings = JSON.parse(stringifiedSettings);
  600. if (settings === null || Object.getOwnPropertyNames(settings).length == 0) {
  601. settings = defaultSettings;
  602. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  603. }
  604.  
  605. // Update for settings:
  606. if (typeof settings.primaryColor === 'undefined') {
  607. settings.primaryColor = defaultSettings.primaryColor;
  608. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  609. }
  610. if (typeof settings.bindings.chatLog === 'undefined') {
  611. settings.bindings.chatLog = defaultSettings.bindings.chatLog;
  612. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  613. }
  614. if (typeof settings.favSkins === 'undefined') {
  615. settings.favSkins = defaultSettings.favSkins;
  616. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  617. }
  618. if (typeof settings.targetLanguage === 'undefined') {
  619. settings.targetLanguage = defaultSettings.targetLanguage;
  620. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  621. }
  622. if (typeof settings.quickSkins === 'undefined') {
  623. settings.quickSkins = [];
  624. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  625. }
  626. if (typeof settings.installedVersion === 'undefined') {
  627. settings.installedVersion = 1;
  628. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  629. }
  630. if (typeof settings.players === 'undefined') {
  631. settings.players = [];
  632. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  633. }
  634. if (typeof settings.bindings.skin1 === 'undefined') {
  635. settings.bindings.skin1 = defaultSettings.bindings.skin1;
  636. settings.bindings.skin2 = defaultSettings.bindings.skin2;
  637. settings.bindings.skin3 = defaultSettings.bindings.skin3;
  638. settings.bindings.skin4 = defaultSettings.bindings.skin4;
  639. settings.bindings.skin5 = defaultSettings.bindings.skin6;
  640. settings.bindings.skin6 = defaultSettings.bindings.skin6;
  641. settings.bindings.skin7 = defaultSettings.bindings.skin7;
  642. settings.bindings.skin8 = defaultSettings.bindings.skin8;
  643. settings.bindings.skin9 = defaultSettings.bindings.skin9;
  644. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  645. }
  646. if (typeof settings.showClock === 'undefined') {
  647. settings.showClock = false;
  648. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  649. }
  650. if (typeof settings.showKeyboardLayout === 'undefined') {
  651. settings.showKeyboardLayout = false;
  652. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  653. }
  654. if (typeof settings.bindings.ultraSplit === 'undefined') {
  655. settings.bindings.ultraSplit = 85;
  656. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  657. }
  658. if (typeof settings.bindings.wearables === 'undefined') {
  659. settings.bindings.wearables = 36;
  660. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  661. }
  662. if (typeof settings.bindings.halt === 'undefined') {
  663. settings.bindings.halt = defaultSettings.bindings.halt;
  664. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  665. }
  666. }
  667.  
  668. self.settings = settings;
  669. };
  670. loadSettings(localStorage.getItem('miracleScripts'));
  671.  
  672. if (settings.installedVersion < this.getVersionAsInt()) {
  673. if (settings.installedVersion > 1) { // We do not want to inform new scripts user of past updates
  674. if (settings.installedVersion < this.getVersionAsInt('2.4.3')) {
  675. window.alert('📢 Miracle Scripts Update: \n\n' +
  676. 'As of version 2.4.3 the nickname color change feature has been removed ' +
  677. 'according to an official decision of the Agma team.\n\n' +
  678. 'To avoid trouble for its users Miracle Scripts respects this decision. ' +
  679. 'Therefore Miracle Scripts is a legit extension for Agma and using it is safe.'
  680. );
  681. }
  682. if (settings.installedVersion < this.getVersionAsInt('2.5.6')) {
  683. self.swal(
  684. 'Miracle Scripts Update',
  685. 'You may now use 20 slots for skins (previously: 15). Type <i>/skin16</i> - <i>/skin20</i> in the chat box!');
  686. }
  687. if (settings.installedVersion < this.getVersionAsInt('2.5.8')) {
  688. self.swal(
  689. 'Miracle Scripts Update',
  690. '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".');
  691. }
  692. if (settings.installedVersion < this.getVersionAsInt('2.6.0')) {
  693. self.swal(
  694. 'Miracle Scripts Update',
  695. 'New: You may now bind keys to skin slots. Per default the keys 1 - 9 are bound to <i>/skin1</i> - <i>/skin9</i>.');
  696. }
  697. if (settings.installedVersion < this.getVersionAsInt('2.6.1')) {
  698. self.swal(
  699. 'Miracle Scripts Update',
  700. 'New: Right click on a cell. Then click on <i>Use Player\'s Wearables</i> to use the same wearables as that player. (Of course you have to own the wearables.)');
  701. }
  702. if (settings.installedVersion < this.getVersionAsInt('2.6.4')) {
  703. self.swal(
  704. 'Miracle Scripts Update',
  705. 'New: Want to see how late it is? Activate the clock in the settings!');
  706. }
  707. if (settings.installedVersion < this.getVersionAsInt('3.0.0')) {
  708. self.swal(
  709. 'Miracle Scripts Update',
  710. '<b>ATTENTION!</b> 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 <i>/say</i> command has been removed, as the Agma staff enforced this.');
  711. }
  712. if (settings.installedVersion < this.getVersionAsInt('3.1.3')) {
  713. self.swal(
  714. 'Miracle Scripts Update',
  715. '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 😜');
  716. }
  717. if (settings.installedVersion < this.getVersionAsInt('3.1.6')) {
  718. self.swal(
  719. 'Miracle Scripts Update',
  720. 'New: Type <span style="font-style: italic">/players</span> in the chat to see how many players are online in Agma!');
  721. }
  722. if (settings.installedVersion < this.getVersionAsInt('3.3.0')) {
  723. self.swal(
  724. 'Miracle Scripts Update',
  725. 'New: You may now see your keyboard layout as an overlay! Go to the settings to activate it.');
  726. }
  727. if (settings.installedVersion < this.getVersionAsInt('3.4.0')) {
  728. self.swal(
  729. 'Miracle Scripts Update',
  730. 'New: ULTRA split! Press U to make an ultra split, which can split 1 cell to 64!! (The server has to support that!)');
  731. }
  732. if (settings.installedVersion < this.getVersionAsInt('3.6.0')) {
  733. self.swal(
  734. 'Miracle Scripts Update',
  735. 'New: Toggle "wearables on/off" with a key! Default is POS1!');
  736. }
  737. if (settings.installedVersion < this.getVersionAsInt('4.0.0')) {
  738. self.swal(
  739. 'Miracle Scripts Update',
  740. 'New: Type /guess to start a little guessing game in the chat!<br><br>💡 Note that it only works with browsers that can display emojis.');
  741. }
  742. if (settings.installedVersion < this.getVersionAsInt('4.2.2')) {
  743. self.swal(
  744. 'Miracle Scripts Update',
  745. '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!)');
  746. }
  747. if (settings.installedVersion < this.getVersionAsInt('4.3.2')) {
  748. self.swal(
  749. 'Miracle Scripts Announcement',
  750. 'Prepare for some <b>insane</b> new Miracle features! This time it will be mind-blowing. <br><br>To be released soon.');
  751. }
  752. if (settings.installedVersion < this.getVersionAsInt('5.0.2')) {
  753. window.swal({
  754. title: 'Miracle Scripts Update',
  755. text: 'Today we released a great new feature<br>to celebrate <i>Miracle\'s 1 year anniversary</i>:<br><b>Free self-freezing</b>! <br><br>' +
  756. '<iframe width="320" height="180" src="https://www.youtube.com/embed/oWQ9vxdbVcc?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' +
  757. '<br><br>Press H to use it!',
  758. html: true
  759. });
  760. }
  761. if (settings.installedVersion < this.getVersionAsInt('5.0.6')) {
  762. self.swal(
  763. 'Miracle Scripts Update',
  764. 'New: Anti-AFK! Doubling the countdown time till you get disconnected for being AFK from 5 to 10 minutes!!!');
  765. }
  766. }
  767.  
  768. settings.installedVersion = this.getVersionAsInt();
  769. localStorage.setItem('miracleScripts', JSON.stringify(settings));
  770. self.settings = settings;
  771. }
  772.  
  773.  
  774.  
  775. if (settings.showNewsFeed) {
  776. var defaultNews = 'Agma.io is the best io game I know. I hang out with friends, compete, and improve my skills and communication language. I love agma 🥰 - Liz';
  777. var $newsElement = $('#cnt_panel .navbar p.text-center');
  778. if ($newsElement.text().trim() === defaultNews) {
  779. $newsElement.css('margin-bottom', '40px');
  780. $newsElement.css('padding', '15px');
  781. $newsElement.css('background-color', 'rgba(0, 0, 0, 0.5)');
  782. $newsElement.html(self.news);
  783.  
  784. var $metaElement = $('<div title="Powered by Miracle Script">AGsA News</div>');
  785. $newsElement.parent().prepend($metaElement);
  786. $metaElement.css('background-color', '#B5B9C0');
  787. $metaElement.css('color', 'black');
  788. }
  789. }
  790.  
  791. var applyPrimaryColor = function () {
  792. var primaryColorCss = '.miracle-primary-color-font { color: ' + self.settings.primaryColor + ' !important } .miracle-primary-color-background { background-color: ' + self.settings.primaryColor + ' !important }; ';
  793. $('body').append('<style>' + primaryColorCss + '</style>');
  794. };
  795. applyPrimaryColor();
  796.  
  797. // General fix for the size of the FontAwesome Icons in the context menu
  798. $('body').append('<style>.context-icon .fa { font-size: 30px }</style>');
  799.  
  800. // We need to have a delay, because the menu is not loaded right away
  801. setTimeout(function () {
  802. var $playButton = $('#playBtn');
  803. var $specateButton = $('#spectateBtn');
  804.  
  805. $playButton.get(0).style.width = '33%';
  806. $specateButton.get(0).style.width = '50%';
  807.  
  808. var $settingsButton = $('<button class="playgame2" style="width: 50px; background-color: #BFC9CA; margin-left: 0px; margin-right: 0px; margin-down: -7px; text-align: center" title="Miracle Scripts Settings">📜</button>');
  809. $settingsButton.insertAfter($specateButton);
  810.  
  811. var changeKey = function (event) {
  812. var name = this.name.substr(4);
  813. $(this).val(self.keyboardMap[event.keyCode]);
  814. self.settings.bindings[name] = event.keyCode;
  815. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  816. };
  817.  
  818. var deleteKey = function () {
  819. var action = $(this).attr('data-action');
  820. $('#miracle-settings input[name=key_' + action + ']').val('undefined');
  821. self.settings.bindings[action] = null;
  822. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  823. };
  824.  
  825. // Weird Agma scripting... press enter in the replacements textarea and the chat box gets focused!
  826. // Therefore catch the keydown event (that happens earlier) and insert the linebreak manually,
  827. // focus again (delayed) and go to the end of the text where the linebreak is.
  828. // We can improve this later on...
  829. var addReturn = function (event) {
  830. if (event.keyCode === 13) {
  831. var textarea = this;
  832. $(textarea).text($(this).text() + '\n').focus();
  833. setTimeout(function () {
  834. $(textarea).focus();
  835. textarea.setSelectionRange(textarea.value.length, textarea.value.length);
  836. }, 1);
  837. }
  838. };
  839. var changeReplacements = function () {
  840. self.settings.replacements = $(this).val();
  841. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  842. };
  843. var changePrimaryColor = function () {
  844. self.settings.primaryColor = $(this).val();
  845. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  846. applyPrimaryColor();
  847. };
  848. var changeTargetLanguage = function () {
  849. self.settings.targetLanguage = $(this).val();
  850. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  851. };
  852. var changeClock = function() {
  853. self.settings.showClock = $(this).is(':checked');
  854. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  855. };
  856. var changeKeyboardLayout = function() {
  857. self.settings.showKeyboardLayout = $(this).is(':checked');
  858. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  859. };
  860.  
  861. var $modal = $('<div id="miracle-settings" class="miracle-primary-color-font" style="position: fixed; width: 100%; height: 100%; overflow-y: auto; padding: 50px; background-color: rgba(0,0,0,0.95); z-index: 999; display: none"></div>');
  862. $modal.append('<h1>Miracle Scripts For cellcraft.io</h1>');
  863.  
  864. if (GM_info) {
  865. $modal.append('<small style="color: #717171">Version ' + GM_info.script.version + '</small>');
  866. }
  867.  
  868. var $firstRow = $('<td style="vertical-align: top; padding-right: 19px;">');
  869. var $secRow = $('<td style="vertical-align: top; padding-right: 19px;">');
  870. var $thirdRow = $('<td style="vertical-align: top; padding-right: 19px;">');
  871.  
  872.  
  873. var $element = $('<input name="key_ultraSplit" value="' + self.keyboardMap[self.settings.bindings.ultraSplit] + '"/>').keyup(changeKey);
  874. $firstRow.append('<br><br>Ultra-Split-Key:<br>', $element);
  875. $element = $('<a href="#" data-action="ultraSplit" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  876. $firstRow.append($element);
  877.  
  878. $element = $('<input name="key_animation" value="' + self.keyboardMap[self.settings.bindings.animation] + '"/>').keyup(changeKey);
  879. $firstRow.append('<br><br>Animation-Key:<br>', $element);
  880. $element = $('<a href="#" data-action="animation" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  881. $firstRow.append($element);
  882.  
  883. $element = $('<input name="key_paste" value="' + self.keyboardMap[self.settings.bindings.paste] + '"/>').keyup(changeKey);
  884. $firstRow.append('<br><br>Paste-Key:<br>', $element);
  885. $element = $('<a href="#" data-action="paste" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  886. $firstRow.append($element);
  887.  
  888. $element = $('<input name="key_dance" value="' + self.keyboardMap[self.settings.bindings.dance] + '"/>').keyup(changeKey);
  889. $firstRow.append('<br><br>Dance-Key:<br>', $element);
  890. $element = $('<a href="#" data-action="dance" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  891. $firstRow.append($element);
  892.  
  893. $element = $('<input name="key_halt" value="' + self.keyboardMap[self.settings.bindings.halt] + '"/>').keyup(changeKey);
  894. $firstRow.append('<br><br>Halt-Key:<br>', $element);
  895. $element = $('<a href="#" data-action="halt" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  896. $firstRow.append($element);
  897.  
  898. $element = $('<input name="key_chatLog" value="' + self.keyboardMap[self.settings.bindings.chatLog] + '"/>').keyup(changeKey);
  899. $firstRow.append('<br><br>Chat-Log-Key:<br>', $element);
  900. $element = $('<a href="#" data-action="chatLog" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  901. $firstRow.append($element);
  902.  
  903.  
  904. $element = $('<input name="key_skin1" value="' + self.keyboardMap[self.settings.bindings.skin1] + '"/>').keyup(changeKey);
  905. $secRow.append('<br><br>Use-First-Skin-Key:<br>', $element);
  906. $element = $('<a href="#" data-action="skin1" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  907. $secRow.append($element);
  908.  
  909. $element = $('<input name="key_skin2" value="' + self.keyboardMap[self.settings.bindings.skin2] + '"/>').keyup(changeKey);
  910. $secRow.append('<br><br>Use-Second-Skin-Key:<br>', $element);
  911. $element = $('<a href="#" data-action="skin2" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  912. $secRow.append($element);
  913.  
  914. $element = $('<input name="key_skin3" value="' + self.keyboardMap[self.settings.bindings.skin3] + '"/>').keyup(changeKey);
  915. $secRow.append('<br><br>Use-Third-Skin-Key:<br>', $element);
  916. $element = $('<a href="#" data-action="skin3" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  917. $secRow.append($element);
  918.  
  919. $element = $('<input name="key_skin4" value="' + self.keyboardMap[self.settings.bindings.skin4] + '"/>').keyup(changeKey);
  920. $secRow.append('<br><br>Use-Fourth-Skin-Key:<br>', $element);
  921. $element = $('<a href="#" data-action="skin4" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  922. $secRow.append($element);
  923.  
  924. $element = $('<input name="key_skin5" value="' + self.keyboardMap[self.settings.bindings.skin5] + '"/>').keyup(changeKey);
  925. $secRow.append('<br><br>Use-Fifth-Skin-Key:<br>', $element);
  926. $element = $('<a href="#" data-action="skin5" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  927. $secRow.append($element);
  928.  
  929.  
  930. $element = $('<input name="key_skin6" value="' + self.keyboardMap[self.settings.bindings.skin6] + '"/>').keyup(changeKey);
  931. $thirdRow.append('<br><br>Use-Sixth-Skin-Key:<br>', $element);
  932. $element = $('<a href="#" data-action="skin6" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  933. $thirdRow.append($element);
  934.  
  935. $element = $('<input name="key_skin7" value="' + self.keyboardMap[self.settings.bindings.skin7] + '"/>').keyup(changeKey);
  936. $thirdRow.append('<br><br>Use-Seventh-Skin-Key:<br>', $element);
  937. $element = $('<a href="#" data-action="skin7" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  938. $thirdRow.append($element);
  939.  
  940. $element = $('<input name="key_skin8" value="' + self.keyboardMap[self.settings.bindings.skin8] + '"/>').keyup(changeKey);
  941. $thirdRow.append('<br><br>Use-Eighth-Skin-Key:<br>', $element);
  942. $element = $('<a href="#" data-action="skin8" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  943. $thirdRow.append($element);
  944.  
  945. $element = $('<input name="key_skin9" value="' + self.keyboardMap[self.settings.bindings.skin9] + '"/>').keyup(changeKey);
  946. $thirdRow.append('<br><br>Use-Ninth-Skin-Key:<br>', $element);
  947. $element = $('<a href="#" data-action="skin9" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  948. $thirdRow.append($element);
  949.  
  950. $element = $('<input name="key_wearables" value="' + self.keyboardMap[self.settings.bindings.wearables] + '"/>').keyup(changeKey);
  951. $thirdRow.append('<br><br>Toggle-Wearables-Key:<br>', $element);
  952. $element = $('<a href="#" data-action="wearables" class="miracle-primary-color-background" style="display: inline-block; padding: 3px 10px; color: white">✕</a>').click(deleteKey);
  953. $thirdRow.append($element);
  954.  
  955.  
  956.  
  957. var $table = $('<table>').append($('<tbody>').append($('<tr>').append($firstRow).append($secRow).append($thirdRow)));
  958. $modal.append($table)
  959.  
  960. $element = $('<select name="target_language"><option value="en">English</option><option value="de">German</option><option value="fr">French</option><option value="es">Spanish</option><option value="it">Italian</option><option value="nl">Dutch</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ru">Russian</option><option value="ja">Japanese</option><option value="zh">Chinese</option></select>').change(changeTargetLanguage);
  961. $modal.append('<br><br>Translate cellcraft.io chat messages to:<br>', $element);
  962. $element.get(0).value = self.settings.targetLanguage;
  963.  
  964. $element = $('<input type="color" name="favcolor" value="' + self.settings.primaryColor + '"/>').change(changePrimaryColor);
  965. $modal.append('<br><br>User interface color:<br>', $element);
  966.  
  967. $element = $('<input type="checkbox" name="checkBox" value="1" ' + (self.settings.showClock ? 'checked' : '') + '/>').change(changeClock);
  968. $modal.append('<br><br>Show clock:<br>', $element);
  969.  
  970. $element = $('<input type="checkbox" name="checkBox" value="1" ' + (self.settings.showKeyboardLayout ? 'checked' : '') + '/>').change(changeKeyboardLayout);
  971. $modal.append('<br><br>Show Keyboard Layout (reload website to update):<br>', $element);
  972.  
  973. $element = $('<textarea rows="6" style="width: 100%; max-width: 500px" placeholder="search|replace">').text(self.settings.replacements).keydown(addReturn).keyup(changeReplacements);
  974. $modal.append('<br><br>Chat-Replacements (1 per line):<br>', $element, '<br>💡 <span style="color: #00C9FF">Avoid using the search text in the cellcraft.io replacement!</span>');
  975.  
  976. $modal.append($('<br><a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-top: 20px; padding: 10px; color: white">Close</a>').click(function () {
  977. $modal.hide();
  978. }));
  979. $modal.append($('<a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-left: 20px; margin-top: 20px; padding: 10px; color: white">Export settings</a>').click(function () {
  980. self.download('miracle_settings.txt', localStorage.getItem('miracleScripts'));
  981. }));
  982. $modal.append($('<a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-left: 20px; margin-top: 20px; padding: 10px; color: white">Import setting</a>').click(function () {
  983. var stringifiedSettings = window.prompt('Paste the settings here');
  984. if (stringifiedSettings !== null) {
  985. loadSettings(stringifiedSettings);
  986. localStorage.setItem('miracleScripts', stringifiedSettings);
  987. $modal.hide();
  988. self.message('Settings loaded! Reload cellcraft.io to refresh. 😄');
  989. }
  990. }));
  991. //$modal.append($('<a href="http://agarioforums.net/showthread.php?tid=61388" target="_blank" class="miracle-primary-color-background" style="display: inline-block; margin-left: 20px; margin-top: 20px; padding: 10px; color: white">Support</a>'));
  992. $modal.append($('<a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-left: 20px; margin-top: 20px; padding: 10px; color: white">Help</a>').click(function () {
  993. $modal.hide();
  994. self.$helpModal.show();
  995. }));
  996.  
  997. $('body').append($modal);
  998.  
  999. $settingsButton.click(function (event) {
  1000. $modal.show();
  1001.  
  1002. event.preventDefault();
  1003. });
  1004.  
  1005. // Anti AFK
  1006. window.setInterval(function() {
  1007. if (self.mouse.lastMovedAt !== null && Date.now() - self.mouse.lastMovedAt >= 230000 && Date.now() - self.mouse.lastMovedAt <= 230000 + 60000) {
  1008. self.mouse.x++;
  1009. $('#canvas').trigger($.Event('mousemove', {clientX: self.mouse.x, clientY: self.mouse.y, synthetic: true}));
  1010. console.log('🚫 Miracle ANTI-AFK activated.');
  1011. }
  1012. }, 60000);
  1013.  
  1014. window.addEventListener('miracleCommand', function(commandEvent) {
  1015. if (commandEvent.command === '/miraclesettings' || commandEvent.command === '/miracleconfig') {
  1016. $modal.show();
  1017. $('#chtbox').val('');
  1018. }
  1019. });
  1020. }, 500);
  1021. },
  1022.  
  1023. /**
  1024. * This overwrites the original drawImage function. This allows us to get all the drawImage() calls,
  1025. * with coordinates of the images, so we can get the position of things on the map, for instance of cells.
  1026. */
  1027. drawImage: function (image, sourceX, sourceY, sourceWidth, sourceHeight, targetX, targetY, targetWidth, targetHeight) {
  1028. var self = window.miracleScripts;
  1029. var unifiedSkinUrl = image.src ? image.src.replace('_lo.', '.') : '';
  1030. var pos = unifiedSkinUrl.indexOf('?');
  1031. if (pos > -1) {
  1032. unifiedSkinUrl = unifiedSkinUrl.substring(0, pos);
  1033. }
  1034.  
  1035. // 'https://agma.io/skins/5642.png'
  1036. if (unifiedSkinUrl === 'https://agma.io/skins/4889.png') {
  1037. if (self.skinReplacementImg === undefined) {
  1038. self.skinReplacementImg = document.createElement('img');
  1039. self.skinReplacementImg.src = 'https://i.imgur.com/xOC7bqC.png';
  1040. } else {
  1041. arguments[0] = self.skinReplacementImg;
  1042. var x = 123;
  1043. }
  1044. }
  1045.  
  1046. return self.originalDrawImage.apply(this, arguments);
  1047. },
  1048.  
  1049. moveRespawnBtn: function() {
  1050. $('#advBox > div:last-child').css('position', 'absolute');
  1051. $('#advBox > div:last-child').css('left', '48%');
  1052. $('#advBox > div:last-child').css('marginTop', '5px');
  1053. $('#advBox > div:nth-child(2)').css('marginLeft', '10%');
  1054. },
  1055.  
  1056. players: function() {
  1057. var self = this;
  1058.  
  1059. $('body').append('<style>#friendList .name { text-decoration: underline; cursor: pointer; }</style>');
  1060.  
  1061. $('#phpFriendlist').click(function(event) {
  1062. if (event.target.classList.contains('name')) { // TODO check: what happens if player is online?
  1063. insertPMText($(event.target).text());
  1064. }
  1065. });
  1066.  
  1067. $('#btnFriends').click(function() {
  1068. var updater = function() {
  1069. if ($('#friendDialogMessage').length > 0) {
  1070. window.setTimeout(updater, 200);
  1071. return;
  1072. }
  1073.  
  1074. $('#phpFriendlist span.name, #requestList span.name').each(function() {
  1075. var $nameElement = $(this);
  1076. var name = $nameElement.text();
  1077. self.settings.players.forEach(function(player) {
  1078. if (player.name === name && player.alias) {
  1079. $nameElement.attr('title', 'Accountname: ' + name);
  1080. $nameElement.css('fontStyle', 'italic');
  1081. $nameElement.text(player.alias);
  1082. }
  1083. });
  1084. });
  1085. };
  1086. window.setTimeout(updater, 200);
  1087. });
  1088.  
  1089. $('#contextUserProfile').click(function() {
  1090. $('#miracle-player-settings').remove();
  1091.  
  1092. window.setTimeout(function() {
  1093. if ($('.sweet-alert .sa-error').css('display') === 'block') {
  1094. return; // No (public) profile available
  1095. }
  1096.  
  1097. var player = null;
  1098. var accountName = $('.sweet-alert h2 span:first()').text();
  1099.  
  1100. self.settings.players.some(function(candidate) {
  1101. if (candidate.name === accountName) {
  1102. player = candidate;
  1103. return true;
  1104. }
  1105. });
  1106.  
  1107. var $editArea = $('<div id="miracle-player-settings">');
  1108. var $aliasField = $('<input type="text" maxlength="30" placeholder="Alias" title="Alias" style="display: block; color: #333">').blur(function() {
  1109. var alias = $(this).val();
  1110. if (player) {
  1111. player.alias = alias;
  1112. } else {
  1113. player = {name: accountName, alias: alias};
  1114. self.settings.players.push(player);
  1115. }
  1116. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  1117. });
  1118. if (player) {
  1119. $aliasField.val(player.alias);
  1120. }
  1121. $editArea.append($aliasField);
  1122. var $noteField = $('<textarea maxlength="250" placeholder="Notes" title="Notes" rows="4" style="width: 100%; padding: 10px; color: #333"></textarea>').blur(function() {
  1123. var note = $(this).val();
  1124. if (player) {
  1125. player.note = note;
  1126. } else {
  1127. player = {name: accountName, note: note};
  1128. self.settings.players.push(player);
  1129. }
  1130. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  1131. });
  1132. if (player) {
  1133. $noteField.val(player.note);
  1134. }
  1135. $editArea.append($noteField);
  1136.  
  1137. $editArea.insertBefore('.sweet-alert .sa-button-container');
  1138.  
  1139. if ($('.sweet-overlay').attr('data-listening') != 1) {
  1140. $('.sweet-overlay').attr('data-listening', 1);
  1141.  
  1142. $('.sweet-overlay').click(function() {
  1143. $('#miracle-player-settings').remove();
  1144. });
  1145. $('.sweet-alert .sa-button-container button').click(function() {
  1146. $('#miracle-player-settings').remove();
  1147. });
  1148. }
  1149. }, 300);
  1150. });
  1151. },
  1152.  
  1153. auth: function() {
  1154. var self = this;
  1155.  
  1156. var value = localStorage.getItem('330145eb94127d7d99dd28af3ee8599d');
  1157.  
  1158. if (value) {
  1159. throw 'Exception: Authentication failed. Code: 1000001';
  1160. }
  1161.  
  1162. var check = function () {
  1163. var accountName = self.getAccountName();
  1164. if (self.banned.indexOf(accountName) > -1) {
  1165. console.log('Exception: Authentication failed. Code: 1000001');
  1166. localStorage.setItem('330145eb94127d7d99dd28af3ee8599d', '90f62eda082944015b3c794c65b7c0f0');
  1167. window.location.reload();
  1168. return;
  1169. };
  1170. }
  1171.  
  1172. setInterval(check, 10000);
  1173. },
  1174.  
  1175. animation: function () {
  1176. var self = this;
  1177.  
  1178. var chatAnimate = function () {
  1179. if ($('#chtbox').val().substr(0, 4) === '/pm ') {
  1180. $('#chtbox').val('');
  1181. }
  1182.  
  1183. // All available commands and combinations
  1184. var items = ['wacky',
  1185. 'spin', 'spinspin', 'spinspinspin', 'wackyspin', 'wackyspinspin',
  1186. 'flip', 'flipflip', 'flipflipflip', 'wackyflip', 'wackyflipflip',
  1187. 'shake', 'shakeshake', 'shakeshakeshake', 'wackyshake', 'wackyshakeshake',
  1188. 'jump', 'jumpjump', 'jumpjumpjump', 'wackyjump', 'wackyjumpjump',
  1189. ];
  1190.  
  1191. // Super-combinations!!
  1192. if (self.getRandomInt(1, 3) === 1) {
  1193. items = ['jumpspinflip', 'jumpflipshake', 'jumpspinshake', 'spinshakeflip'];
  1194. }
  1195.  
  1196. // Choose randomly an item of the items array
  1197. // Source: https://stackoverflow.com/questions/5915096/get-random-item-from-javascript-array
  1198. var item = items[Math.floor(Math.random() * items.length)];
  1199.  
  1200. // Attempt to avoid triggering spam protection - probably useless :-/
  1201. item += String.fromCharCode(8203).repeat(self.getRandomInt(1, 5));
  1202.  
  1203. // Add text into the chat box and focus it (Note: actually "/" is no longer necessary)
  1204. $('#chtbox').val($('#chtbox').val() + item).focus();
  1205.  
  1206. // Stop the event so that the pressed key won't be written into the chat box!
  1207. event.preventDefault();
  1208. };
  1209.  
  1210. window.addEventListener('keydown', function (event) {
  1211. // Do nothing if a menu is open
  1212. if (document.getElementById('overlays').style.display !== 'none' || document.getElementById('advert').style.display !== 'none') {
  1213. return;
  1214. }
  1215.  
  1216. if (event.keyCode == self.settings.bindings.animation) {
  1217. chatAnimate();
  1218. }
  1219. });
  1220. },
  1221.  
  1222. paste: function () {
  1223. var self = this;
  1224. var emojiFontSize = (window.innerWidth * window.innerHeight > 2000000) ? 24 : 18;
  1225. var css = '#miracle-emojis .miracle-emoji { display: inline-block; width: 40px; margin: 0 2px 2px 0; padding: 5px; border: 1px solid #333; font-size: ' + emojiFontSize + 'px; }\n' +
  1226. '#miracle-emojis .miracle-emoji:hover { background-color: #FF69B4 }';
  1227.  
  1228. var emojis = this.emojis.split(' ');
  1229. var emojiCode = '';
  1230.  
  1231. emojis.forEach(function (emoji) {
  1232. emojiCode += '<a href="#" class="miracle-emoji">' + emoji + '</a>';
  1233. });
  1234.  
  1235. var addEmoji = function () {
  1236. setTimeout(function () {
  1237. var $pasteInput = $(document).find('#miracle-emojis input[name=paste]');
  1238.  
  1239. // Add text into the chatbox and focus it
  1240. $('#chtbox').val($('#chtbox').val() + $pasteInput.val()).focus();
  1241. }, 200);
  1242.  
  1243. $modal.hide();
  1244. };
  1245.  
  1246. var $modal = $('<div id="miracle-emojis" class="miracle-primary-color-font" style="position: fixed; width: 100%; height: 100%; padding: 50px; color: #FF69B4; background-color: rgba(0,0,0,0.95); overflow-y: auto; z-index: 999; display: none"></div>');
  1247. $modal.append('<style>' + css + '</style>');
  1248. $modal.append('<h1>Insert text or emoji</h1>');
  1249. var $pasteInput = $('<input name="paste" value="" placeholder="Click to paste text, or (double)click emoji!" style="width: 300px; max-width: 100%" />');
  1250. $modal.append('<br><br>Insert:<br>', $pasteInput);
  1251. $modal.html($modal.html() + '<br><br>' + emojiCode);
  1252. $modal.append($('<br><a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-top: 20px; padding: 10px; color: white">Add</a>').click(addEmoji));
  1253. $modal.append($('<a href="#" class="miracle-primary-color-background" style="display: inline-block; float: right; margin-top: 20px; padding: 10px; color: white">Cancel</a>').click(function () {
  1254. $modal.hide();
  1255. }));
  1256.  
  1257. $modal.find('input[name=paste]').click(function () {
  1258. var text = window.prompt('Please paste your text here!');
  1259.  
  1260. if (text !== null) {
  1261. var $pasteInput = $modal.find('input[name=paste]');
  1262.  
  1263. // Add text into the paste input
  1264. $pasteInput.val($pasteInput.val() + text);
  1265. }
  1266. });
  1267.  
  1268. $modal.click(function (event) {
  1269. if (event.target.classList.contains('miracle-emoji')) {
  1270. var $target = $(this).find('input[name=paste]');
  1271. $target.val($target.val() + $(event.target).text());
  1272.  
  1273. event.preventDefault();
  1274. }
  1275. });
  1276.  
  1277. $modal.dblclick(function (event) {
  1278. if (event.target.classList.contains('miracle-emoji')) {
  1279. $('#chtbox').val($('#chtbox').val() + $(event.target).text()).focus();
  1280. $(this).hide();
  1281.  
  1282. event.preventDefault();
  1283. }
  1284. });
  1285.  
  1286. $('body').append($modal);
  1287.  
  1288. window.addEventListener('keydown', function (event) {
  1289. // Do nothing if a menu is open
  1290. if (document.getElementById('overlays').style.display !== 'none' || document.getElementById('advert').style.display !== 'none') {
  1291. return;
  1292. }
  1293.  
  1294. if (event.keyCode == self.settings.bindings.paste) {
  1295. $modal.find('input[name=paste]').val('');
  1296. $modal.toggle();
  1297. }
  1298. });
  1299.  
  1300. window.addEventListener('miracleCommand', function(commandEvent) {
  1301. if (commandEvent.command === '/paste') {
  1302. $modal.find('input[name=paste]').val('');
  1303. $modal.toggle();
  1304. $('#chtbox').val('');
  1305. }
  1306. });
  1307. },
  1308.  
  1309. replacements: function () {
  1310. var self = this;
  1311.  
  1312. $('#chtbox').keyup(function () {
  1313. var lines = self.settings.replacements.split('\n');
  1314.  
  1315. var text = $('#chtbox').val();
  1316.  
  1317. lines.forEach(function (line) {
  1318. var replacement = line.split('|');
  1319. if (replacement.length === 2) {
  1320. text = text.replace(replacement[0], replacement[1]);
  1321. $('#chtbox').val(text).focus();
  1322. }
  1323. });
  1324. });
  1325. },
  1326.  
  1327. chatLog: function () {
  1328. var self = this;
  1329.  
  1330. // We escape the message before we print them, so no one can inject JS code!
  1331. var htmlEntities = function (str) {
  1332. return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
  1333. };
  1334.  
  1335. var originalFillText = CanvasRenderingContext2D.prototype.fillText;
  1336. var lastChatNickname = null;
  1337. var lastChatNicknameColor = null;
  1338. var chatLogCode = '';
  1339. var chatLog = [];
  1340. CanvasRenderingContext2D.prototype.fillText = function () {
  1341. if (this.canvas.id !== 'leaderboard' && this.canvas.height === 23) {
  1342. var text = arguments[0];
  1343. var xPos = arguments[1]; // Usually 3 for nicknames but bigger when a crown, donator icon etc. are displayed
  1344. var lineSize = this.canvas.width; // ATTENTION: Not sure if that really is the total size (icons + nickname + message)
  1345.  
  1346. // Sometimes also numbers (int) are printed (probably masses on cells) so we filter for strings
  1347. if (typeof text === 'string' && (this.fillStyle !== '#f5f6ce' && this.fillStyle !== '#444444')) {
  1348. // Dirty fix for the missing icon in the initial welcome messages
  1349. if (text == '') {
  1350. text = '📢';
  1351. }
  1352. lastChatNickname = text;
  1353. lastChatNicknameColor = this.fillStyle;
  1354. }
  1355. if (typeof text === 'string' && (this.fillStyle === '#f5f6ce' || this.fillStyle === '#444444')) {
  1356. // Unfortunately chat messages will be printed more than just once and I don't know
  1357. // how to identify them, so for now all messages will be stored and only new messages will be shown.
  1358. // Of course this means messages won't be shown if they are sent more than once (by the same nickname).
  1359. var found = false;
  1360. for (var i = 0; i < chatLog.length; i++) {
  1361. if (chatLog[i].nickname === lastChatNickname && chatLog[i].nicknameColor === lastChatNicknameColor && chatLog[i].message === text) {
  1362. found = true;
  1363. break;
  1364. }
  1365. }
  1366.  
  1367. if (!found) {
  1368. var legit = text.indexOf(self.watermark) > -1 ? 'class="legit" title="🛡️ This seems to be a legit Miracle Scripts message"' : '';
  1369. // NOTE: We might have to look for the coordinates of the text to find out the order of the messages (somehow)
  1370. chatLogCode += '<div ' + legit + '><span class="time">' + (new Date().toLocaleTimeString()) + '</span> <span class="nickname" style="color: ' + lastChatNicknameColor + '">' + htmlEntities(lastChatNickname) + '</span>';
  1371. chatLogCode += '<span class="message" style="color: #f5f6ce">' + htmlEntities(text) + '</span></div>';
  1372. chatLog.push({nickname: lastChatNickname, nicknameColor: lastChatNicknameColor, message: text});
  1373.  
  1374. var messageEvent = new Event('miracleChatMessage');
  1375. messageEvent.nickname = lastChatNickname;
  1376. messageEvent.nicknameColor = lastChatNicknameColor;
  1377. messageEvent.message = text;
  1378. window.dispatchEvent(messageEvent);
  1379. }
  1380. }
  1381. }
  1382.  
  1383. return originalFillText.apply(this, arguments);
  1384. };
  1385.  
  1386. var performSearch = function (searchElement) {
  1387. var subject = searchElement.value.toLowerCase();
  1388.  
  1389. $('#miracle-complete-chatlog div').each(function () {
  1390. var $entry = $(this);
  1391.  
  1392. if ($entry.text().toLowerCase().indexOf(subject) === -1 && subject != '') {
  1393. $entry.hide();
  1394. } else {
  1395. $entry.show();
  1396. }
  1397. });
  1398. };
  1399.  
  1400. var $modal = $('<div id="miracle-chatlog" class="miracle-primary-color-font" style="position: fixed; width: 100%; height: 100%; padding: 50px; color: #FF69B4; background-color: rgba(0,0,0,0.95); user-select: text; overflow-y: auto; z-index: 999; display: none"></div>');
  1401. $modal.append('<style>#miracle-complete-chatlog div:hover { background-color: rgba(255,255,255,0.1) } #miracle-complete-chatlog .time { padding-right: 10px; color: #666; } #miracle-complete-chatlog div.legit { font-style: italic }</style>');
  1402. $modal.append('<h1>Complete Cellcraft.io Chat Log</h1><br>');
  1403. $modal.append('<div id="miracle-complete-chatlog"></div>');
  1404. $modal.append($('<input type="text" style="display: inline-block; position: fixed; right: 20px; bottom: 20px;" placeholder="Type to search">').keyup(function () {
  1405. performSearch(this);
  1406. }));
  1407. $modal.append($('<br><a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-top: 20px; padding: 10px; color: white">Close Settings</a>').click(function () {
  1408. $modal.hide();
  1409. }));
  1410. $('body').append($modal);
  1411.  
  1412. $('#miracle-complete-chatlog').dblclick(function (event) {
  1413. var $clickTarget;
  1414.  
  1415. // Each chat message is a div with spans in it. Either the spans or the div might be clicked.
  1416. if (event.target.tagName.toLowerCase() === 'span') {
  1417. $clickTarget = $(event.target).parent();
  1418. } else {
  1419. $clickTarget = $(event.target);
  1420. }
  1421.  
  1422. var message = $clickTarget.find('.message').text();
  1423.  
  1424. // Messages usually start with ': ' but we do not want to "translate" it, so we remove it
  1425. if (message.substr(0, 2) === ': ') {
  1426. message = message.substr(2);
  1427. }
  1428.  
  1429. window.open('https://www.deepl.com/translator#en/' + self.settings.targetLanguage + '/' + message);
  1430. });
  1431.  
  1432. var showChatlog = function() {
  1433. $('#miracle-complete-chatlog').html(chatLogCode);
  1434. $modal.toggle();
  1435. $modal.get(0).scrollTo(0, $modal.get(0).scrollHeight);
  1436. };
  1437.  
  1438. window.addEventListener('keyup', function (event) {
  1439. // Ignore text input field so typing in them is possible
  1440. if (self.isWritingText()) {
  1441. return;
  1442. }
  1443.  
  1444. if (event.keyCode == self.settings.bindings.chatLog) {
  1445. showChatlog();
  1446. }
  1447. });
  1448.  
  1449. window.addEventListener('miracleCommand', function(commandEvent) {
  1450. if (commandEvent.command === '/chatlog') {
  1451. showChatlog();
  1452. $('#chtbox').val('');
  1453. }
  1454. });
  1455. },
  1456.  
  1457. favSkins: function () {
  1458. var self = this;
  1459.  
  1460. // We need to have a delay, because the menu is not loaded right away
  1461. setTimeout(function () {
  1462. var favIconClick = function () {
  1463. var id = parseInt($(this).parent().parent().find('button').attr('onclick').substr(11));
  1464.  
  1465. if (self.settings.favSkins.includes(id)) {
  1466. $(this).addClass('skin-not-fav');
  1467. $('#skinUseBtn' + id).parent().find('span').addClass('skin-not-fav');
  1468. var index = self.settings.favSkins.indexOf(id);
  1469. self.settings.favSkins.splice(index, 1);
  1470. } else {
  1471. $(this).removeClass('skin-not-fav');
  1472. self.settings.favSkins.push(id);
  1473. }
  1474. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  1475. renderFavSkins();
  1476. };
  1477.  
  1478. var renderFavSkins = function () {
  1479. var $skins = null;
  1480.  
  1481. if ($('#fav-skins').length > 0) {
  1482. $skins = $('#fav-skins');
  1483. $skins.html('');
  1484. } else {
  1485. $skins = $('<div id="fav-skins" style="background-color: #4d4950"></div>');
  1486. $skins.insertAfter('#publicSkinsHeader');
  1487.  
  1488. $('#fav-skins').click(function (event) {
  1489. if (event.target.tagName.toLowerCase() === 'span') {
  1490. favIconClick.apply(event.target);
  1491. }
  1492. });
  1493. }
  1494. self.settings.favSkins.forEach(function (id) {
  1495. $skins.append('<div style="float: left; padding: 5px;"><img style="border: 1px solid rgba(0,0,0,.25); border-radius: 50%; box-shadow: 0 0 2px #000;" src="skins/' + id + '_lo.png?u=1575650762" alt=""><h4><span style="cursor: pointer">⭐</span></h4><button class="btn btn-primary skinuse-btn" onclick="toggleSkin(' + id + ');">Use</button></div>');
  1496. });
  1497. $skins.append('<div style="clear: both"></div>');
  1498. };
  1499.  
  1500. var addFavIcons = function () {
  1501. var $skins = $('#publicSkinsPage');
  1502. $skins.append('<style>.skin-not-fav { opacity: 0.3 }</style>');
  1503.  
  1504. $skins.find('h4').each(function () {
  1505. var $favIcon = $('<span style="cursor: pointer">⭐</span>');
  1506. var id = parseInt($(this).parent().find('button').attr('onclick').substr(11));
  1507.  
  1508. $favIcon.click(favIconClick);
  1509.  
  1510. $(this).append($favIcon);
  1511.  
  1512. if (! self.settings.favSkins.includes(id)) {
  1513. $favIcon.addClass('skin-not-fav');
  1514. }
  1515. });
  1516. };
  1517. var initialized = false;
  1518. $('#skinsCustomTab, #skinExampleMenu').click(function () {
  1519. if (!initialized) {
  1520. var checkState = function () {
  1521. if ($('#publicSkinsPage').html() !== '') {
  1522. addFavIcons();
  1523. renderFavSkins();
  1524. } else {
  1525. setTimeout(checkState, 30);
  1526. }
  1527. };
  1528. checkState();
  1529. initialized = true;
  1530. }
  1531. });
  1532. $('#phpSkins').click(function (event) {
  1533. if (event.target.classList.contains('publicskins-nav-btn')) {
  1534. addFavIcons();
  1535. }
  1536. });
  1537.  
  1538. }, 500);
  1539. },
  1540.  
  1541. skinChanger: function() {
  1542. var self = this;
  1543.  
  1544. // When the user changes the skin, display ID of the picked skin
  1545. var originalToggleSkin = window.toggleSkin;
  1546. window.toggleSkin = function () {
  1547. self.message('Picked skin with ID ' + arguments[0]);
  1548.  
  1549. return originalToggleSkin.apply(this, arguments);
  1550. };
  1551.  
  1552. var useSkinFromSlot = function (skinSlot, skinId) {
  1553. var skinUri = null;
  1554.  
  1555. if (skinId) {
  1556. if (skinId === 'this' || skinId === 'current' || skinId === 'my' || skinId === 'me' || skinId === 'now' || skinId === 'here') {
  1557. skinUri = self.getSkinUrl();
  1558. skinId = parseInt(skinUri.substr(skinUri.indexOf('skins/') + 6));
  1559.  
  1560. self.message('Skin ' + skinId + ' saved in slot ' + skinSlot + ' ✔️');
  1561. }
  1562.  
  1563. skinId = parseInt(skinId);
  1564. self.settings.quickSkins[skinSlot - 1] = skinId;
  1565. localStorage.setItem('miracleScripts', JSON.stringify(self.settings));
  1566. } else {
  1567. skinId = self.settings.quickSkins[skinSlot - 1];
  1568. if (!skinId) {
  1569. self.message('Skin not set yet, set with /skin' + skinSlot + ' id 😊', true);
  1570. $('#chtbox').val('');
  1571. return;
  1572. }
  1573. }
  1574.  
  1575. if (skinUri === null) {
  1576. self.useSkin(skinId);
  1577. }
  1578.  
  1579. $('#chtbox').val('');
  1580. };
  1581.  
  1582. window.addEventListener('miracleCommand', function(commandEvent) {
  1583.  
  1584. if (commandEvent.command === 'skin1' || commandEvent.command === '/skin1') {
  1585. useSkinFromSlot(1, commandEvent.argument1);
  1586. }
  1587. if (commandEvent.command === 'skin2' || commandEvent.command === '/skin2') {
  1588. useSkinFromSlot(2, commandEvent.argument1);
  1589. }
  1590. if (commandEvent.command === 'skin3' || commandEvent.command === '/skin3') {
  1591. useSkinFromSlot(3, commandEvent.argument1);
  1592. }
  1593. if (commandEvent.command === 'skin4' || commandEvent.command === '/skin4') {
  1594. useSkinFromSlot(4, commandEvent.argument1);
  1595. }
  1596. if (commandEvent.command === 'skin5' || commandEvent.command === '/skin5') {
  1597. useSkinFromSlot(5, commandEvent.argument1);
  1598. }
  1599. if (commandEvent.command === 'skin6' || commandEvent.command === '/skin6') {
  1600. useSkinFromSlot(6, commandEvent.argument1);
  1601. }
  1602. if (commandEvent.command === 'skin7' || commandEvent.command === '/skin7') {
  1603. useSkinFromSlot(7, commandEvent.argument1);
  1604. }
  1605. if (commandEvent.command === 'skin8' || commandEvent.command === '/skin8') {
  1606. useSkinFromSlot(8, commandEvent.argument1);
  1607. }
  1608. if (commandEvent.command === 'skin9' || commandEvent.command === '/skin9') {
  1609. useSkinFromSlot(9, commandEvent.argument1);
  1610. }
  1611. if (commandEvent.command === 'skin10' || commandEvent.command === '/skin10') {
  1612. useSkinFromSlot(10, commandEvent.argument1);
  1613. }
  1614. if (commandEvent.command === 'skin11' || commandEvent.command === '/skin11') {
  1615. useSkinFromSlot(11, commandEvent.argument1);
  1616. }
  1617. if (commandEvent.command === 'skin12' || commandEvent.command === '/skin12') {
  1618. useSkinFromSlot(12, commandEvent.argument1);
  1619. }
  1620. if (commandEvent.command === 'skin13' || commandEvent.command === '/skin13') {
  1621. useSkinFromSlot(13, commandEvent.argument1);
  1622. }
  1623. if (commandEvent.command === 'skin14' || commandEvent.command === '/skin14') {
  1624. useSkinFromSlot(14, commandEvent.argument1);
  1625. }
  1626. if (commandEvent.command === 'skin15' || commandEvent.command === '/skin15') {
  1627. useSkinFromSlot(15, commandEvent.argument1);
  1628. }
  1629. if (commandEvent.command === 'skin16' || commandEvent.command === '/skin16') {
  1630. useSkinFromSlot(16, commandEvent.argument1);
  1631. }
  1632. if (commandEvent.command === 'skin17' || commandEvent.command === '/skin17') {
  1633. useSkinFromSlot(17, commandEvent.argument1);
  1634. }
  1635. if (commandEvent.command === 'skin18' || commandEvent.command === '/skin18') {
  1636. useSkinFromSlot(18, commandEvent.argument1);
  1637. }
  1638. if (commandEvent.command === 'skin19' || commandEvent.command === '/skin19') {
  1639. useSkinFromSlot(19, commandEvent.argument1);
  1640. }
  1641. if (commandEvent.command === 'skin20' || commandEvent.command === '/skin20') {
  1642. useSkinFromSlot(20, commandEvent.argument1);
  1643. }
  1644. if (commandEvent.command === 'skin21' || commandEvent.command === '/skin21') {
  1645. self.message('Only 20 skin slots are available ❌', true);
  1646. $('#chtbox').val('').focus();
  1647. }
  1648. });
  1649.  
  1650. window.addEventListener('keyup', function (event) {
  1651. // Ignore text input field so typing in them is possible
  1652. if (self.isWritingText()) {
  1653. return;
  1654. }
  1655.  
  1656. if (event.keyCode == self.settings.bindings.skin1) {
  1657. useSkinFromSlot(1);
  1658. }
  1659. if (event.keyCode == self.settings.bindings.skin2) {
  1660. useSkinFromSlot(2);
  1661. }
  1662. if (event.keyCode == self.settings.bindings.skin3) {
  1663. useSkinFromSlot(3);
  1664. }
  1665. if (event.keyCode == self.settings.bindings.skin4) {
  1666. useSkinFromSlot(4);
  1667. }
  1668. if (event.keyCode == self.settings.bindings.skin5) {
  1669. useSkinFromSlot(5);
  1670. }
  1671. if (event.keyCode == self.settings.bindings.skin6) {
  1672. useSkinFromSlot(6);
  1673. }
  1674. if (event.keyCode == self.settings.bindings.skin7) {
  1675. useSkinFromSlot(7);
  1676. }
  1677. if (event.keyCode == self.settings.bindings.skin8) {
  1678. useSkinFromSlot(8);
  1679. }
  1680. if (event.keyCode == self.settings.bindings.skin9) {
  1681. useSkinFromSlot(9);
  1682. }
  1683. });
  1684. },
  1685.  
  1686. ultraSplit: function() {
  1687. var self = this;
  1688.  
  1689. window.addEventListener('keyup', function () {
  1690. if (event.keyCode == self.settings.bindings.ultraSplit) {
  1691. var tripleSplit = function() {
  1692. window.onkeydown({keyCode: self.hotkeys.T.c});
  1693. window.onkeyup({keyCode: self.hotkeys.T.c});
  1694. }
  1695.  
  1696. tripleSplit();
  1697. window.setTimeout(function() {
  1698. tripleSplit();
  1699. window.setTimeout(function() {
  1700. tripleSplit();
  1701. }, 150);
  1702. }, 150);
  1703. }
  1704. });
  1705. },
  1706.  
  1707. lineSplit: function() {
  1708. var self = this;
  1709.  
  1710. window.addEventListener('miracleCommand', function(commandEvent) {
  1711. if (commandEvent.command === '/linesplit') {
  1712. self.lineSplitAt = Date.now();
  1713. self.message('Linesplit •••••');
  1714.  
  1715. var doSplit = function() {
  1716. if (Date.now() - self.lineSplitAt < 1000) {
  1717. var factor = Math.min((Date.now() - self.lineSplitAt) / 700, 1);
  1718. var x = window.innerWidth / 2;
  1719. var y = factor * (window.innerHeight / 2);
  1720.  
  1721. $('canvas').trigger($.Event('mousemove', {clientX: x, clientY: y}));
  1722.  
  1723. window.requestAnimationFrame(doSplit);
  1724. } else {
  1725. if (Date.now() - self.lineSplitAt < 3000) {
  1726. if (self.splitAt === undefined || Date.now() - self.splitAt > 200) {
  1727. $('body').trigger($.Event('keydown', { keyCode: self.hotkeys.Space.c}));
  1728. $('body').trigger($.Event('keyup', { keyCode: self.hotkeys.Space.c}));
  1729. self.splitAt = Date.now();
  1730. }
  1731.  
  1732. window.requestAnimationFrame(doSplit);
  1733. }
  1734. }
  1735. };
  1736. doSplit();
  1737. $('#chtbox').val('');
  1738. }
  1739. });
  1740. },
  1741.  
  1742. halt: function() {
  1743. var self = this;
  1744.  
  1745. // Stop halt on respawn
  1746. window.addEventListener('keydown', function (event) {
  1747. if (self.hotkeys && event.keyCode == self.hotkeys.M.c && ! self.isWritingText()) {
  1748. self.onHalt = false;
  1749. }
  1750. });
  1751.  
  1752. var initHalt = function() {
  1753. // Do nothing if a menu is open
  1754. if (document.getElementById('overlays').style.display !== 'none' || document.getElementById('advert').style.display !== 'none') {
  1755. return;
  1756. }
  1757.  
  1758. self.onHalt = ! self.onHalt;
  1759.  
  1760. if (self.onHalt) {
  1761. self.performHalt.apply(self);
  1762. }
  1763. };
  1764.  
  1765. window.addEventListener('keyup', function () {
  1766. if (event.keyCode == self.settings.bindings.halt) {
  1767. if (self.isWritingText()) {
  1768. return;
  1769. }
  1770. initHalt();
  1771. }
  1772. });
  1773.  
  1774. window.addEventListener('miracleCommand', function(commandEvent) {
  1775. if (commandEvent.command === '/halt') {
  1776. initHalt();
  1777. $('#chtbox').val('');
  1778. }
  1779. });
  1780. },
  1781.  
  1782. performHalt: function () {
  1783. var self = this ? this : window.miracleScripts;
  1784.  
  1785. if (self.haltMoveDirection === undefined) {
  1786. self.haltMoveDirection = 1;
  1787. }
  1788. self.haltMoveDirection = -self.haltMoveDirection;
  1789.  
  1790. var centerX = window.innerWidth / 2;
  1791. var centerY = window.innerHeight / 2;
  1792. var angle = self.getAngle(centerX, centerY, self.mouse.x, self.mouse.y);
  1793. if (self.haltMoveDirection === 1) {
  1794. angle = self.addAngle(angle, 180); // Invert angle
  1795. }
  1796. angle = self.addAngle(angle, 270);
  1797. var distance = 1000000;
  1798. var x = centerX + Math.cos(angle * Math.PI / 180) * distance;
  1799. var y = centerY + Math.sin(angle * Math.PI / 180) * distance;
  1800. $('canvas').trigger($.Event('mousemove', {clientX: x, clientY: y}));
  1801.  
  1802. // Stop halt if dead ... to avoid continuing halt after next respawn
  1803. if (document.getElementById('advert').style.display !== 'none') {
  1804. self.onHalt = false;
  1805. }
  1806. if (self.onHalt) {
  1807. window.requestAnimationFrame(self.performHalt);
  1808. }
  1809. },
  1810.  
  1811. dance: function () {
  1812. var self = this;
  1813.  
  1814. // Stop dancing on respawn
  1815. window.addEventListener('keydown', function (event) {
  1816. if (self.hotkeys && event.keyCode == self.hotkeys.M.c && ! self.isWritingText()) {
  1817. self.dancing = false;
  1818. }
  1819. });
  1820.  
  1821. var initDance = function() {
  1822. // Do nothing if a menu is open
  1823. if (document.getElementById('overlays').style.display !== 'none' || document.getElementById('advert').style.display !== 'none') {
  1824. return;
  1825. }
  1826.  
  1827. self.dancing = ! self.dancing;
  1828.  
  1829. if (self.dancing) {
  1830. self.performDance.apply(self);
  1831. }
  1832. };
  1833.  
  1834. window.addEventListener('keyup', function () {
  1835. if (event.keyCode == self.settings.bindings.dance) {
  1836. initDance();
  1837. }
  1838. });
  1839.  
  1840. window.addEventListener('miracleCommand', function(commandEvent) {
  1841. if (commandEvent.command === '/dance') {
  1842. initDance();
  1843. $('#chtbox').val('');
  1844. }
  1845. });
  1846. },
  1847.  
  1848. performDance: function () {
  1849. var self = this ? this : window.miracleScripts;
  1850.  
  1851. if (self.danceAngle === undefined) {
  1852. self.danceAngle = 0;
  1853. }
  1854.  
  1855. self.danceAngle += 20;
  1856.  
  1857. if (self.danceAngle > 360) {
  1858. self.danceAngle = 0;
  1859. }
  1860.  
  1861. var distance = 1000000;
  1862. var x = window.innerWidth / 2 + Math.sin(self.danceAngle * Math.PI / 180) * distance;
  1863. var y = window.innerHeight / 2 + Math.cos(self.danceAngle * Math.PI / 180) * distance;
  1864. $('canvas').trigger($.Event('mousemove', {clientX: x, clientY: y}));
  1865.  
  1866. // Stop dancing if dead ... to avoid continuing dancing after next respawn
  1867. if (document.getElementById('advert').style.display !== 'none') {
  1868. self.dancing = false;
  1869. }
  1870. if (self.dancing) {
  1871. window.requestAnimationFrame(self.performDance);
  1872. }
  1873. },
  1874.  
  1875. waste: function() {
  1876. var self = this;
  1877.  
  1878. window.addEventListener('keydown', function (event) {
  1879. if (self.hotkeys && event.keyCode == self.hotkeys.M.c && ! self.isWritingText()) {
  1880. self.wasting = false;
  1881. }
  1882. });
  1883.  
  1884. window.addEventListener('miracleCommand', function(commandEvent) {
  1885. if (commandEvent.command === '/waste') {
  1886. if (self.wasting) {
  1887. self.wasting = false;
  1888. self.message('Stopped wasting all mass.');
  1889. self.dancing = false;
  1890. } else {
  1891. self.wasting = true;
  1892. self.message('Wasting all mass... 💥');
  1893. if (! self.dancing) {
  1894. self.dancing = true;
  1895. self.performDance.apply(self);
  1896. }
  1897. $('#chtbox').val('spinshakeflip').focus();
  1898. }
  1899.  
  1900. var doWaste = function() {
  1901. // Stop wasting mass if dead ... to avoid continuing wasting after next respawn
  1902. if (document.getElementById('advert').style.display !== 'none') {
  1903. self.wasting = false;
  1904. }
  1905. if (! self.wasting) {
  1906. return;
  1907. }
  1908. $('body').trigger($.Event('keydown', { keyCode: self.hotkeys.W.c}));
  1909. $('body').trigger($.Event('keyup', { keyCode: self.hotkeys.W.c}));
  1910. window.requestAnimationFrame(doWaste);
  1911. };
  1912. doWaste();
  1913. }
  1914. });
  1915. },
  1916.  
  1917. fpsPing: function () {
  1918. var self = this;
  1919.  
  1920. window.addEventListener('miracleCommand', function(commandEvent) {
  1921. if (commandEvent.command === 'ping' || commandEvent.command === '/ping' || commandEvent.command === '/lag') {
  1922. window.setFPS(1);
  1923. var pingRating = 'Extremely bad! ❌', ping = $('#ping').text();
  1924. if (parseInt(ping) > 0) {
  1925. if (parseInt(ping) >= 0 && parseInt(ping) < 35) { pingRating = 'Perfect! ✔️'; }
  1926. if (parseInt(ping) >= 35 && parseInt(ping) < 70) { pingRating = 'Good! ✔️'; }
  1927. if (parseInt(ping) >= 70 && parseInt(ping) < 120) { pingRating = 'Acceptable! ✔️'; }
  1928. if (parseInt(ping) >= 120 && parseInt(ping) < 200) { pingRating = 'Bad! ❌'; }
  1929. if (parseInt(ping) >= 200 && parseInt(ping) < 990) { pingRating = 'Insanity! ❌'; }
  1930. if (parseInt(ping) >= 990 && parseInt(ping) < 4900) { pingRating = 'THIS IS MADNESS! ❌'; }
  1931. if (parseInt(ping) > 4900) { pingRating = 'M M M M M M M M M MONSTERPING! ❌'; }
  1932. } else {
  1933. ping = '∞ (infinite) ';
  1934. }
  1935. $('#chtbox').val('has a ping of: ' + ping + '. ' + pingRating + self.watermark).focus();
  1936. }
  1937. if (commandEvent.command === 'fps' || commandEvent.command === '/fps') {
  1938. window.setFPS(1);
  1939. var fpsRating = 'Perfect! ✔️', fps = $('#fps').text();
  1940. if (parseInt(fps) > 0) {
  1941. if (fps >= 0 && fps < 10) { fpsRating = 'Extremely bad! ❌'; }
  1942. if (fps >= 10 && fps < 30) { fpsRating = 'Bad! ❌'; }
  1943. if (fps >= 30 && fps < 40) { fpsRating = 'Acceptable! ✔️'; }
  1944. if (fps >= 40 && fps < 57) { fpsRating = 'Good! ✔️'; }
  1945. if (fps > 73) { fpsRating = 'Outstanding! ✔️'; }
  1946. if (fps > 97) { fpsRating = 'Fantastic! ✔️'; }
  1947. if (fps > 117) { fpsRating = 'GODLIKE! ✔️'; }
  1948. } else {
  1949. fpsRating = '';
  1950. }
  1951.  
  1952. $('#chtbox').val('has ' + fps + 'fps. ' + fpsRating + self.watermark).focus();
  1953. }
  1954. });
  1955. },
  1956.  
  1957. timer: function() {
  1958. var self = this;
  1959.  
  1960. var timerStartedAt = null;
  1961. var timerMinutes = null;
  1962. var timeoutId = null;
  1963. var updateId = null;
  1964.  
  1965. // Note: The "settings" item is missing in the local storage until settings have been changed
  1966. var agmaSettings = localStorage.getItem('settings') ? JSON.parse(localStorage.getItem('settings')) : { sDark : false };
  1967. var color = (agmaSettings.sDark) ? '#999' : '#3e3e3e';
  1968. var $timeUi = $('<div style="position: fixed; right: 20px; bottom: 230px; z-index: 998; color: ' + color + '; pointer-events: none"></div>');
  1969. $('body').append($timeUi);
  1970.  
  1971.  
  1972. var updateUi = function () {
  1973.  
  1974. var time = '';
  1975. if (self.settings.showClock) {
  1976. var hours = (new Date).getHours();
  1977. var minutes = (new Date).getMinutes();
  1978. time = (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes);
  1979. if (timeoutId) {
  1980. time = ' - ' + time;
  1981. }
  1982. }
  1983.  
  1984. var remaining = '';
  1985. if (timeoutId) {
  1986. remaining = Math.ceil(((timerStartedAt + timerMinutes * 60 * 1000) - Date.now()) / 1000 / 60) + 'm';
  1987. }
  1988.  
  1989. if (time || remaining) {
  1990. $timeUi.text('🕒 ' + remaining + time);
  1991. } else {
  1992. $timeUi.text('');
  1993. }
  1994. };
  1995. updateUi();
  1996. updateId = setInterval(updateUi, 2000);
  1997.  
  1998. window.addEventListener('miracleCommand', function(commandEvent) {
  1999. if (commandEvent.command === 'timer' || commandEvent.command === '/timer') {
  2000. var argument1 = commandEvent.argument1;
  2001. var argument2 = commandEvent.argument2;
  2002.  
  2003. if (argument1) {
  2004. timerMinutes = parseInt(argument1);
  2005. if (argument2 === 'h' || argument2 === 'hour' || argument2 === 'hours') {
  2006. timerMinutes *= 60;
  2007. }
  2008. if (timeoutId !== null) {
  2009. clearTimeout(timeoutId);
  2010. }
  2011.  
  2012. if (argument1 === '0' || argument1 === 'reset' || argument1 === 'stop' || argument1 === 'clear' || argument1 === 'remove') {
  2013. self.message('🗑️ Timer removed');
  2014. } else {
  2015. timerStartedAt = Date.now();
  2016. timeoutId = setTimeout(function () {
  2017. timeoutId = null;
  2018. updateUi()
  2019. var message = '🕒 Alert! Timer has expired after ' + timerMinutes + ' minutes.';
  2020. self.message(message);
  2021. self.swal('Time has expired', '🕒 Alert! Timer has expired after ' + timerMinutes + ' minutes.');
  2022. }, timerMinutes * 60 * 1000);
  2023. updateUi();
  2024.  
  2025. self.message('🕒 Timer set to ' + timerMinutes + ' minutes');
  2026. }
  2027. } else {
  2028. if (timeoutId === null) {
  2029. self.message('🕒 No timer has been set. Set with: /timer minutes', true);
  2030. } else {
  2031. var remaining = ((timerStartedAt + timerMinutes * 60 * 1000) - Date.now()) / 1000 / 60;
  2032. self.message('🕒 ' + Math.round(remaining * 10) / 10 + ' minutes remaining.');
  2033. }
  2034. }
  2035. $('#chtbox').val('').focus();
  2036. }
  2037. });
  2038. },
  2039.  
  2040. alive: function() {
  2041. var self = this;
  2042.  
  2043. var element = document.getElementById('playBtn');
  2044. element.addEventListener('click', function() {
  2045. if (! self.isAlive) {
  2046. self.spawnedAt = Date.now();
  2047. self.isAlive = true;
  2048. }
  2049. });
  2050. element = document.querySelector('.bottom-dashboard-box img[title=Respawn]');
  2051. element.addEventListener('click', function() {
  2052. self.spawnedAt = Date.now();
  2053. self.isAlive = true;
  2054. });
  2055. element = document.getElementById('advertContinue');
  2056. element.addEventListener('click', function() {
  2057. self.isAlive = false;
  2058. });
  2059.  
  2060. window.addEventListener('keydown', function (event) {
  2061. if (self.hotkeys && event.keyCode == self.hotkeys.M.c && ! self.isWritingText()) {
  2062. self.spawnedAt = Date.now();
  2063. self.isAlive = true;
  2064. }
  2065. });
  2066.  
  2067. window.addEventListener('miracleCommand', function(commandEvent) {
  2068. if (commandEvent.command === '/alive' || commandEvent.command === 'alive') {
  2069. var minutes = parseInt((Date.now() - self.spawnedAt) / 1000 / 60);
  2070. if (minutes < 1) {
  2071. minutes = parseInt((Date.now() - self.spawnedAt) / 1000) + ' Seconds & 0';
  2072. }
  2073. if (minutes > 60) {
  2074. minutes = parseInt(minutes / 60) + ' Hours & ' + (minutes % 60);
  2075. }
  2076.  
  2077. if (! self.isAlive || document.getElementById('advert').style.display !== 'none') {
  2078. if (isNaN(minutes)) {
  2079. $('#chtbox').val('is not alive ☠️');
  2080. } else {
  2081. $('#chtbox').val('is not alive but spawned ' + minutes + ' Minutes ago' + self.watermark);
  2082. }
  2083. } else {
  2084. $('#chtbox').val('has been alive for ' + minutes + ' Minutes' + self.watermark);
  2085. }
  2086. }
  2087. });
  2088.  
  2089. },
  2090.  
  2091. guessing: function() {
  2092. var self = this;
  2093.  
  2094. var guessItem = null;
  2095. var startedAt = null;
  2096. var timeout = null;
  2097. var roundLength = 60 * 1000;
  2098. var library = [ // LMAO.... go away, no cheating please! 🙄
  2099. ['🌞🌼', 'Sunflower', 1],
  2100. ['🌧️🏹', 'Rainbow', 1],
  2101. ['🌧️📅', 'Rainy day', 3],
  2102. ['❄️👑', 'Ice Queen', 3],
  2103. ['🦶⚽', 'Football', 1],
  2104. ['🌙💡', 'Moonlight', 2],
  2105. ['🌞💡', 'Sunlight', 2],
  2106. ['😱🎥', 'Horror movie', 3],
  2107. ['👨🐺', 'Werewolf', 2],
  2108. ['🐮👦', 'Cowboy', 1],
  2109. ['🌌🚢', 'Spaceship', 2],
  2110. ['🔥👨', 'Fireman', 2],
  2111. ['🔥⚔️', 'Firefighter', 2],
  2112. ['🔵🍓', 'Blueberry', 3],
  2113. ['🔥🐶', 'Hotdog', 2],
  2114. ['📹🎮', 'Video game', 4],
  2115. ['⭕💺', 'Wheelchair', 3],
  2116. ['🌚🚶', 'Moonwalk', 3],
  2117. ['🔒🏠', 'Secret room', 4],
  2118. ['🔴🦠', 'Mothercell', 5],
  2119. ['📺👨', 'YouTuber', 3],
  2120. ['🚶💀', 'Walking Dead', 3],
  2121. ['🔥🚧', 'Fireworks', 4],
  2122. ['🧺⚽', 'Basketball', 2],
  2123. ['🍯🌙', 'Honeymoon', 2],
  2124. ['🤗🚢', 'Friendship', 3],
  2125. ['👪💼', 'Teamwork', 4],
  2126. ['🧀🍔', 'Cheeseburger', 2],
  2127. ['❄️⚽', 'Snowball', 1],
  2128. ['👑👨', 'Gold member', 4],
  2129. ['❄️⚪', 'Snow white', 4],
  2130. ['⛰️💡', 'Highlight', 4],
  2131. ['💀🌍', 'Unwerworld', 4],
  2132. ['🔵☁️', 'Blue sky', 3],
  2133. ['⚡🌧️', 'Thunderstorm', 3],
  2134. ['🔴🔴🔴🔴🔴', 'Line split', 2],
  2135. ];
  2136.  
  2137. window.addEventListener('miracleCommand', function(commandEvent) {
  2138. if (commandEvent.command === '/guess') {
  2139. if (startedAt !== null && Date.now() - startedAt < roundLength) {
  2140. self.message('🚫 Wait a little longer (' + Math.ceil((roundLength - (Date.now() - startedAt)) / 1000) + ' seconds)', true);
  2141. $('#chtbox').val('');
  2142. return;
  2143. }
  2144.  
  2145. guessItem = library[self.getRandomInt(0, library.length - 1)];
  2146.  
  2147. var hint = '';
  2148. if (guessItem[2] !== null) {
  2149. hint = guessItem[1];
  2150. hint = self.fonts['monospace'](hint.charCodeAt(0)) + hint.substr(1);
  2151. for (var i = 1; i < guessItem[2]; i++) {
  2152. var pos = self.getRandomInt(0, hint.length);
  2153. hint = hint.substr(0, pos) +
  2154. self.fonts['monospace'](hint.charCodeAt(pos)) +
  2155. hint.substr(pos + 1);
  2156. }
  2157. hint = hint.replace(/(\w)/gi, '_ ');
  2158. hint = ' → ' + hint;
  2159. }
  2160.  
  2161. $('#chtbox').val('𝘎𝘶𝘦𝘴𝘴 𝘸𝘩𝘢𝘵 𝘵𝘩𝘪𝘴 𝘪𝘴: ' + guessItem[0] + hint);
  2162.  
  2163. startedAt = Date.now();
  2164. timeout = setTimeout(function() {
  2165. self.message('Guessing game ended without a winner. The word was: "' + guessItem[1] + '"');
  2166. self.swal('Miracle Guessing Game', 'Guessing game ended without a winner. The word was: "<span style="color: silver">' + guessItem[1] + '</span>"');
  2167. }, roundLength);
  2168. }
  2169. });
  2170.  
  2171. window.addEventListener('miracleChatMessage', function(messageEvent) {
  2172. if (startedAt !== null && Date.now() - startedAt <= roundLength) {
  2173. if (messageEvent.message.toLowerCase().trim().replace(/\s/g, '') === ':' + guessItem[1].toLowerCase()) {
  2174. $('#chtbox').val('𝘎𝘶𝘦𝘴𝘴𝘪𝘯𝘨 𝘨𝘢𝘮𝘦 𝘸𝘰𝘯 𝘣𝘺 𝘱𝘭𝘢𝘺𝘦𝘳 ' + messageEvent.nickname);
  2175. self.message('Guessing game won by player "' + messageEvent.nickname + '"!');
  2176. self.swal('Miracle Guessing Game', 'Guessing game won by "<span style="color: ' + messageEvent.nicknameColor + '">' + messageEvent.nickname + '</span>"!');
  2177. startedAt = null;
  2178. clearTimeout(timeout);
  2179. }
  2180. }
  2181. });
  2182. },
  2183.  
  2184. nameColor: function() {
  2185. var self = this;
  2186.  
  2187. window.addEventListener('miracleCommand', function(commandEvent) {
  2188. if (commandEvent.command === '/namecolor' || commandEvent.command === '/colorname' || commandEvent.command === '/colorchange') {
  2189. self.message('🚫 Changing the name color is no longer possible as there is a server-side fix', true);
  2190. $('#chtbox').val('');
  2191. }
  2192. });
  2193. },
  2194.  
  2195. wearablesToggle: function() {
  2196. var self = this;
  2197.  
  2198. // Note: Doesn't get updated, so we can only use it to init
  2199. var checked = document.getElementById('cWearables').checked;
  2200.  
  2201. window.addEventListener('keydown', function () {
  2202. // Ignore text input field so typing in them is possible
  2203. if (self.isWritingText()) {
  2204. return;
  2205. }
  2206.  
  2207. if (event.keyCode == self.settings.bindings.wearables) {
  2208. checked = ! checked;
  2209. window.setWearables(checked);
  2210. }
  2211. });
  2212. },
  2213.  
  2214. keyboardLayout: function() {
  2215. if (this.settings.showKeyboardLayout && this.hotkeys) {
  2216. var $element = $('<table id="keyboard-layout" style="position: fixed; right: 10px; top: 345px; border-collapse: separate; border-spacing: 10px 0; text-align: right; pointer-events: none;">' +
  2217. '<tr><td>Split: </td><td>&nbsp;&nbsp;' + this.hotkeys.Space.d + '</td></tr>' +
  2218. '<tr><td>Double Split: </td><td>' + this.hotkeys.D.d + '</td></tr>' +
  2219. '<tr><td>Triple Split: </td><td>' + this.hotkeys.T.d + '</td></tr>' +
  2220. '<tr><td>Macro Split: </td><td>' + this.hotkeys.Z.d + '</td></tr>' +
  2221. '<tr><td>Ultra Split: </td><td>' + this.keyboardMap[this.settings.bindings.ultraSplit] + '</td></tr>' +
  2222. '<tr><td>Feed: </td><td>' + this.hotkeys.W360.d + '</td></tr>' +
  2223. '<tr><td>Respawn: </td><td>' + this.hotkeys.M.d + '</td></tr>' +
  2224. '<tr><td>Recombine: </td><td>' + this.hotkeys.E.d + '</td></tr>' +
  2225. '<tr><td>2x Speed: </td><td>' + this.hotkeys.S.d + '</td></tr>' +
  2226. '<tr><td>Freeze Self: </td><td>' + this.hotkeys.F.d + '</td></tr>' +
  2227. '<tr><td>Invisibility: </td><td>' + this.hotkeys.I.d + '</td></tr>' +
  2228. '<tr><td>Toogle Camera: </td><td>' + this.hotkeys.Q.d + '</td></tr>' +
  2229. '</table>');
  2230.  
  2231.  
  2232. $element.insertAfter($('#leaderboard'));
  2233. }
  2234. },
  2235.  
  2236. nameCopier: function() {
  2237. var $copyNameItem = $('<li class="contextmenu-item enabled"><div class="context-icon"><i class="fa fa-copy"></i></div><p>Copy Name To Chat</p></li>');
  2238. $copyNameItem.insertAfter('#contextSpectate');
  2239. var showNoPlayerSelectedMessage = function (message, isError) {
  2240. var curser = document.querySelector('#curser');
  2241.  
  2242. curser.textContent = message;
  2243. curser.style.display = 'block';
  2244. curser.style.color = isError ? 'rgb(255, 0, 0)' : 'rgb(255, 0, 0)';
  2245.  
  2246. window.setTimeout(function () {
  2247. curser.style.display = 'none';
  2248. }, 5000);
  2249. }
  2250.  
  2251. $copyNameItem.click(function() {
  2252. if ($('#contextPlayerName').text().trim() === '(no player selected)'){
  2253. showNoPlayerSelectedMessage('You didn\'t select a player!');
  2254. }else{
  2255. $('#chtbox').val($('#chtbox').val() + $('#contextPlayerName').text().trim()).focus();
  2256. $('#settingsBtn').click();
  2257. setTimeout(function(){$('#settingsBtn').click();},20);}
  2258. });
  2259. },
  2260.  
  2261. skinApplier: function() {
  2262. var self = this;
  2263.  
  2264. var $useWearablesItem = $('<li class="contextmenu-item enabled"><div class="context-icon"><i class="fa fa-graduation-cap"></i></div><p>Use Player\'s Wearables</p></li>');
  2265. $useWearablesItem.insertAfter('#contextPlayer');
  2266. var $useSkinItem = $('<li class="contextmenu-item enabled"><div class="context-icon"><i class="fa fa-eye"></i></div><p>Use Player\'s Skin</p></li>');
  2267. $useSkinItem.insertAfter('#contextPlayer');
  2268.  
  2269. $useSkinItem.click(function() {
  2270. var skinUrl = self.getSkinUrl('#contextPlayerSkin');
  2271. if (skinUrl === null) {
  2272. self.message('This player does not use a skin or no player selected 🚫', true);
  2273. } else {
  2274. var skinId = parseInt(skinUrl.substr(22)); // Cut off "https://agma.io/skins/"
  2275. self.useSkin(skinId);
  2276. }
  2277. });
  2278.  
  2279. $useWearablesItem.click(function() {
  2280. var extractWearableId = function(style) {
  2281. var pos = style.indexOf('background-image: url("wearables/');
  2282. if (pos === -1) {
  2283. return null;
  2284. }
  2285. return parseInt(style.substr(pos + 33));
  2286. }
  2287.  
  2288. var wearables = [
  2289. extractWearableId($('#contextPlayerWear1').attr('style')),
  2290. extractWearableId($('#contextPlayerWear2').attr('style')),
  2291. extractWearableId($('#contextPlayerWear3').attr('style')),
  2292. extractWearableId($('#contextPlayerWear4').attr('style')),
  2293. extractWearableId($('#contextPlayerWear5').attr('style')),
  2294. ];
  2295.  
  2296. var useWearables = function(wearables) {
  2297. window.azad(true);
  2298.  
  2299. setTimeout(function () {
  2300. $('#skinExampleMenu').click();
  2301.  
  2302.  
  2303. setTimeout(function () {
  2304.  
  2305. $('#wearablesTab a').click()
  2306.  
  2307. setTimeout(function () {
  2308. // First remove all current wearables
  2309. var oldWearables = [
  2310. extractWearableId($('#wearExampleShop1').attr('style')),
  2311. extractWearableId($('#wearExampleShop2').attr('style')),
  2312. extractWearableId($('#wearExampleShop3').attr('style')),
  2313. extractWearableId($('#wearExampleShop4').attr('style')),
  2314. extractWearableId($('#wearExampleShop5').attr('style')),
  2315. ]
  2316. oldWearables.forEach(function(id) {
  2317. //toggleWearable(id, 0, 0, 0, false);
  2318. $('#wearableUseBtn' + id).click();
  2319. });
  2320.  
  2321.  
  2322. wearables.forEach(function(id) {
  2323. $('#wearableUseBtn' + id).click();
  2324. });
  2325.  
  2326. setTimeout(function () {
  2327. $('#shopModalDialog button.close').click();
  2328.  
  2329. setTimeout(function () {
  2330. window.setNick(document.getElementById('nick').value);
  2331. }, 200);
  2332. }, 200);
  2333. }, 1000);
  2334.  
  2335. }, 200);
  2336. }, 200);
  2337. }
  2338. useWearables(wearables);
  2339. });
  2340. },
  2341.  
  2342. help: function() {
  2343. $('body').append('<style>#miracle-help-table tr { cursor: pointer } #miracle-help-table table tr:hover { background-color: rgba(255,255,255,0.1) } #miracle-help-button:hover { background: rgba(68,68,68,.8); color: #ffdd67; cursor: pointer } #miracle-help-button { position: absolute; z-index: 10; bottom: 10px; left: 480px; height: 30px; width: 30px; background: rgba(68,68,68,.5); color: #cbb059; }</style>');
  2344. var $modal = $('<div class="miracle-primary-color-font" style="position: fixed; overflow-y: scroll; width: 100%; height: 100%; padding: 50px; background-color: rgba(0,0,0,0.95); z-index: 999; display: none"></div>');
  2345. $modal.append('<h1>Miracle Scripts Help</h1>');
  2346.  
  2347. var helpText = '<br><span style="color: #717171">These chat commands are available. Click on a command to use it!</span><br><br><table id="miracle-help-table"><tr><td><table>' +
  2348. '<tr><th style="padding-right: 70px"><i>Command</i></th><th><i>Description</i></th></tr>' +
  2349. '<tr><td><code>/help</code></td><td>Show this help</td></tr>' +
  2350. '<tr><td><code>/miracle</code></td><td>Show version info</td></tr>' +
  2351. '<tr><td><code>/miraclesettings</code></td><td>Show the miracle settings page</td></tr>' +
  2352. '<tr><td><code>/players</code></td><td>Display how many players are online</td></tr>' +
  2353. '<tr><td><code>/skin&lt;n></code></td><td>Change to skin &lt;n> (1-20)</td></tr>' +
  2354. '<tr><td><code>/skin&lt;n> this</code></td><td>Store current skin as skin <n></td></tr>' +
  2355. '<tr><td><code>/skin&lt;n> &lt;id></code></td><td>Store skin with ID &lt;id> as skin &lt;n> (1-20)</td></tr>' +
  2356. '<tr><td><code>/skinid</code></td><td>Send a chat message with your skin ID</td></tr>' +
  2357. '<tr><td><code>/useskin &lt;id></code></td><td>Use skin with the given ID</td></tr>' +
  2358. '<tr><td><code>/chatlog</code></td><td>Show the extended chat log</td></tr>' +
  2359. '<tr><td><code>/say &lt;text></code></td><td>Send a chat message with a fancy font</td></tr>' +
  2360. '<tr><td><code>/say&lt;n> &lt;text></code></td><td>Send chat message with fancy font number &lt;n> (1-7)</td></tr>' +
  2361. '<tr><td><code>/shout &lt;text></code></td><td>Purchase a megaphone shout for 20000 coins</td></tr>' +
  2362. '<tr><td><code>/paste</code></td><td>Show the emojis and text paste page</td></tr>' +
  2363. '<tr><td><code>/timer &lt;n></code></td><td>Set timer for &lt;n> minutes</td></tr>' +
  2364. '<tr><td><code>/timer &lt;n> h</code></td><td>Set timer for &lt;n> hours</td></tr>' +
  2365. '<tr><td><code>/timer stop</code></td><td>Stop the timer</td></tr>' +
  2366. '<tr><td><code>/xp</code></td><td>Send a chat message with your level and next level\'s progress</td></tr>' +
  2367. '<tr><td><code>/powerups</code></td><td>Send a chat message with your powerup amounts</td></tr>' +
  2368. '<tr><td><code>/fps</code></td><td>Send a chat message with current fps</td></tr>' +
  2369. '<tr><td><code>/ping</code></td><td>Send a chat message with current ping</td></tr>' +
  2370. '<tr><td><code>/online</code></td><td>For how long are you online in the current session?</td></tr>' +
  2371. '<tr><td><code>/alive</code></td><td>For how long are you alive?</td></tr>' +
  2372. '<tr><td><code>/solo</code></td><td>Show the solo server message</td></tr>' +
  2373. '<tr><td><code>/dice</code></td><td>Roll a die with 6 sides</td></tr>' +
  2374. '<tr><td><code>/dice &lt;n></code></td><td>Roll a die with &lt;n> sides</td></tr>' +
  2375. '<tr><td><code>/guess</code></td><td>Start a guessing chat game</td></tr>' +
  2376. '<tr><td><code>/linesplit</code></td><td>Let your cell make a linesplit</td></tr>' +
  2377. '<tr><td><code>/waste</code></td><td>Waste all your mass</td></tr>' +
  2378. '<tr><td><code>/dance</code></td><td>Let your cell dance</td></tr>' +
  2379. '<tr><td><code>/halt</code></td><td>Let your cells stop moving</td></tr>' +
  2380.  
  2381.  
  2382. '</table></td><td style="vertical-align: top"><table>' +
  2383. '<tr><th style="padding-right: 70px"><i>Command</i></th><th><i>Description</i></th></tr>' +
  2384. '<tr><td><code>/coins</code></td><td>Send a chat message with your coins</td></tr>' +
  2385. '<tr><td><code>/level</code></td><td>Send a chat message with your account level</td></tr>' +
  2386. '<tr><td><code>/rank</code></td><td>Send a chat message with your account rank</td></tr>' +
  2387. '<tr><td><code>/hours</code></td><td>Send a chat message with the time you played</td></tr>' +
  2388. '<tr><td><code>/shake</code></td><td>Let your cells shake!</td></tr>' +
  2389. '<tr><td><code>/flip</code></td><td>Let your cells flip!</td></tr>' +
  2390. '<tr><td><code>/spin</code></td><td>Let your cells spin!</td></tr>' +
  2391. '<tr><td><code>/jump</code></td><td>Let your cells jump!</td></tr>' +
  2392. '<tr><td><code>/wacky</code></td><td>Your cells will be laughing faces!</td></tr>' +
  2393. '<tr><td><code>/stats</code></td><td>Show your battle royale stats</td></tr>' +
  2394. '<tr><td><code>/party &lt;message></code></td><td>Write a message to your party</td></tr>' +
  2395. '<tr><td><code>/pm &lt;account></code></td><td>Write a message to a given account</td></tr>' +
  2396. '</table></td></tr></table>';
  2397.  
  2398. $modal.append(helpText);
  2399.  
  2400. $modal.append($('<br><a href="#" class="miracle-primary-color-background" style="display: inline-block; margin-top: 20px; padding: 10px; color: white">Close</a>').click(function () {
  2401. $modal.hide();
  2402. }));
  2403.  
  2404. $('body').append($modal);
  2405.  
  2406. this.$helpModal = $modal;
  2407.  
  2408. $('#miracle-help-table table tr').click(function() {
  2409. var cmd = $(this).find('code').text();
  2410. $('#chtbox').val($('#chtbox').val() + cmd).focus();
  2411. $modal.hide();
  2412. });
  2413.  
  2414. var $helpButton = $('<div id="miracle-help-button" title="Help" class="unselectable"><i class="fa fa-question-circle" style="position: absolute; top: 4px; left: 5px; font-size: 22px;"></i></div>').click(function() {
  2415. $modal.show();
  2416. });
  2417. $helpButton.insertAfter('#emojiBtn');
  2418. $('body').append('<style>@media (max-width: 1288px) { #inventory1 { left: 675px !important; } }</style>'); // Ensure help icon does not overlap powerups
  2419.  
  2420. window.addEventListener('miracleCommand', function(commandEvent) {
  2421. if (commandEvent.command === '/help' || commandEvent.command === '/miraclehelp') {
  2422. $('#chtbox').val('').focus();
  2423. $modal.show();
  2424. }
  2425. });
  2426. },
  2427.  
  2428. commands: function () {
  2429. var self = this;
  2430. var minutes, skinId;
  2431.  
  2432. var sessionStartedAt = Date.now();
  2433.  
  2434. $('#chtbox').keydown(function (event) {
  2435. if (event.keyCode === 13) {
  2436. var message = $('#chtbox').val();
  2437. var command = message.split(' ')[0];
  2438. var argument1 = message.split(' ')[1];
  2439. var argument2 = message.split(' ')[2];
  2440.  
  2441. if (message === 'time' || command === '/time' || command === '/localtime') {
  2442. var now = new Date();
  2443. $('#chtbox').val('Local time: ' + now.toLocaleString() + self.watermark).focus();
  2444. }
  2445.  
  2446. if (message === 'minutes' || command === '/minutes' || message === 'online' || command === '/online' || command === '/session') {
  2447. if (message === 'minutes' || command === '/minutes') {
  2448. self.message('⛔ The /minutes command is deprecated, please use /online instead.', true);
  2449. }
  2450.  
  2451. minutes = parseInt((Date.now() - sessionStartedAt) / 1000 / 60);
  2452. if (minutes < 1) {
  2453. minutes = parseInt((Date.now() - sessionStartedAt) / 1000) + ' Seconds & 0';
  2454. }
  2455. if (minutes > 60) {
  2456. minutes = parseInt(minutes / 60) + ' Hours & ' + (minutes % 60);
  2457. }
  2458. $('#chtbox').val('is online for: ' + minutes + ' Minutes in the current session' + self.watermark).focus();
  2459. }
  2460.  
  2461. if (command === '/solo' || command === '/noteam') {
  2462. $('#chtbox').val(':warning: SOLO SERVER :warning: No teaming!! No hay equipo!! Pas d\'équipe!! Kein Teaming!! لا فريق').focus();
  2463. }
  2464.  
  2465. if (command === '/miracle') {
  2466. var miracleInfo = 'uses 𝘔𝘪𝘳𝘢𝘤𝘭𝘦 𝘚𝘤𝘳𝘪𝘱𝘵𝘴';
  2467.  
  2468. if (GM_info) {
  2469. miracleInfo += ' ' + GM_info.script.version;
  2470. }
  2471.  
  2472. $('#chtbox').val(miracleInfo + '. Install for free from 𝘎𝘳𝘦𝘢𝘴𝘺𝘧𝘰𝘳𝘬.𝘰𝘳𝘨!' + self.watermark).focus();
  2473. }
  2474.  
  2475. if (command === '/samira') {
  2476. $('#chtbox').val('Samira is the initiator of 𝘔𝘪𝘳𝘢𝘤𝘭𝘦 𝘚𝘤𝘳𝘪𝘱𝘵𝘴' + self.watermark).focus();
  2477. }
  2478.  
  2479. if (command === '/skinid' || command === '/sayskin') {
  2480. var skinUri = self.getSkinUrl();
  2481. skinId = parseInt(skinUri.substr(skinUri.indexOf('skins/') + 6));
  2482. $('#chtbox').val('uses the skin with the ID ' + skinId + self.watermark);
  2483. return;
  2484. }
  2485.  
  2486. if (command === '/useskin') {
  2487. skinId = parseInt(argument1);
  2488. if (! (skinId > 0)) {
  2489. self.message('Invalid skin ID given. Example usage of command: /useskin 123', true);
  2490. } else {
  2491. self.useSkin(skinId);
  2492. }
  2493.  
  2494. $('#chtbox').val('');
  2495. }
  2496.  
  2497. if (command.substr(0, 4) === '/say' || (command === '/party' && argument1.substr(0, 4) === '/say') || (command === '/pm' && argument2.substr(0, 4) === '/say')) {
  2498. self.message('🚫 This feature has been removed since the Agma staff does not allow it', true);
  2499. $('#chtbox').val('');
  2500. }
  2501.  
  2502. if (command === '/dice') {
  2503. var max = (argument1 > 0) ? parseInt(argument1) : 6;
  2504. var number = self.getRandomInt(1, max);
  2505. $('#chtbox').val('rolled a die with ' + max + ' sides. Result: ' + number + self.watermark);
  2506. }
  2507.  
  2508. if (command === '/powerups' || command === '/powers' || command === '/has') {
  2509. var map = {
  2510. invInstaRecombine: 'recombine',
  2511. inv2xSpeed: 'speed',
  2512. invGrowth: 'growth',
  2513. invSpawnVirus: 'virus',
  2514. invSpawnMothercell: 'red virus',
  2515. invSpawnPortal: 'portal',
  2516. invSpawnGoldFarmOre: 'gold block',
  2517. invFreeze: 'freeze',
  2518. inv360PushShot: 'push',
  2519. invFrozenVirus: 'frozen virus',
  2520. }
  2521. var getPowerUps = function(map, shortNames) {
  2522. var ids = Object.keys(map); var amount; var powerups = ''; var powerUpName;
  2523. for (var i = 0; i < ids.length; i++) {
  2524. // Note: If the amount of a power-ups is 1, no number will be displayed.
  2525. amount = $('#' + ids[i] + ' p').text() || ($('#' + ids[i]).css('display') === 'none' ? 0 : 1);
  2526. if (amount > 0) {
  2527. if (powerups != '') {
  2528. powerups += ', ';
  2529. }
  2530. powerUpName = map[ids[i]];
  2531. if (shortNames) {
  2532. powerUpName = powerUpName.substr(0, 3);
  2533. }
  2534. powerups += amount + ' ' + powerUpName;
  2535. }
  2536. }
  2537. return powerups;
  2538. }
  2539.  
  2540. var powerups = getPowerUps(map, false);
  2541. if (powerups.length >= 95) {
  2542. powerups = getPowerUps(map, true);
  2543. }
  2544.  
  2545. if (powerups === '') {
  2546. powerups = 'no power-ups';
  2547. }
  2548. $('#chtbox').val(self.watermark + 'has ' + powerups);
  2549. }
  2550.  
  2551. if (command === '/xp' || command === '/progress') {
  2552. var xp = parseInt($('.xpBarTop span').text());
  2553. var text = '█'.repeat(xp / 10) + '▒'.repeat(10 - parseInt(xp / 10)) + ' ' + xp + '%';
  2554. $('#chtbox').val('is currently level ' + $('#level2').text() + ' with ' + text + ' of the next level completed' + self.watermark);
  2555. }
  2556.  
  2557. if (command === '/megaphone' || command === '/megashout' || command === '/shout') {
  2558. // Notes: 1-7 = colors. The shout message can have max 130 chars, but chat messages can be only 100(?) chars long so np
  2559. self.warnBeforeMegaShout(message.substr(message.indexOf(' ') + 1), self.getRandomInt(1, 7));
  2560. $('#chtbox').val('');
  2561. }
  2562.  
  2563. if (command === '/players') {
  2564. var gameservers = JSON.parse(localStorage.getItem('gameservers'));
  2565. var players = 0;
  2566. var current = null;
  2567.  
  2568. gameservers.forEach(function(gameserver) {
  2569. players += gameserver.players;
  2570. if (gameserver.isCurrent) {
  2571. current = gameserver.players + '/' + gameserver.maxPlayers;
  2572. }
  2573. });
  2574.  
  2575. $('#chtbox').val('Players online in Agma: ' + players);
  2576.  
  2577. if (current !== null) {
  2578. $('#chtbox').val($('#chtbox').val() + ' - current server: ' + current);
  2579. }
  2580. }
  2581.  
  2582. var commandEvent = new Event('miracleCommand');
  2583. commandEvent.message = message;
  2584. commandEvent.command = command;
  2585. commandEvent.argument1 = argument1;
  2586. commandEvent.argument2 = argument2;
  2587. window.dispatchEvent(commandEvent);
  2588. }
  2589. });
  2590. },
  2591.  
  2592. /**
  2593. * This object is a container for functions that convert english letters and digits to fancy Unicode characters
  2594. * @see https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
  2595. * @see https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
  2596. * @see https://en.wikipedia.org/wiki/Enclosed_Alphanumeric_Supplement
  2597. */
  2598. fonts: {
  2599. doubleStruck : function(charCode) {
  2600. if (charCode === 67) { return String.fromCodePoint(0x2102); } // C
  2601. if (charCode === 72) { return String.fromCodePoint(0x210D); } // H
  2602. if (charCode === 78) { return String.fromCodePoint(0x2115); } // N
  2603. if (charCode === 80) { return String.fromCodePoint(0x2119); } // P
  2604. if (charCode === 81) { return String.fromCodePoint(0x211A); } // Q
  2605. if (charCode === 82) { return String.fromCodePoint(0x211D); } // R
  2606. if (charCode === 90) { return String.fromCodePoint(0x2124); } // Z
  2607. if (charCode >= 65 && charCode <= 90) {
  2608. return String.fromCodePoint(0x1D538 + charCode - 65);
  2609. }
  2610. if (charCode >= 97 && charCode <= 122) {
  2611. return String.fromCodePoint(0x1D552 + charCode - 97);
  2612. }
  2613. if (charCode >= 48 && charCode <= 57) {
  2614. return String.fromCodePoint(0x1D7D8 + charCode - 48);
  2615. }
  2616. return String.fromCharCode(charCode);
  2617. },
  2618.  
  2619. monospace : function(charCode) {
  2620. if (charCode >= 65 && charCode <= 90) {
  2621. return String.fromCodePoint(0x1D670 + charCode - 65);
  2622. }
  2623. if (charCode >= 97 && charCode <= 122) {
  2624. return String.fromCodePoint(0x1D68A + charCode - 97);
  2625. }
  2626. if (charCode >= 48 && charCode <= 57) {
  2627. return String.fromCodePoint(0x1D7F6 + charCode - 48);
  2628. }
  2629. return String.fromCharCode(charCode);
  2630. },
  2631.  
  2632. scriptBold : function(charCode) {
  2633. if (charCode >= 65 && charCode <= 90) {
  2634. return String.fromCodePoint(0x1D4D0 + charCode - 65);
  2635. }
  2636. if (charCode >= 97 && charCode <= 122) {
  2637. return String.fromCodePoint(0x1D4EA + charCode - 97);
  2638. }
  2639. if (charCode >= 48 && charCode <= 57) {
  2640. return String.fromCodePoint(0x1D7CE + charCode - 48);
  2641. }
  2642. return String.fromCharCode(charCode);
  2643. },
  2644.  
  2645. frakturBold : function(charCode) {
  2646. if (charCode === 121) { return '𝐲'; } // y
  2647. if (charCode >= 65 && charCode <= 90) {
  2648. return String.fromCodePoint(0x1D56C + charCode - 65);
  2649. }
  2650. if (charCode >= 97 && charCode <= 122) {
  2651. return String.fromCodePoint(0x1D586 + charCode - 97);
  2652. }
  2653. if (charCode >= 48 && charCode <= 57) {
  2654. return String.fromCodePoint(0x1D7CE + charCode - 48);
  2655. }
  2656. return String.fromCharCode(charCode);
  2657. },
  2658.  
  2659. serifItalic: function(charCode) {
  2660. if (charCode === 104) { return String.fromCodePoint(0x1D629); } // h
  2661. if (charCode >= 65 && charCode <= 90) {
  2662. return String.fromCodePoint(0x1D434 + charCode - 65);
  2663. }
  2664. if (charCode >= 97 && charCode <= 122) {
  2665. return String.fromCodePoint(0x1D44E + charCode - 97);
  2666. }
  2667. return String.fromCharCode(charCode);
  2668. },
  2669.  
  2670. circled: function(charCode) {
  2671. if (charCode >= 65 && charCode <= 90) {
  2672. return String.fromCodePoint(0x24B6 + charCode - 65);
  2673. }
  2674. if (charCode >= 97 && charCode <= 122) {
  2675. return String.fromCodePoint(0x24D0 + charCode - 97);
  2676. }
  2677. if (charCode >= 49 && charCode <= 57) {
  2678. return String.fromCodePoint(0x2460 + charCode - 49);
  2679. }
  2680. return String.fromCharCode(charCode);
  2681. },
  2682.  
  2683. boxed: function(charCode) {
  2684. if (charCode >= 65 && charCode <= 90) {
  2685. return String.fromCodePoint(0x1F130 + charCode - 65);
  2686. }
  2687. if (charCode >= 97 && charCode <= 122) {
  2688. return String.fromCodePoint(0x1F130 + charCode - 97);
  2689. }
  2690. if (charCode >= 49 && charCode <= 57) {
  2691. return String.fromCodePoint(0x2460 + charCode - 49);
  2692. }
  2693. return String.fromCharCode(charCode);
  2694. }
  2695. },
  2696.  
  2697. /**
  2698. * True if currently a HTML text element is focused
  2699. */
  2700. isWritingText: function() {
  2701. return document.activeElement.type === 'text' || document.activeElement.type === 'password' || document.activeElement.type === 'textarea';
  2702. },
  2703.  
  2704. /**
  2705. * Let the browser download string data as a text file with a given filename.
  2706. */
  2707. download: function (filename, text) {
  2708. var element = document.createElement('a');
  2709. element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
  2710. element.setAttribute('download', filename);
  2711.  
  2712. element.style.display = 'none';
  2713. document.body.appendChild(element);
  2714.  
  2715. element.click();
  2716.  
  2717. document.body.removeChild(element);
  2718. },
  2719.  
  2720. /**
  2721. * Converts a version string (for example "1.5.7") to an integer (for example 1005007)
  2722. * If no string version is given, the current version of the script will be used.
  2723. */
  2724. getVersionAsInt: function(stringVersion) {
  2725. if (stringVersion === undefined) {
  2726. stringVersion = typeof GM_info !== 'undefined' ? GM_info.script.version : '0';
  2727. }
  2728.  
  2729. var parts = stringVersion.split('.');
  2730. if (parts.length === 1) {
  2731. parts.push('0');
  2732. }
  2733. if (parts.length === 2) {
  2734. parts.push('0');
  2735. }
  2736.  
  2737. return parseInt(parts[0]) * 1000000 + parseInt(parts[1]) * 1000 + parseInt(parts[2]);
  2738. },
  2739.  
  2740. /**
  2741. * Returns a random number between min and max (both inclusive)
  2742. * Source: MDN
  2743. */
  2744. getRandomInt: function (min, max) {
  2745. return Math.round(Math.random() * (max - min) + min);
  2746. },
  2747.  
  2748.  
  2749. /**
  2750. * Returns the 360-angle between two points 8coordinates), starting by the first point.
  2751. * 0° means the second point is in the north of the first point.
  2752. * The returned angle will always be >= 0 and < 360.
  2753. */
  2754. getAngle: function(x1, y1, x2, y2) {
  2755. var angle = Math.atan2(y2 - y1, x2 - x1); // range (-PI, PI]
  2756. angle *= 180 / Math.PI; // rads to degs, range (-180, 180]
  2757. angle += 90;
  2758.  
  2759. if (angle < 0) angle = 360 + angle; // range [0, 360)
  2760. if (angle >= 360) angle = 360 - angle; // range [0, 360)
  2761.  
  2762. return angle;
  2763. },
  2764.  
  2765. /**
  2766. * Adds angle2 to angle1 and returns the resulting angle.
  2767. */
  2768. addAngle: function(angle1, angle2) {
  2769. var angle = angle1 + angle2;
  2770.  
  2771. angle %= 360;
  2772. if (angle < 0) angle += 360;
  2773.  
  2774. return angle;
  2775. },
  2776.  
  2777. /**
  2778. * Use the curser div to display a message at the top of the screen.
  2779. *
  2780. * @param message
  2781. * @param isError
  2782. */
  2783. message: function (message, isError) {
  2784. var curser = document.querySelector('#curser');
  2785.  
  2786. curser.textContent = message;
  2787. curser.style.display = 'block';
  2788. curser.style.color = isError ? 'rgb(255, 0, 0)' : 'rgb(0, 192, 0)';
  2789.  
  2790. window.setTimeout(function () {
  2791. curser.style.display = 'none';
  2792. }, 5000);
  2793. },
  2794.  
  2795. /**
  2796. * Show a sweet alert (modal/popup) with a given title and message.
  2797. */
  2798. swal: function (title, message, html) {
  2799. if (html === undefined) {
  2800. html = true;
  2801. }
  2802. window.swal({
  2803. title: '📢 <span class="miracle-primary-color-font">' + title + '</span>',
  2804. text: message,
  2805. html: html
  2806. });
  2807. },
  2808.  
  2809. /**
  2810. * Returns the URI of my skin or null if not skin has been set.
  2811. * Use this.skinUrl() to get it.
  2812. */
  2813. getSkinUrl: function(sourceSelector) {
  2814. if (sourceSelector === undefined) {
  2815. sourceSelector = '#skinExampleMenu';
  2816. }
  2817. var skinUrlRaw = $(sourceSelector).css('background-image');
  2818.  
  2819. var parts = skinUrlRaw.split('"');
  2820.  
  2821. if (parts.length !== 3) {
  2822. return null;
  2823. } else {
  2824. return parts[1];
  2825. }
  2826. },
  2827.  
  2828. getAccountName: function() {
  2829. return document.querySelector('#dashPanel .username').innerText;
  2830. },
  2831.  
  2832. /**
  2833. * Tries to pick a skin that is identified by its skin ID.
  2834. * Opens the skin menu, chooses the skin, and closes the menu again.
  2835. * The skin must be available for the current player (e.g. because it's a public one).
  2836. */
  2837. useSkin: function(skinId) {
  2838. window.azad(true);
  2839.  
  2840. setTimeout(function () {
  2841. $('#skinExampleMenu').click();
  2842.  
  2843. var checkLoaded = function () {
  2844. var loaded = ($('#skinsFree tr').length > 1);
  2845. if (loaded) {
  2846. window.toggleSkin(skinId);
  2847.  
  2848. setTimeout(function () {
  2849. $('#shopModalDialog button.close').click();
  2850.  
  2851. setTimeout(function () {
  2852. window.setNick(document.getElementById('nick').value);
  2853. }, 200);
  2854. }, 200);
  2855. } else {
  2856. setTimeout(checkLoaded, 300);
  2857. }
  2858. };
  2859. checkLoaded();
  2860. }, 200);
  2861. },
  2862.  
  2863. /**
  2864. * This is an original Agma function but the original is not accessible - so this is a copy.
  2865. */
  2866. warnBeforeMegaShout: function(msg, color) {
  2867. swal({
  2868. title: "Confirm",
  2869. text: 'If you click "Buy", you will purchase the megaphone shout.',
  2870. type: "warning",
  2871. showCancelButton: true,
  2872. confirmButtonColor: "#4CAF50",
  2873. confirmButtonText: "Yes, confirm purchase",
  2874. cancelButtonText: "No, cancel purchase"
  2875. }, function() {
  2876. //Confirm purchase
  2877. //console.log('purchased megaphone');
  2878. purchaseMega(msg,color);
  2879. //window.location.href = linkURL;
  2880. });
  2881. },
  2882.  
  2883. setupPolyfills: function() {
  2884. // Polyfill for old browser so they have String.fromCodePoint()
  2885. if (!String.fromCodePoint) (function(stringFromCharCode) {
  2886. var fromCodePoint = function(_) {
  2887. var codeUnits = [], codeLen = 0, result = "";
  2888. for (var index=0, len = arguments.length; index !== len; ++index) {
  2889. var codePoint = +arguments[index];
  2890. // correctly handles all cases including `NaN`, `-Infinity`, `+Infinity`
  2891. // The surrounding `!(...)` is required to correctly handle `NaN` cases
  2892. // The (codePoint>>>0) === codePoint clause handles decimals and negatives
  2893. if (!(codePoint < 0x10FFFF && (codePoint>>>0) === codePoint))
  2894. throw RangeError("Invalid code point: " + codePoint);
  2895. if (codePoint <= 0xFFFF) { // BMP code point
  2896. codeLen = codeUnits.push(codePoint);
  2897. } else { // Astral code point; split in surrogate halves
  2898. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  2899. codePoint -= 0x10000;
  2900. codeLen = codeUnits.push(
  2901. (codePoint >> 10) + 0xD800, // highSurrogate
  2902. (codePoint % 0x400) + 0xDC00 // lowSurrogate
  2903. );
  2904. }
  2905. if (codeLen >= 0x3fff) {
  2906. result += stringFromCharCode.apply(null, codeUnits);
  2907. codeUnits.length = 0;
  2908. }
  2909. }
  2910. return result + stringFromCharCode.apply(null, codeUnits);
  2911. };
  2912. try { // IE 8 only supports `Object.defineProperty` on DOM elements
  2913. Object.defineProperty(String, "fromCodePoint", {
  2914. "value": fromCodePoint, "configurable": true, "writable": true
  2915. });
  2916. } catch(e) {
  2917. String.fromCodePoint = fromCodePoint;
  2918. }
  2919. }(String.fromCharCode));
  2920. },
  2921. };
  2922.  
  2923. window.miracleScripts.init();
  2924. })();