Guest User

Cursors.io Hack modified V2.2

a guest
Sep 4th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Instructions: Go to cursors.io, open console (ctrl + shift + j for Chrome)(ctrl + j for other browsers) and paste this entire script into the console.
  2. // To type: type message and hit enter
  3. // You can also write numbers and some symbols
  4. // Dont worry about the disappearing text when you use < and > because its html
  5. // Use ; for next line
  6. // To push all buttons on the map: hold #
  7. // To draw Dickbutt press: ~
  8. // Draw Down Arrow press: $
  9. // Draw Up Arrow press: &
  10. // Draw Left Arrow press: <
  11. // Draw Right Arrow press: >
  12. // Draw Fake Cursor press: @
  13.  
  14. var A = window;
  15. var E = document;
  16.  
  17. var debugMode = false;
  18.  
  19. var posX, posY;
  20. var lastX, lastY;
  21.  
  22. var lastFrame;
  23. var currentFrame;
  24.  
  25. var initialLoad = true;
  26. var buttonIndex = 0;
  27. var maxButtons = 10;
  28. var buttons = new Array(maxButtons);
  29. for (var i = 0; i < maxButtons; i++)
  30.     buttons[i] = new Array(3);
  31.  
  32. var auraEnabled = false;
  33. var auraTime = 0;
  34. var auraRadius = 10;
  35.  
  36. var markerEnabled = false;
  37.  
  38. var movementEnabled = true;
  39.  
  40. var imageScale = 1.0;
  41.  
  42. var imgData = [
  43.     [26,2,22,2],
  44.     [22,2,18,0],
  45.     [18,0,12,3],
  46.     [12,3,2,6],
  47.     [2,6,5,8],
  48.     [5,8,18,2],
  49.     [18,2,22,3],
  50.     [22,4,18,4],
  51.     [18,4,4,11],
  52.     [4,11,1,10],
  53.     [1,10,5,8],
  54.     [4,11,0,13],
  55.     [0,13,4,14],
  56.     [4,14,17,7],
  57.     [17,7,21,6],
  58.     [4,14,1,16],
  59.     [1,16,6,17],
  60.     [6,17,9,20],
  61.     [9,20,14,14],
  62.     [14,14,19,10],
  63.     [19,10,20,12],
  64.     [20,12,22,11],
  65.     [22,11,26,3],
  66.     [26,3,26,2],
  67.     [3,17,3,18],
  68.     [3,18,2,19],
  69.     [2,19,1,31],
  70.     [1,31,5,35],
  71.     [5,35,11,36],
  72.     [11,36,12,40],
  73.     [12,40,14,42],
  74.     [14,42,16,37],
  75.     [16,37,16,35],
  76.     [16,35,14,33],
  77.     [14,33,13,35],
  78.     [13,35,11,32],
  79.     [11,32,10,29],
  80.     [10,29,5,27],
  81.     [5,27,2,21],
  82.     [3,18,4,21],
  83.     [4,21,7,26],
  84.     [7,26,11,28],
  85.     [11,28,10,29],
  86.     [11,28,13,27],
  87.     [13,27,14,27],
  88.     [14,27,12,22],
  89.     [12,22,14,20],
  90.     [14,20,16,20],
  91.     [16,20,18,21],
  92.     [18,21,18,23],
  93.     [18,23,15,29],
  94.     [15,29,14,27],
  95.     [16,28,16,30],
  96.     [16,30,14,33],
  97.     [17,26,31,28],
  98.     [31,28,34,25],
  99.     [34,25,25,23],
  100.     [25,23,22,21],
  101.     [22,21,21,18],
  102.     [21,18,21,12],
  103.     [21,13,16,18],
  104.     [16,18,13,18],
  105.     [13,18,10,22],
  106.     [10,22,11,24],
  107.     [11,24,13,25],
  108.     [11,20,10,19],
  109.     [14,14,15,15],
  110.     [15,15,16,15],
  111.     [16,15,17,14],
  112.     [17,14,17,12],
  113.     [16,13,16,14],
  114.     [16,14,15,13],
  115.     [21,16,23,14],
  116.     [23,14,25,10],
  117.     [25,10,26,6],
  118.     [26,6,25,5],
  119.     [26,6,25,6],
  120.     [25,6,26,7],
  121.     [26,7,24,7],
  122.     [24,7,25,8],
  123.     [25,8,24,8],
  124.     [24,8,25,9],
  125.     [25,9,23,9],
  126.     [23,9,24,11],
  127.     [24,11,22,11],
  128.     [22,11,23,13],
  129.     [23,13,21,13],
  130.     [21,13,22,15],
  131.     [26,6,27,8],
  132.     [27,8,28,14],
  133.     [28,14,27,20],
  134.     [27,20,25,23],
  135.     [28,15,33,17],
  136.     [35,8,35,10],
  137.     [35,10,33,12],
  138.     [33,17,35,15],
  139.     [35,15,28,11],
  140.     [27,7,29,6],
  141.     [29,6,31,4],
  142.     [31,4,37,2],
  143.     [37,2,34,8],
  144.     [34,8,30,8],
  145.     [29,6,30,8],
  146.     [35,6,38,9],
  147.     [38,9,39,12],
  148.     [39,12,39,15],
  149.     [39,15,38,18],
  150.     [38,18,29,22],
  151.     [29,22,26,22],
  152.     [36,4,41,4],
  153.     [41,4,45,5],
  154.     [45,5,46,6],
  155.     [46,6,44,6],
  156.     [44,6,38,8],
  157.     [41,7,45,9],
  158.     [45,9,48,11],
  159.     [48,11,39,11],
  160.     [43,11,47,14],
  161.     [47,14,39,15],
  162.     [21,27,20,29],
  163.     [21,27,22,30],
  164.     [22,30,21,34],
  165.     [21,34,22,40],
  166.     [22,31,24,32],
  167.     [24,32,37,33],
  168.     [37,33,40,29],
  169.     [40,29,44,28],
  170.     [44,28,47,28],
  171.     [47,28,52,30],
  172.     [52,30,54,28],
  173.     [54,28,56,26],
  174.     [56,26,59,25],
  175.     [59,25,58,28],
  176.     [58,28,60,27],
  177.     [60,27,58,33],
  178.     [58,33,61,31],
  179.     [61,31,58,38],
  180.     [58,38,55,35],
  181.     [55,35,58,33],
  182.     [56,34,55,33],
  183.     [55,33,55,30],
  184.     [55,30,58,28],
  185.     [55,30,54,29],
  186.     [58,38,56,47],
  187.     [56,47,52,45],
  188.     [52,45,52,53],
  189.     [52,53,54,60],
  190.     [54,60,60,62],
  191.     [60,62,64,60],
  192.     [64,60,69,60],
  193.     [69,60,63,66],
  194.     [63,66,69,68],
  195.     [69,68,67,70],
  196.     [67,70,63,71],
  197.     [63,71,64,72],
  198.     [64,72,67,73],
  199.     [67,73,69,74],
  200.     [69,74,63,77],
  201.     [63,77,60,75],
  202.     [60,75,61,73],
  203.     [61,73,64,72],
  204.     [63,71,61,70],
  205.     [61,70,61,67],
  206.     [61,67,63,66],
  207.     [63,66,60,64],
  208.     [60,64,60,62],
  209.     [63,77,60,78],
  210.     [60,78,50,76],
  211.     [50,76,42,72],
  212.     [42,72,39,69],
  213.     [39,69,38,65],
  214.     [38,65,38,63],
  215.     [38,63,39,61],
  216.     [39,61,41,59],
  217.     [41,59,45,57],
  218.     [45,57,48,57],
  219.     [48,57,54,60],
  220.     [41,71,34,68],
  221.     [34,68,33,67],
  222.     [33,67,26,64],
  223.     [26,64,25,63],
  224.     [25,63,24,63],
  225.     [24,63,16,59],
  226.     [16,59,15,57],
  227.     [15,57,12,56],
  228.     [12,56,7,51],
  229.     [7,51,7,50],
  230.     [7,50,5,46],
  231.     [5,46,2,40],
  232.     [2,40,1,35],
  233.     [1,35,1,32],
  234.     [1,32,4,36],
  235.     [4,36,6,44],
  236.     [6,44,5,45],
  237.     [6,46,7,45],
  238.     [7,45,6,37],
  239.     [6,37,11,38],
  240.     [24,31,25,28],
  241.     [28,28,29,32],
  242.     [31,32,34,26],
  243.     [34,26,36,33],
  244.     [12,34,11,36],
  245.     [13,41,12,44],
  246.     [12,44,13,47],
  247.     [13,47,16,50],
  248.     [16,50,17,50],
  249.     [17,50,16,46],
  250.     [16,46,21,45],
  251.     [21,45,22,43],
  252.     [22,43,26,43],
  253.     [26,43,29,46],
  254.     [29,46,30,50],
  255.     [30,50,28,52],
  256.     [28,52,24,51],
  257.     [24,51,21,48],
  258.     [21,48,21,45],
  259.     [21,46,18,47],
  260.     [18,47,18,50],
  261.     [18,50,17,50],
  262.     [18,50,20,50],
  263.     [20,50,22,49],
  264.     [22,43,22,40],
  265.     [22,40,19,38],
  266.     [19,38,16,38],
  267.     [22,42,26,42],
  268.     [26,42,29,44],
  269.     [29,44,30,46],
  270.     [30,46,31,43],
  271.     [31,43,36,41],
  272.     [36,41,37,38],
  273.     [37,38,34,38],
  274.     [34,38,32,37],
  275.     [32,37,33,36],
  276.     [33,36,30,36],
  277.     [30,36,28,37],
  278.     [28,37,26,39],
  279.     [26,39,22,40],
  280.     [33,36,34,35],
  281.     [34,35,41,33],
  282.     [41,33,41,34],
  283.     [41,34,37,38],
  284.     [37,38,41,37],
  285.     [41,37,46,35],
  286.     [46,35,43,40],
  287.     [43,40,41,42],
  288.     [41,42,40,42],
  289.     [40,42,37,42],
  290.     [37,42,36,41],
  291.     [37,42,33,44],
  292.     [33,44,32,46],
  293.     [32,46,39,44],
  294.     [39,44,40,42],
  295.     [39,44,39,45],
  296.     [39,45,41,46],
  297.     [41,46,43,46],
  298.     [43,46,47,44],
  299.     [47,44,50,40],
  300.     [50,40,45,41],
  301.     [45,41,42,41],
  302.     [40,46,34,47],
  303.     [34,47,32,47],
  304.     [32,47,34,49],
  305.     [34,49,38,49],
  306.     [38,49,41,47],
  307.     [41,47,41,46],
  308.     [41,47,41,49],
  309.     [41,49,42,49],
  310.     [42,49,46,46],
  311.     [46,46,48,44],
  312.     [48,44,47,44],
  313.     [42,49,40,51],
  314.     [40,51,30,52],
  315.     [30,52,31,49],
  316.     [31,49,34,51],
  317.     [34,51,41,49],
  318.     [30,52,29,51],
  319.     [24,51,25,53],
  320.     [25,53,28,53],
  321.     [28,53,29,54],
  322.     [29,54,25,62],
  323.     [25,62,23,56],
  324.     [23,56,23,54],
  325.     [23,54,25,53],
  326.     [21,50,23,53],
  327.     [23,55,17,56],
  328.     [17,56,11,50],
  329.     [11,50,7,50],
  330.     [7,51,10,51],
  331.     [10,51,15,56],
  332.     [15,56,15,57],
  333.     [16,58,23,57],
  334.     [29,55,32,57],
  335.     [32,57,34,56],
  336.     [34,56,36,56],
  337.     [36,56,37,57],
  338.     [37,57,38,59],
  339.     [38,59,34,66],
  340.     [34,66,32,59],
  341.     [32,59,28,56],
  342.     [32,59,32,57],
  343.     [32,60,29,62],
  344.     [29,62,25,63],
  345.     [28,64,32,66],
  346.     [32,61,30,63],
  347.     [30,63,33,65],
  348.     [33,65,34,68],
  349.     [40,60,38,59],
  350.     [37,61,38,62],
  351.     [48,57,47,52],
  352.     [47,52,47,45],
  353.     [47,40,47,38],
  354.     [47,38,46,37],
  355.     [44,36,41,34],
  356.     [39,33,37,33],
  357.     [47,38,49,40],
  358.     [50,41,52,45],
  359.     [46,36,48,34],
  360.     [48,34,49,31],
  361.     [48,29,49,31],
  362.     [50,29,51,32],
  363.     [51,32,53,32],
  364.     [53,32,55,30],
  365.     [55,32,53,34],
  366.     [53,34,51,34],
  367.     [51,34,50,36],
  368.     [50,36,52,39],
  369.     [52,39,55,35],
  370.     [56,36,52,41],
  371.     [52,41,49,37],
  372.     [49,37,47,38],
  373.     [38,55,38,54],
  374.     [41,55,40,56],
  375.     [49,58,45,59],
  376.     [45,59,43,62],
  377.     [43,62,42,66],
  378.     [42,66,43,69],
  379.     [43,69,46,72],
  380.     [46,72,49,73],
  381.     [49,73,52,72],
  382.     [52,72,54,76],
  383.     [54,76,60,75],
  384.     [61,73,55,74],
  385.     [55,74,53,71],
  386.     [53,71,55,69],
  387.     [55,69,61,70],
  388.     [61,68,56,67],
  389.     [56,67,56,65],
  390.     [56,65,55,63],
  391.     [55,63,57,62],
  392.     [57,62,60,63],
  393.     [55,61,54,60],
  394.     [55,61,56,61],
  395.     [54,66,53,62],
  396.     [53,62,49,60],
  397.     [49,60,46,61],
  398.     [46,61,44,65],
  399.     [44,65,45,68],
  400.     [45,68,48,70],
  401.     [48,70,50,70],
  402.     [50,70,52,69],
  403.     [52,69,54,66],
  404.     [57,78,54,85],
  405.     [54,85,51,90],
  406.     [51,90,50,91],
  407.     [50,91,49,93],
  408.     [49,93,47,89],
  409.     [47,89,46,86],
  410.     [46,86,47,85],
  411.     [47,85,50,85],
  412.     [50,85,51,87],
  413.     [51,87,50,91],
  414.     [51,87,49,79],
  415.     [49,79,50,78],
  416.     [50,78,53,78],
  417.     [53,78,54,79],
  418.     [54,79,53,83],
  419.     [53,83,51,87],
  420.     [48,93,46,94],
  421.     [46,94,45,99],
  422.     [45,99,43,95],
  423.     [43,95,42,90],
  424.     [42,90,45,89],
  425.     [45,89,47,90],
  426.     [47,90,46,94],
  427.     [43,95,32,98],
  428.     [32,98,30,98],
  429.     [30,98,26,96],
  430.     [26,96,23,93],
  431.     [23,93,23,92],
  432.     [23,92,30,94],
  433.     [30,94,37,91],
  434.     [37,91,39,93],
  435.     [39,93,42,95],
  436.     [37,91,37,82],
  437.     [37,82,36,77],
  438.     [36,77,38,74],
  439.     [38,74,40,81],
  440.     [40,81,40,87],
  441.     [40,87,42,90],
  442.     [43,89,41,86],
  443.     [41,86,41,79],
  444.     [41,79,39,72],
  445.     [39,72,39,71],
  446.     [38,74,39,73],
  447.     [38,73,38,70],
  448.     [36,78,27,83],
  449.     [27,83,23,83],
  450.     [23,83,26,86],
  451.     [26,86,28,86],
  452.     [28,86,37,81],
  453.     [37,86,28,90],
  454.     [28,90,26,90],
  455.     [26,90,23,89],
  456.     [23,89,25,92],
  457.     [25,89,23,86],
  458.     [23,86,26,86],
  459.     [46,85,44,83],
  460.     [44,83,43,80],
  461.     [43,80,42,75],
  462.     [42,75,41,71],
  463.     [43,73,44,78],
  464.     [44,78,45,81],
  465.     [45,81,48,85],
  466.     [49,85,50,83],
  467.     [50,78,47,75],
  468.     [45,74,49,79],
  469.     [52,78,53,77],
  470.     [55,77,54,78]
  471. ];
  472. var imgDataDickbutt = [
  473.     [0,23,1,29],
  474.     [1,29,5,35],
  475.     [5,35,11,38],
  476.     [11,38,34,38],
  477.     [34,38,46,40],
  478.     [46,40,49,41],
  479.     [46,40,42,47],
  480.     [42,47,41,53],
  481.     [41,53,42,59],
  482.     [42,59,47,56],
  483.     [47,56,48,50],
  484.     [48,50,46,48],
  485.     [48,50,51,46],
  486.     [48,45,48,44],
  487.     [42,59,28,66],
  488.     [28,66,27,68],
  489.     [27,68,27,70],
  490.     [27,70,29,72],
  491.     [29,72,33,74],
  492.     [33,74,43,71],
  493.     [43,71,46,68],
  494.     [46,68,47,69],
  495.     [47,69,46,72],
  496.     [46,72,46,74],
  497.     [46,74,47,76],
  498.     [47,76,50,76],
  499.     [50,76,51,75],
  500.     [51,75,51,73],
  501.     [51,73,50,71],
  502.     [42,68,41,69],
  503.     [38,70,37,71],
  504.     [49,76,50,79],
  505.     [51,75,52,77],
  506.     [52,77,54,78],
  507.     [54,78,56,78],
  508.     [56,78,57,77],
  509.     [57,77,58,74],
  510.     [58,74,57,70],
  511.     [57,70,53,68],
  512.     [53,68,50,65],
  513.     [50,65,48,61],
  514.     [48,61,47,56],
  515.     [56,54,56,53],
  516.     [60,53,60,52],
  517.     [64,51,64,50],
  518.     [69,54,68,53],
  519.     [56,76,57,77],
  520.     [59,75,58,74],
  521.     [57,70,61,70],
  522.     [61,70,66,66],
  523.     [66,66,71,60],
  524.     [71,60,73,55],
  525.     [73,55,73,49],
  526.     [73,49,88,48],
  527.     [88,48,89,46],
  528.     [89,46,83,38],
  529.     [83,38,80,36],
  530.     [80,36,79,37],
  531.     [79,37,79,39],
  532.     [79,39,81,43],
  533.     [81,43,74,43],
  534.     [74,43,75,36],
  535.     [75,36,74,26],
  536.     [74,26,89,20],
  537.     [89,20,89,17],
  538.     [89,17,83,11],
  539.     [83,11,81,11],
  540.     [81,11,80,12],
  541.     [80,12,81,15],
  542.     [81,15,83,17],
  543.     [83,17,83,18],
  544.     [83,18,73,22],
  545.     [73,22,74,26],
  546.     [73,22,69,14],
  547.     [69,14,62,8],
  548.     [62,8,50,2],
  549.     [50,2,38,0],
  550.     [38,0,28,1],
  551.     [28,1,27,20],
  552.     [27,20,25,31],
  553.     [28,1,20,3],
  554.     [20,3,21,7],
  555.     [21,7,19,11],
  556.     [19,11,16,12],
  557.     [16,12,13,10],
  558.     [13,10,12,6],
  559.     [12,6,14,2],
  560.     [14,2,17,1],
  561.     [17,1,20,3],
  562.     [20,3,18,6],
  563.     [18,6,16,8],
  564.     [16,8,14,8],
  565.     [14,8,12,6],
  566.     [12,6,5,12],
  567.     [5,12,1,18],
  568.     [1,18,0,23],
  569.     [16,15,19,12],
  570.     [19,12,22,10],
  571.     [22,10,24,11],
  572.     [24,11,25,14],
  573.     [25,14,23,17],
  574.     [23,17,22,16],
  575.     [18,21,21,22],
  576.     [21,22,23,24],
  577.     [23,24,23,26],
  578.     [23,26,22,30],
  579.     [22,30,19,33],
  580.     [19,33,16,33],
  581.     [16,33,13,30],
  582.     [13,30,13,26],
  583.     [13,26,14,23],
  584.     [14,23,18,21],
  585.     [13,30,17,28],
  586.     [17,28,20,25],
  587.     [20,25,20,22],
  588.     [38,28,55,28],
  589.     [55,28,59,25],
  590.     [59,25,62,26],
  591.     [62,26,61,29],
  592.     [61,29,59,29],
  593.     [61,29,62,31],
  594.     [62,31,60,33],
  595.     [60,33,58,32],
  596.     [60,33,60,38],
  597.     [60,38,59,38],
  598.     [59,38,55,32],
  599.     [55,32,38,32]
  600. ];
  601.  
  602. var fontSize = 1;
  603. var letterOffset = 0;
  604. var alphabet = new Array(200);
  605. alphabet[33] = [
  606.     [4,1,4,0],
  607.     [3,1,2,0],
  608.     [2,0,1,1],
  609.     [1,1,0,0],
  610.     [0,1,1,0],
  611.     [1,0,2,1],
  612.     [2,1,3,0]
  613. ];
  614. alphabet[36] = [
  615.     [8,4,4,8],
  616.     [4,8,4,6],
  617.     [4,6,0,6],
  618.     [0,6,0,2],
  619.     [0,2,4,2],
  620.     [4,2,4,0],
  621.     [4,0,8,4]
  622. ];
  623. alphabet[37] = [
  624.     [0,2,4,0],
  625.     [4,2,3,2],
  626.     [1,0,0,0]
  627. ];
  628. alphabet[38] = [
  629.     [0,4,4,0],
  630.     [4,0,4,2],
  631.     [4,2,8,2],
  632.     [8,2,8,6],
  633.     [8,6,4,6],
  634.     [4,6,4,8],
  635.     [4,8,0,4]
  636. ];
  637. alphabet[39] = [
  638.     [1,0,0,0]
  639. ];
  640. alphabet[40] = [
  641.     [0,1,1,0],
  642.     [1,0,4,0],
  643.     [4,0,5,1]
  644. ];
  645. alphabet[41] = [
  646.     [0,1,1,2],
  647.     [1,2,4,2],
  648.     [4,2,5,1]
  649. ];
  650. alphabet[42] = [
  651.     [1,0,3,2],
  652.     [1,2,3,0]
  653. ];
  654. alphabet[43] = [
  655.     [2,0,2,2],
  656.     [1,1,3,1]
  657. ];
  658. alphabet[44] = [
  659.     [4,1,5,0]
  660. ];
  661. alphabet[45] = [
  662.     [2,0,2,2]
  663. ];
  664. alphabet[46] = [
  665.     [4,1,5,0],
  666.     [5,1,4,0]
  667. ];
  668. alphabet[47] = [
  669.     [4,0,0,2]
  670. ];
  671. alphabet[48] = [
  672.     [0,1,1,2],
  673.     [1,2,3,2],
  674.     [3,2,4,1],
  675.     [4,1,3,0],
  676.     [3,0,1,0],
  677.     [1,0,0,1]
  678. ];
  679. alphabet[49] = [
  680.     [4,2,4,0],
  681.     [4,1,0,1],
  682.     [0,1,1,0]
  683. ];
  684. alphabet[50] = [
  685.     [4,2,4,0],
  686.     [4,0,2,2],
  687.     [2,2,1,2],
  688.     [1,2,0,1],
  689.     [0,1,0,0]
  690. ];
  691. alphabet[51] = [
  692.     [0,0,0,2],
  693.     [0,2,2,1],
  694.     [2,1,3,2],
  695.     [3,2,4,1],
  696.     [4,1,4,0]
  697. ];
  698. alphabet[52] = [
  699.     [4,1,2,1],
  700.     [3,2,3,0],
  701.     [3,0,0,1]
  702. ];
  703. alphabet[53] = [
  704.     [4,0,4,1],
  705.     [4,1,3,2],
  706.     [3,2,2,1],
  707.     [2,1,2,0],
  708.     [2,0,0,0],
  709.     [0,0,0,2]
  710. ];
  711. alphabet[54] = [
  712.     [0,2,0,1],
  713.     [0,1,1,0],
  714.     [1,0,3,0],
  715.     [3,0,4,1],
  716.     [4,1,3,2],
  717.     [3,2,2,1],
  718.     [2,1,2,0]
  719. ];
  720. alphabet[55] = [
  721.     [1,0,0,0],
  722.     [0,0,0,2],
  723.     [0,2,3,1],
  724.     [3,1,4,1],
  725.     [2,1,2,2]
  726. ];
  727. alphabet[56] = [
  728.     [4,1,3,2],
  729.     [3,2,1,0],
  730.     [1,0,0,1],
  731.     [0,1,1,2],
  732.     [1,2,3,0],
  733.     [3,0,4,1]
  734. ];
  735. alphabet[57] = [
  736.     [4,0,4,1],
  737.     [4,1,3,2],
  738.     [3,2,1,2],
  739.     [1,2,0,1],
  740.     [0,1,1,0],
  741.     [1,0,2,1],
  742.     [2,1,2,2]
  743. ];
  744. alphabet[58] = [
  745.     [3,0,3,1],
  746.     [3,1,4,1],
  747.     [4,1,4,0],
  748.     [4,0,3,0],
  749.     [3,0,4,1],
  750.     [2,0,2,1],
  751.     [2,1,1,1],
  752.     [1,1,1,0],
  753.     [1,0,2,0],
  754.     [1,0,2,1]
  755. ];
  756. alphabet[59] = [
  757.     [0,0,0,0]
  758. ];
  759. alphabet[60] = [
  760.     [4,0,0,4],
  761.     [0,4,2,4],
  762.     [2,4,2,8],
  763.     [2,8,6,8],
  764.     [6,8,6,4],
  765.     [6,4,8,4],
  766.     [8,4,4,0]
  767. ];
  768. alphabet[61] = [
  769.     [3,2,3,0],
  770.     [1,0,1,2]
  771. ];
  772. alphabet[62] = [
  773.     [2,0,2,4],
  774.     [2,4,0,4],
  775.     [0,4,4,8],
  776.     [4,8,8,4],
  777.     [8,4,6,4],
  778.     [6,4,6,0],
  779.     [6,0,2,0]
  780. ];
  781. alphabet[63] = [
  782.     [0,0,0,1],
  783.     [0,1,1,2],
  784.     [1,2,2,1],
  785.     [3,1,4,1]
  786. ];
  787. alphabet[64] = [
  788.     [0,0,9,0],
  789.     [9,0,6,3],
  790.     [6,3,6,6],
  791.     [6,6,0,0]
  792. ];
  793.  
  794. alphabet[65] = [
  795.     [4,2,2,2],
  796.     [2,2,0,1],
  797.     [0,1,2,0],
  798.     [2,0,4,0],
  799.     [2,0,2,2]
  800. ];
  801. alphabet[66] = [
  802.     [4,0,0,0],
  803.     [0,0,0,1],
  804.     [0,1,1,2],
  805.     [1,2,2,1],
  806.     [2,1,2,0],
  807.     [2,1,3,2],
  808.     [3,2,4,1],
  809.     [4,1,4,0]
  810. ];
  811. alphabet[67] = [
  812.     [4,2,4,1],
  813.     [4,1,3,0],
  814.     [3,0,1,0],
  815.     [1,0,0,1],
  816.     [0,1,0,2]
  817. ];
  818. alphabet[68] = [
  819.     [0,0,4,0],
  820.     [4,0,4,1],
  821.     [4,1,3,2],
  822.     [3,2,1,2],
  823.     [1,2,0,1],
  824.     [0,1,0,0]
  825. ];
  826. alphabet[69] = [
  827.     [0,0,4,0],
  828.     [0,2,0,0],
  829.     [2,0,2,1],
  830.     [4,0,4,2]
  831. ];
  832. alphabet[70] = [
  833.     [0,0,4,0],
  834.     [0,2,0,0],
  835.     [2,0,2,1]
  836. ];
  837. alphabet[71] = [
  838.     [0,2,0,1],
  839.     [0,1,1,0],
  840.     [1,0,3,0],
  841.     [3,0,4,1],
  842.     [4,1,4,2],
  843.     [4,2,2,2],
  844.     [2,2,2,1]
  845. ];
  846. alphabet[72] = [
  847.     [4,2,0,2],
  848.     [2,2,2,0],
  849.     [0,0,4,0]
  850. ];
  851. alphabet[73] = [
  852.     [4,2,4,0],
  853.     [4,1,0,1],
  854.     [0,0,0,2]
  855. ];
  856. alphabet[74] = [
  857.     [0,0,0,2],
  858.     [0,2,3,2],
  859.     [3,2,4,1],
  860.     [4,1,3,0]
  861. ];
  862. alphabet[75] = [
  863.     [0,0,4,0],
  864.     [4,2,2,0],
  865.     [2,0,0,2]
  866. ];
  867. alphabet[76] = [
  868.     [0,0,4,0],
  869.     [4,0,4,2]
  870. ];
  871. alphabet[77] = [
  872.     [0,0,4,0],
  873.     [0,0,2,1],
  874.     [2,1,0,2],
  875.     [0,2,4,2]
  876. ];
  877. alphabet[78] = [
  878.     [4,0,0,0],
  879.     [0,0,4,2],
  880.     [4,2,0,2]
  881. ];
  882. alphabet[79] = [
  883.     [1,0,3,0],
  884.     [3,0,4,1],
  885.     [4,1,3,2],
  886.     [3,2,1,2],
  887.     [1,2,0,1],
  888.     [0,1,1,0]
  889. ];
  890. alphabet[80] = [
  891.     [4,0,0,0],
  892.     [0,0,0,1],
  893.     [0,1,1,2],
  894.     [1,2,2,1],
  895.     [2,1,2,0]
  896. ];
  897. alphabet[81] = [
  898.     [4,1,3,2],
  899.     [3,2,1,2],
  900.     [1,2,0,1],
  901.     [0,1,1,0],
  902.     [1,0,3,0],
  903.     [4,1,3,0],
  904.     [3,1,4,2]
  905. ];
  906. alphabet[82] = [
  907.     [4,0,0,0],
  908.     [0,0,0,1],
  909.     [0,1,1,2],
  910.     [1,2,2,1],
  911.     [2,1,2,0],
  912.     [2,1,4,2]
  913. ];
  914. alphabet[83] = [
  915.     [4,0,4,1],
  916.     [4,1,3,2],
  917.     [3,2,1,0],
  918.     [1,0,0,1],
  919.     [0,1,0,2]
  920. ];
  921. alphabet[84] = [
  922.     [0,2,0,0],
  923.     [0,1,4,1]
  924. ];
  925. alphabet[85] = [
  926.     [0,2,3,2],
  927.     [3,2,4,1],
  928.     [4,1,3,0],
  929.     [3,0,0,0]
  930. ];
  931. alphabet[86] = [
  932.     [0,0,4,1],
  933.     [4,1,0,2]
  934. ];
  935. alphabet[87] = [
  936.     [0,0,4,0],
  937.     [4,0,2,1],
  938.     [2,1,4,2],
  939.     [4,2,0,2]
  940. ];
  941. alphabet[88] = [
  942.     [0,0,4,2],
  943.     [4,0,0,2]
  944. ];
  945. alphabet[89] = [
  946.     [0,0,2,1],
  947.     [2,1,0,2],
  948.     [2,1,4,1]
  949. ];
  950. alphabet[90] = [
  951.     [0,0,0,2],
  952.     [0,2,4,0],
  953.     [4,0,4,2]
  954. ];
  955. alphabet[91] = [
  956.     [0,1,0,0],
  957.     [0,0,4,0],
  958.     [4,0,4,1]
  959. ];
  960. alphabet[92] = [
  961.     [4,2,0,0]
  962. ];
  963. alphabet[93] = [
  964.     [0,1,0,2],
  965.     [0,2,4,2],
  966.     [4,2,4,1]
  967. ];
  968. alphabet[94] = [
  969.     [1,2,0,1],
  970.     [0,1,1,0]
  971. ];
  972. alphabet[95] = [
  973.     [4,0,4,2]
  974. ];
  975. alphabet[96] = [
  976.     [0,0,1,1]
  977. ];
  978. alphabet[97] = [
  979.     [2,2,4,2],
  980.     [4,2,4,1],
  981.     [4,1,3,0],
  982.     [3,0,2,1],
  983.     [2,1,2,2]
  984. ];
  985. alphabet[98] = [
  986.     [0,0,4,0],
  987.     [4,0,4,1],
  988.     [4,1,3,2],
  989.     [3,2,2,1],
  990.     [2,1,2,0]
  991. ];
  992. alphabet[99] = [
  993.     [2,2,2,1],
  994.     [2,1,3,0],
  995.     [3,0,4,1],
  996.     [4,1,4,2]
  997. ];
  998. alphabet[100] = [
  999.     [2,2,2,1],
  1000.     [2,1,3,0],
  1001.     [3,0,4,1],
  1002.     [4,1,4,2],
  1003.     [4,2,0,2]
  1004. ];
  1005. alphabet[101] = [
  1006.     [3,0,3,2],
  1007.     [3,2,2,1],
  1008.     [2,1,3,0],
  1009.     [3,0,4,1],
  1010.     [4,1,4,2]
  1011. ];
  1012. alphabet[102] = [
  1013.     [4,0,1,0],
  1014.     [1,0,0,1],
  1015.     [2,1,2,0]
  1016. ];
  1017. alphabet[103] = [
  1018.     [4,2,4,1],
  1019.     [4,1,3,0],
  1020.     [3,0,2,1],
  1021.     [2,1,2,2],
  1022.     [2,2,4,2],
  1023.     [4,2,5,1],
  1024.     [5,1,5,0]
  1025. ];
  1026. alphabet[104] = [
  1027.     [4,0,0,0],
  1028.     [2,0,2,1],
  1029.     [2,1,3,2],
  1030.     [3,2,4,2]
  1031. ];
  1032. alphabet[105] = [
  1033.     [4,1,2,1],
  1034.     [1,1,0,1],
  1035.     [2,0,2,1],
  1036.     [4,0,4,2]
  1037. ];
  1038. alphabet[106] = [
  1039.     [0,1,1,1],
  1040.     [2,1,4,1],
  1041.     [4,1,5,0]
  1042. ];
  1043. alphabet[107] = [
  1044.     [4,0,0,0],
  1045.     [2,2,3,0],
  1046.     [3,0,4,2]
  1047. ];
  1048. alphabet[108] = [
  1049.     [4,1,3,0],
  1050.     [3,0,0,0]
  1051. ];
  1052. alphabet[109] = [
  1053.     [4,0,2,0],
  1054.     [2,0,2,1],
  1055.     [2,1,4,1],
  1056.     [4,2,3,2],
  1057.     [3,2,2,1]
  1058. ];
  1059. alphabet[110] = [
  1060.     [4,0,2,0],
  1061.     [2,0,2,1],
  1062.     [2,1,3,2],
  1063.     [3,2,4,2]
  1064. ];
  1065. alphabet[111] = [
  1066.     [4,1,3,2],
  1067.     [3,2,2,1],
  1068.     [2,1,3,0],
  1069.     [3,0,4,1]
  1070. ];
  1071. alphabet[112] = [
  1072.     [4,1,3,2],
  1073.     [3,2,2,1],
  1074.     [4,1,4,0],
  1075.     [5,0,2,0],
  1076.     [2,0,2,1]
  1077. ];
  1078. alphabet[113] = [
  1079.     [2,2,2,1],
  1080.     [2,1,3,0],
  1081.     [3,0,4,1],
  1082.     [4,1,4,2],
  1083.     [2,2,5,2]
  1084. ];
  1085. alphabet[114] = [
  1086.     [4,0,2,0],
  1087.     [3,0,2,1],
  1088.     [2,1,2,2]
  1089. ];
  1090. alphabet[115] = [
  1091.     [4,0,4,1],
  1092.     [4,1,3,2],
  1093.     [3,2,3,0],
  1094.     [3,0,2,1],
  1095.     [2,1,2,2]
  1096. ];
  1097. alphabet[116] = [
  1098.     [4,1,3,0],
  1099.     [3,0,0,0],
  1100.     [1,1,1,0]
  1101. ];
  1102. alphabet[117] = [
  1103.     [2,0,3,0],
  1104.     [3,0,4,1],
  1105.     [4,1,4,2],
  1106.     [4,2,2,2]
  1107. ];
  1108. alphabet[118] = [
  1109.     [2,0,4,1],
  1110.     [4,1,2,2]
  1111. ];
  1112. alphabet[119] = [
  1113.     [2,0,4,0],
  1114.     [4,0,3,1],
  1115.     [3,1,4,2],
  1116.     [4,2,2,2]
  1117. ];
  1118. alphabet[120] = [
  1119.     [4,2,2,0],
  1120.     [4,0,2,2]
  1121. ];
  1122. alphabet[121] = [
  1123.     [2,0,3,0],
  1124.     [3,0,4,1],
  1125.     [4,1,4,2],
  1126.     [2,2,4,2],
  1127.     [4,2,5,1],
  1128.     [5,1,5,0]
  1129. ];
  1130. alphabet[122] = [
  1131.     [4,2,4,0],
  1132.     [4,0,2,2],
  1133.     [2,2,2,0]
  1134. ];
  1135. alphabet[123] = [
  1136.     [0,2,0,1],
  1137.     [0,1,1,1],
  1138.     [1,1,2,0],
  1139.     [2,0,3,1],
  1140.     [3,1,4,1],
  1141.     [4,1,4,2]
  1142. ];
  1143. alphabet[124] = [
  1144.     [4,1,0,1]
  1145. ];
  1146. alphabet[125] = [
  1147.     [0,0,0,1],
  1148.     [0,1,1,1],
  1149.     [1,1,2,2],
  1150.     [2,2,3,1],
  1151.     [3,1,4,1],
  1152.     [4,1,4,0]
  1153. ];
  1154.  
  1155.  
  1156. function sa(f) {
  1157.     return f << 1
  1158. }
  1159.  
  1160. function ta(f) {
  1161.     return f << 1
  1162. }
  1163.  
  1164. function U() {
  1165.     //return E.pointerLockElement === y || E.mozPointerLockElement === y || E.webkitPointerLockElement === y
  1166. }
  1167.  
  1168. function ba() {
  1169.     a.fillStyle = "#000000";
  1170.     a.font = "35px NovaSquare";
  1171.     a.fillText("Please do not embed our website, thank you.", 400 - a.measureText("Please do not embed our website, thank you.").width / 2, 300);
  1172.     a.font = "16px NovaSquare";
  1173.     a.fillText("Play the game on http://cursors.io/", 400 - a.measureText("Play the game on http://cursors.io/").width /
  1174.         2, 330);
  1175.     top.location = "http://cursors.io";
  1176.     throw "Please do not embed our website, thank you.";
  1177. }
  1178.  
  1179. function ua(f) {
  1180.     V(f)
  1181. }
  1182.  
  1183. // Apparently unimportant
  1184. function W(f, b) {
  1185.     J = f;
  1186.     K = b;
  1187.     k = v = f;
  1188.     q = w = b;
  1189.     B = v << 1;
  1190.     C = w << 1
  1191. }
  1192.  
  1193. // Handles clicking
  1194. function va(f) {
  1195.     if (D) return L = !1, V(f), !1;
  1196.     //U() ? X || (X = !0, W(k, q)) : (X = !1, D || M.checked || y.requestPointerLock && y.requestPointerLock());
  1197.     if (L) L = !1, Q();
  1198.     else if (V(f), (f.ctrlKey || f.shiftKey) && !H.checked) Y = !0, R = k, S = q;
  1199.     else if (100 < t - ca && v == k && w == q) {
  1200.         ca = t;
  1201.         I.push([v << 1, w << 1, t]);
  1202.         wa(v, w, 11);
  1203.         var b = [v, w];
  1204.         N.push(b);
  1205.         setTimeout(function() {
  1206.             N.remove(b)
  1207.         }, 1E3)
  1208.     }
  1209.     return !1
  1210. }
  1211.  
  1212. // Apparently unimportant
  1213. function xa(f) {
  1214.     Y = !1
  1215. }
  1216.  
  1217. // Sets local storage for cursor lock and drawing
  1218. function ya() {
  1219.     A.localStorage && M && (A.localStorage.setItem("noCursorLock", M.checked ? "1" : "0"), A.localStorage.setItem("noDrawings", H.checked ? "1" : "0"))
  1220. }
  1221.  
  1222. // Handles mouse movement and drawing
  1223. function V(f) {
  1224.     if (U()) {
  1225.         var b = f.webkitMovementX || f.mozMovementX || f.movementX || 0;
  1226.         f = f.webkitMovementY || f.mozMovementY || f.movementY || 0;
  1227.         300 > Math.abs(b) + Math.abs(f) && (B += b, C += f, v = B >> 1, w = C >> 1)
  1228.     } else f.offsetX ? (B = f.offsetX, C = f.offsetY) : f.layerX && (B = f.layerX, C = f.layerY), v = B >> 1, w = C >> 1;
  1229.     k = v, q = w; /* Changed to allow movement through walls */
  1230.     lastX = posX;
  1231.     lastY = posY;
  1232.     posX = k;
  1233.     posY = q;
  1234.     if (debugMode) console.log(v + ", " + w);
  1235.     if (Z(), !U() || v == k && w == q || (f = b = 0, v > k && (b = 1),
  1236.             w > q && (f = 1), v = k, w = q, B = (v << 1) + b, C = (w << 1) + f), Y && (R != k || S != q) && 50 < t - da) {
  1237.         b = R;
  1238.         f = S;
  1239.         var a = k,
  1240.             d = q;
  1241.         if (!D && null != u && u.readyState == WebSocket.OPEN) {
  1242.             var g = new ArrayBuffer(9),
  1243.                 e = new DataView(g);
  1244.  
  1245.             e.setUint8(0, 3);
  1246.             e.setUint16(1, b, !0);
  1247.             e.setUint16(3, f, !0);
  1248.             e.setUint16(5, a, !0);
  1249.             e.setUint16(7, d, !0);
  1250.             u.send(g)
  1251.  
  1252.             if (markerEnabled) {
  1253.                 e.setUint8(0, 3);
  1254.                 e.setUint16(1, b+2, !0);
  1255.                 e.setUint16(3, f, !0);
  1256.                 e.setUint16(5, a+2, !0);
  1257.                 e.setUint16(7, d, !0);
  1258.                 u.send(g)
  1259.                 e.setUint8(0, 3);
  1260.                 e.setUint16(1, b, !0);
  1261.                 e.setUint16(3, f+2, !0);
  1262.                 e.setUint16(5, a, !0);
  1263.                 e.setUint16(7, d+2, !0);
  1264.                 u.send(g)
  1265.                 e.setUint8(0, 3);
  1266.                 e.setUint16(1, b-2, !0);
  1267.                 e.setUint16(3, f, !0);
  1268.                 e.setUint16(5, a-2, !0);
  1269.                 e.setUint16(7, d, !0);
  1270.                 u.send(g)
  1271.                 e.setUint8(0, 3);
  1272.                 e.setUint16(1, b, !0);
  1273.                 e.setUint16(3, f-2, !0);
  1274.                 e.setUint16(5, a, !0);
  1275.                 e.setUint16(7, d-2, !0);
  1276.                 u.send(g)
  1277.             }
  1278.         }
  1279.         R = k;
  1280.         S = q;
  1281.         da = t
  1282.     }
  1283. }
  1284.  
  1285. // Apparently not important
  1286. function Z() {
  1287.     ea(k, q) && Q();
  1288.     if (z(k, q)) {
  1289.         var a;
  1290.         a: {
  1291.             a = k;
  1292.             var b = q,
  1293.                 c = [],
  1294.                 d = new Uint8Array(12E4);
  1295.             c.push([a, b]);
  1296.             d[a + 400 * b] = 1;
  1297.             do {
  1298.                 var g = c.shift(),
  1299.                     e = g[0],
  1300.                     g = g[1];
  1301.                 if (!(0 > e || 0 > g || 400 <= e || 300 <= g)) {
  1302.                     if (!z(e, g)) {
  1303.                         a = {
  1304.                             x: e,
  1305.                             y: g
  1306.                         };
  1307.                         break a
  1308.                     }
  1309.                     d[e -
  1310.                         1 + 400 * g] || (c.push([e - 1, g]), d[e - 1 + 400 * g] = 1);
  1311.                     d[e + 1 + 400 * g] || (c.push([e + 1, g]), d[e + 1 + 400 * g] = 1);
  1312.                     d[e + 400 * (g - 1)] || (c.push([e, g - 1]), d[e + 400 * (g - 1)] = 1);
  1313.                     d[e + 400 * (g + 1)] || (c.push([e, g + 1]), d[e + 400 * (g + 1)] = 1)
  1314.                 }
  1315.             } while (0 < c.length);
  1316.             a = {
  1317.                 x: a,
  1318.                 y: b
  1319.             }
  1320.         }
  1321.         k = a.x;
  1322.         q = a.y
  1323.     }
  1324.     if (k != v || q != w) a = fa(k, q, v, w), k = a.x, q = a.y;
  1325.     ea(k, q) && Q()
  1326. }
  1327.  
  1328. // Cleans up map on level transition
  1329. function $() {
  1330.     console.log("Next map");
  1331.     initialLoad = true;
  1332.     for (var i = 0; i < maxButtons; i++)
  1333.         buttons[i] = new Array(3);
  1334.     buttonIndex = 0;
  1335.     T.set(za);
  1336.     r = [];
  1337.     I = [];
  1338.     O = []
  1339. }
  1340.  
  1341. // Enables image smoothing
  1342. function ga(f) {
  1343.     a.imageSmoothingEnabled = f;
  1344.     a.mozImageSmoothingEnabled = f;
  1345.     a.oImageSmoothingEnabled = f;
  1346.     a.webkitImageSmoothingEnabled = f
  1347. }
  1348.  
  1349. // Prints connected message
  1350. function Aa() {
  1351.     $();
  1352.     console.log("Connected!")
  1353. }
  1354.  
  1355. // Prints socket closed message
  1356. function Ba(a) {
  1357.     $();
  1358.     console.log("Socket closed: " + a.reason)
  1359. }
  1360.  
  1361. // Prints socket error message
  1362. function Ca(a) {
  1363.     console.log("Socket error")
  1364. }
  1365.  
  1366. // Gets strings, but without it the map won't load
  1367. function Da(a, b) {
  1368.     for (var c = "", d = 0, g = 0; 0 != (g = a.getUint8(b)); ++b) d <<= 8, d |= g, g & 128 || (c += String.fromCharCode(d), d = 0);
  1369.     0 != d && (c += String.fromCharCode(d));
  1370.     return [c, b + 1]
  1371. }
  1372.  
  1373. // You get a TERRIBLE framerate if you remove the contents of this function
  1374. function Ea(a, b) {
  1375.     setTimeout(function() {
  1376.         var c = a.getUint16(b, !0),
  1377.             d = 0;
  1378.         a: for (; d < c; d++) {
  1379.             for (var g = a.getUint16(b + 2 + 4 * d, !0), e = a.getUint16(b + 4 + 4 * d, !0), n = 0; n < N.length; n++) {
  1380.                 var l = N[n];
  1381.                 if (l[0] == g && l[1] == e) {
  1382.                     N.splice(n, 1);
  1383.                     continue a
  1384.                 }
  1385.             }
  1386.             I.push([g << 1, e << 1, t])
  1387.         }
  1388.     }, 100);
  1389.     return b +
  1390.         2 + 4 * a.getUint16(b, !0)
  1391. }
  1392.  
  1393. // Apparently not important
  1394. function Fa(a, b) {
  1395.     !H.checked && setTimeout(function() {
  1396.         for (var c = a.getUint16(b, !0), d = 0; d < c; d++) {
  1397.             var g = a.getUint16(b + 2 + 8 * d, !0),
  1398.                 e = a.getUint16(b + 4 + 8 * d, !0),
  1399.                 n = a.getUint16(b + 6 + 8 * d, !0),
  1400.                 l = a.getUint16(b + 8 + 8 * d, !0);
  1401.             O.push([g << 1, e << 1, n << 1, l << 1, t])
  1402.         }
  1403.     }, 50);
  1404.     return b + 2 + 8 * a.getUint16(b, !0)
  1405. }
  1406.  
  1407. // Draws the level. Or at least, without it the level doesn't show up.
  1408. function Ga(a) {
  1409.     buttonIndex = 0;
  1410.     initialLoad = false;
  1411.     a = a.data;
  1412.     var b = new DataView(a);
  1413.     switch (b.getUint8(0)) {
  1414.         case 0: // If this doesn't run then you see two of your cursor. One of them lags behind
  1415.             ha = b.getUint32(1, !0);
  1416.             break;
  1417.         case 1: // Without this, doors don't show up
  1418.             var c;
  1419.             ia = c = b.getUint16(1, !0);
  1420.             ja = 100 <= c;
  1421.             var d = [],
  1422.                 g;
  1423.             for (g in F) F.hasOwnProperty(g) && d.push(g);
  1424.             for (var e =
  1425.                     0; e < c; e++) {
  1426.                 g = b.getUint32(3 + 8 * e, !0);
  1427.                 var n = b.getUint16(7 + 8 * e, !0),
  1428.                     l = b.getUint16(9 + 8 * e, !0);
  1429.                 if (g != ha)
  1430.                     if (null != F[g]) {
  1431.                         for (var p = 0; p < d.length; p++)
  1432.                             if (d[p] == g) {
  1433.                                 d.splice(p, 1);
  1434.                                 break
  1435.                             }
  1436.                         g = F[g];
  1437.                         g.oldX = g.getX();
  1438.                         g.oldY = g.getY();
  1439.                         g.newX = n;
  1440.                         g.newY = l;
  1441.                         g.time = t
  1442.                     } else F[g] = new ka(n, l)
  1443.             }
  1444.             for (e = 0; e < d.length; e++) delete F[d[e]];
  1445.             c = Ea(b, 3 + 8 * c);
  1446.             g = b.getUint16(c, !0);
  1447.             c += 2;
  1448.             for (d = 0; d < g; d++) {
  1449.                 a: for (n = b.getUint32(c, !0), e = 0; e < r.length; e++)
  1450.                     if (r[e].id == n) {
  1451.                         var k = r[e];
  1452.                         if (1 == k.type)
  1453.                             for (var n = k.x | 0, l = k.y | 0, p = k.width | 0, k = k.height | 0, m = l; m < l + k; ++m)
  1454.                                 for (var h =
  1455.                                         n; h < n + p; ++h) --T[h + 400 * m];
  1456.                         r.splice(e, 1);
  1457.                         break a
  1458.                     }c += 4
  1459.             }
  1460.             g = b.getUint16(c, !0);
  1461.             c += 2;
  1462.             for (d = 0; d < g; d++) {
  1463.                 a: {
  1464.                     e = b.getUint32(c, !0);
  1465.                     for (n = 0; n < r.length; n++)
  1466.                         if (r[n].id == e) {
  1467.                             e = r[n];
  1468.                             break a
  1469.                         }
  1470.                     e = {
  1471.                         id: e
  1472.                     };
  1473.                     r.push(e)
  1474.                 }
  1475.                 c += 4;c = la(b, c, e)
  1476.             }
  1477.             c = Fa(b, c);
  1478.             if (a.byteLength < c + 4) break;
  1479.             aa = b.getUint32(c, !0);
  1480.             break;
  1481.         case 4: // Without this the level don't show
  1482.             $();
  1483.             W(b.getUint16(1, !0), b.getUint16(3, !0));
  1484.             g = b.getUint16(5, !0);
  1485.             c = 7;
  1486.             for (d = 0; d < g; d++) e = {}, e.id = b.getUint32(c, !0), c += 4, c = la(b, c, e), r.push(e);
  1487.             a.byteLength >= c + 4 ? G = Math.max(G, b.getUint32(c, !0)) : a.byteLength >= c + 2 && (G = Math.max(G, b.getUint16(c, !0)));
  1488.             Z();
  1489.             break;
  1490.         case 5: // Without this things don't trigger unless you are drawing. Also, you can't click buttons.
  1491.             W(b.getUint16(1, !0), b.getUint16(3, !0)), 9 <= b.byteLength ? G = Math.max(G, b.getUint32(5, !0)) : 7 <= b.byteLength && (G = Math.max(G, b.getUint16(5, !0))), Z()
  1492.     }
  1493. }
  1494.  
  1495. // Without this, your position only updates if you click or draw
  1496. function Q() {
  1497.     lastFrame = currentFrame;
  1498.     currentFrame = new Date().getTime();
  1499.  
  1500.     if (!(D || L || null == u || u.readyState != WebSocket.OPEN || k == J && q == K) && movementEnabled) {
  1501.         var a = new ArrayBuffer(9);
  1502.             b = new DataView(a);
  1503.         b.setUint8(0, 1);
  1504.         b.setUint16(1, k, !0);
  1505.         b.setUint16(3, q, !0);
  1506.         b.setUint32(5, G, !0);
  1507.         u.send(a);
  1508.         J = k;
  1509.         K = q
  1510.     }
  1511.  
  1512.     if (auraEnabled) // Drawing cursor aura
  1513.         drawAura(J, K);
  1514. }
  1515.  
  1516. // Without this clicking doesn't actually get transmitted to the server
  1517. function wa(a, b, numClicks) {
  1518.     if (!D && null != u && u.readyState == WebSocket.OPEN) {
  1519.         var c = new ArrayBuffer(9),
  1520.             d = new DataView(c);
  1521.         d.setUint8(0, 2);
  1522.         d.setUint16(1, a, !0);
  1523.         d.setUint16(3, b, !0);
  1524.         d.setUint32(5, G, !0);
  1525.         for (var i = 0; i < numClicks; i++) { u.send(c) } // Changed to click multiple times
  1526.     }
  1527. }
  1528.  
  1529. function la(f, b, c) {
  1530.     function d() { // Handles drawing stuff
  1531.         if (c.type == 4 && initialLoad) {
  1532.             c.x = f.getUint16(b, !0);
  1533.             buttons[buttonIndex][0] = c.x
  1534.             b += 2;
  1535.             c.y = f.getUint16(b, !0);
  1536.             buttons[buttonIndex][1] = c.y
  1537.             b += 2;
  1538.             c.width = f.getUint16(b, !0);
  1539.             b += 2;
  1540.             c.height = f.getUint16(b, !0);
  1541.             b += 2
  1542.  
  1543.             buttonIndex++;
  1544.         } else {
  1545.             c.x = f.getUint16(b, !0);
  1546.             b += 2;
  1547.             c.y = f.getUint16(b, !0);
  1548.             b += 2;
  1549.             c.width = f.getUint16(b, !0);
  1550.             b += 2;
  1551.             c.height = f.getUint16(b, !0);
  1552.             b += 2
  1553.         }
  1554.     }
  1555.     function g() { // Handles coloring stuff
  1556.         for (var a = f.getUint32(b, !0).toString(16); 6 > a.length;) a = "0" + a;
  1557.         b += 4;
  1558.         c.color = "#" + a
  1559.     }
  1560.     var e = f.getUint8(b);
  1561.     b += 1;
  1562.     c.type = e;
  1563.     switch (e) {
  1564.         case 255:
  1565.             break;
  1566.         case 0: // Draws text
  1567.             c.x = f.getUint16(b, !0);
  1568.             b += 2;
  1569.             c.y = f.getUint16(b, !0);
  1570.             b += 2;
  1571.             c.size = f.getUint8(b);
  1572.             b += 1;
  1573.             c.isCentered = !!f.getUint8(b);
  1574.             b += 1;
  1575.             e = Da(f, b);
  1576.             c.text = e[0];
  1577.             b = e[1];
  1578.             break;
  1579.         case 1: // May relate to cursor movement?
  1580.             d();
  1581.             var n = !c.color;
  1582.             g();
  1583.             var e = c.x | 0,
  1584.                 l = c.y | 0,
  1585.                 p = c.width | 0,
  1586.                 k = c.height | 0;
  1587.             if (n)
  1588.                 for (n = l; n < l + k; ++n)
  1589.                     for (var m = e; m < e + p; ++m) ++T[m + 400 * n];
  1590.             break;
  1591.         case 2: // Draws exit points
  1592.             d();
  1593.             c.isBad = !!f.getUint8(b);
  1594.             b += 1;
  1595.             break;
  1596.         case 3: // Handles the area triggers
  1597.             d();
  1598.             c.count = f.getUint16(b, !0);
  1599.             b += 2;
  1600.             g();
  1601.             break;
  1602.         case 4: // Something about buttons, but also affects doors and area triggers
  1603.             d();
  1604.             c.count ? c.count > f.getUint16(b, !0) && (c.lastClickAt = t) : c.lastClickAt = 0;
  1605.             c.count = f.getUint16(b, !0);
  1606.             if (initialLoad) buttons[buttonIndex-1][2] = 1;
  1607.             b += 2;
  1608.             g();
  1609.             break;
  1610.         case 5:
  1611.             c.x = f.getUint16(b, !0);
  1612.             b += 2;
  1613.             c.y = f.getUint16(b, !0);
  1614.             b += 2;
  1615.             c.queue = [
  1616.                 [0, c.x, c.y]
  1617.             ];
  1618.             c.potentialQueue = [];
  1619.             c.explored = new Uint8Array(12E4);
  1620.             c.img = a.createImageData(400, 300);
  1621.             e = E.createElement("canvas");
  1622.             e.width = 400;
  1623.             e.height = 300;
  1624.             c.canvas = e;
  1625.             c.ctx = c.canvas.getContext("2d");
  1626.             break;
  1627.         default:
  1628.             throw Error("Unknown object type " + e);
  1629.     }
  1630.     return b
  1631. }
  1632.  
  1633. function ea(a, b) {
  1634.     if (-1 != J && -1 != K) {
  1635.         var c = fa(J, K, a, b);
  1636.         if (c.x != a || c.y != b) return !0
  1637.     }
  1638.     for (c = 0; c < r.length; c++) {
  1639.         var d = r[c];
  1640.         if (2 == d.type && !(k < d.x || q < d.y || k >= d.x + d.width || q >= d.y + d.height)) return !0
  1641.     }
  1642.     return !1
  1643. }
  1644.  
  1645. function ma() {
  1646.     a.clearRect(0, 0, 800, 600);
  1647.     a.save();
  1648.     if (null != u && u.readyState != WebSocket.OPEN || L) {
  1649.         var f;
  1650.         if (null == u) f = "Click to begin";
  1651.         else switch (u.readyState) {
  1652.             case WebSocket.CONNECTING:
  1653.                 f = "Connecting";
  1654.                 break;
  1655.             case WebSocket.CLOSING:
  1656.             case WebSocket.CLOSED:
  1657.                 f = "Lost connection to server";
  1658.                 break;
  1659.             default:
  1660.                 f = "Click to begin"
  1661.         }
  1662.         a.font = "60px NovaSquare";
  1663.         a.fillText(f, 400 - a.measureText(f).width / 2, 315);
  1664.         na();
  1665.         oa(!1)
  1666.     } else {
  1667.         a.fillStyle = "#000000";
  1668.         a.save();
  1669.         a.globalAlpha = 1;
  1670.         Ha();
  1671.         for (f = 0; f < r.length; f++) {
  1672.             var b = r[f];
  1673.             if (0 == b.type) {
  1674.                 a.font = b.size + "px NovaSquare";
  1675.                 var c = b.x << 1,
  1676.                     d = b.y << 1;
  1677.                 b.isCentered && (c -= a.measureText(b.text).width / 2);
  1678.                 a.fillStyle = "#000000";
  1679.                 a.fillText(b.text,
  1680.                     c, d)
  1681.             } else if (1 == b.type) a.fillStyle = b.color, a.fillRect(b.x << 1, b.y << 1, b.width << 1, b.height << 1), a.strokeStyle = "#000000", a.globalAlpha = .2, a.lineWidth = 2, a.strokeRect((b.x << 1) + 1, (b.y << 1) + 1, (b.width << 1) - 2, (b.height << 1) - 2), a.globalAlpha = 1;
  1682.             else if (2 == b.type) a.fillStyle = b.isBad ? "#FF0000" : "#00FF00", a.globalAlpha = .2, a.fillRect(b.x << 1, b.y << 1, b.width << 1, b.height << 1), a.globalAlpha = 1;
  1683.             else if (3 == b.type) {
  1684.                 var c = b.x << 1,
  1685.                     d = b.y << 1,
  1686.                     g = b.width << 1,
  1687.                     e = b.height << 1;
  1688.                 a.fillStyle = b.color;
  1689.                 a.globalAlpha = .2;
  1690.                 a.fillRect(c, d, g, e);
  1691.                 a.globalAlpha =
  1692.                     .5;
  1693.                 a.fillStyle = "#000000";
  1694.                 40 > b.width || 40 > b.height ? (a.font = "30px NovaSquare", a.fillText(b.count, c + g / 2 - a.measureText(b.count).width / 2, d + e / 2 + 10)) : (a.font = "60px NovaSquare", a.fillText(b.count, c + g / 2 - a.measureText(b.count).width / 2, d + e / 2 + 20));
  1695.                 a.globalAlpha = 1
  1696.             } else if (4 == b.type) {
  1697.                 c = b.x << 1;
  1698.                 d = b.y << 1;
  1699.                 g = b.width << 1;
  1700.                 e = b.height << 1;
  1701.                 a.fillStyle = b.color;
  1702.                 a.strokeStyle = b.color;
  1703.                 a.globalAlpha = 1;
  1704.                 a.fillRect(c, d, g, e);
  1705.                 a.globalAlpha = .2;
  1706.                 a.fillStyle = "#000000";
  1707.                 a.fillRect(c, d, g, e);
  1708.                 a.globalAlpha = 1;
  1709.                 a.fillStyle = b.color;
  1710.                 var n = 150 > t - b.lastClickAt,
  1711.                     l = n ? 8 : 12;
  1712.                 a.fillRect(c + l, d + l, g - 2 * l, e - 2 * l);
  1713.                 a.strokeStyle = "#000000";
  1714.                 a.globalAlpha = .1;
  1715.                 a.beginPath();
  1716.                 a.moveTo(c, d);
  1717.                 a.lineTo(c + l, d + l);
  1718.                 a.moveTo(c + g, d);
  1719.                 a.lineTo(c + g - l, d + l);
  1720.                 a.moveTo(c, d + e);
  1721.                 a.lineTo(c + l, d + e - l);
  1722.                 a.moveTo(c + g, d + e);
  1723.                 a.lineTo(c + g - l, d + e - l);
  1724.                 a.moveTo(c, d);
  1725.                 a.rect(c, d, g, e);
  1726.                 a.rect(c + l, d + l, g - 2 * l, e - 2 * l);
  1727.                 a.stroke();
  1728.                 a.fillStyle = "#000000";
  1729.                 a.globalAlpha = .5;
  1730.                 50 > b.width || 50 > b.height ? (a.font = "35px NovaSquare", a.fillText(b.count, c + g / 2 - a.measureText(b.count).width / 2, d + e / 2 + 13)) : (a.font = "45px NovaSquare", a.fillText(b.count,
  1731.                     c + g / 2 - a.measureText(b.count).width / 2, d + e / 2 + 16));
  1732.                 n && (a.fillStyle = "#000000", a.globalAlpha = .15, a.fillRect(c + l, d + l, g - 2 * l, e - 2 * l));
  1733.                 a.globalAlpha = 1
  1734.             } else 5 == b.type && (ga(!1), a.drawImage(b.canvas, 0, 0, 400, 300, 0, 0, 800, 600), ga(!0))
  1735.         }
  1736.         a.restore();
  1737.         D || (a.font = "12px NovaSquare", a.strokeStyle = "#000000", a.fillStyle = "#FFFFFF", a.lineWidth = 2.5, f = ja ? "Area too full, not all cursors are shown" : 30 < ia ? "Area too full, drawing is disabled" : "Use shift+click to draw", a.globalAlpha = .5, a.strokeText(f, 10, 590), a.globalAlpha = 1, a.fillText(f,
  1738.             10, 590), 0 != aa && (f = aa + " players online", b = a.measureText(f).width, a.globalAlpha = .5, a.strokeText(f, 790 - b, 590), a.globalAlpha = 1, a.fillText(f, 790 - b, 590)));
  1739.         na();
  1740.         if (!H.checked) {
  1741.             a.save();
  1742.             a.strokeStyle = "#000000";
  1743.             a.lineWidth = 1;
  1744.             t = +new Date;
  1745.             for (f = 0; f < O.length; f++) b = O[f], c = 10 - (t - b[4]) / 1E3, 0 >= c ? (O.splice(f, 1), --f) : (1 < c && (c = 1), a.globalAlpha = .3 * c, a.beginPath(), a.moveTo(b[0] - .5, b[1] - .5), a.lineTo(b[2] - .5, b[3] - .5), a.stroke());
  1746.             a.restore()
  1747.         }
  1748.         a.save();
  1749.         for (var p in F) F.hasOwnProperty(p) && a.drawImage(P, sa(F[p].getX()) - 6, ta(F[p].getY()) -
  1750.             6);
  1751.         a.restore();
  1752.         oa(!0)
  1753.     }
  1754.     a.restore();
  1755.     A.requestAnimationFrame(ma)
  1756. }
  1757.  
  1758. function na() { // draws circles when you click
  1759.     a.save();
  1760.     a.strokeStyle = "#000000";
  1761.     t = +new Date;
  1762.     for (var f = 0; f < I.length; f++) {
  1763.         var b = I[f],
  1764.             c = (t - b[2]) / 1E3,
  1765.             d = 1 - 2 * c;
  1766.         0 >= d ? (I.splice(f, 1), --f) : (c *= 50, a.beginPath(), a.globalAlpha = .3 * d, a.arc(b[0], b[1], c, 0, 2 * Math.PI, !1), a.stroke())
  1767.     }
  1768.     a.restore()
  1769. }
  1770.  
  1771. function oa(f) {
  1772.     if (D) a.save(), a.globalAlpha = 1, a.drawImage(P, B - 5, C - 5);
  1773.     else {
  1774.         var b = 0,
  1775.             c = 0;
  1776.         v != k || w != q ? (a.save(), f && (a.globalAlpha = .2, a.fillStyle = "#FF0000", a.beginPath(), a.arc(B + 2, C + 8, 20, 0, 2 * Math.PI, !1),
  1777.             a.fill()), a.globalAlpha = .5, a.drawImage(P, B - 5, C - 5), a.restore()) : (b = B & 1, c = C & 1);
  1778.         a.save();
  1779.         f && (a.globalAlpha = .2, a.fillStyle = "#FFFF00", a.beginPath(), a.arc((k << 1) + b + 2, (q << 1) + c + 8, 20, 0, 2 * Math.PI, !1), a.fill());
  1780.         a.globalAlpha = 1;
  1781.         a.drawImage(Ia, (k << 1) + b - 5, (q << 1) + c - 5)
  1782.     }
  1783.     a.restore()
  1784. }
  1785.  
  1786. function ka(a, b) {
  1787.     this.oldX = this.newX = a;
  1788.     this.oldY = this.newY = b;
  1789.     this.time = t
  1790. }
  1791.  
  1792. function pa(a) {
  1793.     return a * a * (3 - 2 * a)
  1794. }
  1795.  
  1796. function fa(a, b, c, d) {
  1797.     a |= 0;
  1798.     b |= 0;
  1799.     c |= 0;
  1800.     d |= 0;
  1801.     if (z(a, b)) return {
  1802.         x: a,
  1803.         y: b
  1804.     };
  1805.     if (a == c && b == d) return {
  1806.         x: c,
  1807.         y: d
  1808.     };
  1809.     var g = a,
  1810.         e = b;
  1811.     c = c - a | 0;
  1812.     d = d - b | 0;
  1813.     var n =
  1814.         0,
  1815.         l = 0,
  1816.         p = 0,
  1817.         k = 0;
  1818.     0 > c ? n = -1 : 0 < c && (n = 1);
  1819.     0 > d ? l = -1 : 0 < d && (l = 1);
  1820.     0 > c ? p = -1 : 0 < c && (p = 1);
  1821.     var m = Math.abs(c) | 0,
  1822.         h = Math.abs(d) | 0;
  1823.     m <= h && (m = Math.abs(d) | 0, h = Math.abs(c) | 0, 0 > d ? k = -1 : 0 < d && (k = 1), p = 0);
  1824.     c = m >> 1;
  1825.     for (d = 0; d <= m && !z(a, b); d++) g = a, e = b, c += h, c >= m ? (c -= m, a += n, b += l) : (a += p, b += k);
  1826.     return {
  1827.         x: g,
  1828.         y: e
  1829.     }
  1830. }
  1831.  
  1832. function z(a, b) {
  1833.     return 0 > a || 400 <= a || 0 > b || 300 <= b ? !0 : T[a + 400 * b]
  1834. }
  1835.  
  1836. function Ja() {
  1837.     for (var a = 0; a < r.length; a++) {
  1838.         var b = r[a];
  1839.         5 == b.type && Ka(b)
  1840.     }
  1841. }
  1842.  
  1843. function Ka(a) {
  1844.     function b(a, b, c) {
  1845.         e.push([c, a, b]);
  1846.         l[a + 400 * b] = !0;
  1847.         g(a, b)
  1848.     }
  1849.  
  1850.     function c(a, b, c) {
  1851.         p.push([c,
  1852.             a, b
  1853.         ]);
  1854.         l[a + 400 * b] = !0
  1855.     }
  1856.  
  1857.     function d(a, b) {
  1858.         return 255 != k[4 * (a + 400 * b) + 3] && !l[a + 400 * b]
  1859.     }
  1860.  
  1861.     function g(a, b) {
  1862.         var c = 4 * (a + 400 * b);
  1863.         k[c + 0] = 255;
  1864.         k[c + 1] = 153;
  1865.         k[c + 2] = 153;
  1866.         k[c + 3] = 255
  1867.     }
  1868.     for (var e = a.queue, k = a.img.data, l = a.explored, p = a.potentialQueue, r = e.length, m = 0; m < p.length; m++) z(p[m][1], p[m][2]) || (g(p[m][1], p[m][2]), e.push(p[m]), p.splice(m, 1), --m);
  1869.     for (m = 0; m < r; ++m) z(e[m][1], e[m][2]) && (p.push(e[m]), e.splice(m, 1), --m, --r);
  1870.     for (r = 0; 50 > r && 0 != e.length; ++r) {
  1871.         for (var h = Number.POSITIVE_INFINITY, q = [e[0]], m = 1; m < e.length; ++m) {
  1872.             var x = e[m][0];
  1873.             .01 > Math.abs(x - h) ? q.push(e[m]) : x < h && (h = x, q = [e[m]])
  1874.         }
  1875.         for (m = 0; m < q.length; ++m) {
  1876.             var x = q[m][0],
  1877.                 h = q[m][1],
  1878.                 s = q[m][2],
  1879.                 qa = e.indexOf(q[m]); - 1 != qa && e.splice(qa, 1);
  1880.             0 < h && d(h - 1, s) && (z(h - 1, s) ? c(h - 1, s, x + 1) : b(h - 1, s, x + 1));
  1881.             0 < s && d(h, s - 1) && (z(h, s - 1) ? c(h, s - 1, x + 1) : b(h, s - 1, x + 1));
  1882.             400 > h + 1 && d(h + 1, s) && (z(h + 1, s) ? c(h + 1, s, x + 1) : b(h + 1, s, x + 1));
  1883.             300 > s + 1 && d(h, s + 1) && (z(h, s + 1) ? c(h, s + 1, x + 1) : b(h, s + 1, x + 1));
  1884.             0 < h && 0 < s && d(h - 1, s - 1) && (z(h - 1, s - 1) ? c(h - 1, s - 1, x + Math.SQRT2) : b(h - 1, s - 1, x + Math.SQRT2));
  1885.             0 < h && 300 > s + 1 && d(h - 1, s + 1) && (z(h - 1, s + 1) ? c(h - 1, s + 1, x + Math.SQRT2) :
  1886.                 b(h - 1, s + 1, x + Math.SQRT2));
  1887.             400 > h + 1 && 0 < s && d(h + 1, s - 1) && (z(h + 1, s - 1) ? c(h + 1, s - 1, x + Math.SQRT2) : b(h + 1, s - 1, x + Math.SQRT2));
  1888.             400 > h + 1 && 300 > s + 1 && d(h + 1, s + 1) && (z(h + 1, s + 1) ? c(h + 1, s + 1, x + Math.SQRT2) : b(h + 1, s + 1, x + Math.SQRT2))
  1889.         }
  1890.     }
  1891.     a.ctx.putImageData(a.img, 0, 0)
  1892. }
  1893. var y, a, ia = 0,
  1894.     v = 0,
  1895.     w = 0,
  1896.     B = 0,
  1897.     C = 0,
  1898.     k = 0,
  1899.     q = 0,
  1900.     J = -1,
  1901.     K = -1,
  1902.     M = null,
  1903.     H = null,
  1904.     P = new Image;
  1905. P.src = "img/cursor.png";
  1906. var Ia = P,
  1907.     D = -1 != A.location.search.indexOf("editor"),
  1908.     I = [],
  1909.     O = [],
  1910.     t = 0,
  1911.     ca = 0,
  1912.     u = null,
  1913.     ha = -1,
  1914.     F = {},
  1915.     aa = 0,
  1916.     ja = !1,
  1917.     Y = !1,
  1918.     R = 0,
  1919.     S = 0,
  1920.     da = 0,
  1921.     X = !1,
  1922.     L = !D && !0,
  1923.     T = new Uint8Array(12E4),
  1924.     r = [],
  1925.     N = [];
  1926. Array.prototype.remove =
  1927.     function(a) {
  1928.         a = this.indexOf(a);
  1929.         return -1 != a ? (this.splice(a, 1), !0) : !1
  1930.     };
  1931. var G = 0;
  1932. ka.prototype = {
  1933.     oldX: 0,
  1934.     oldY: 0,
  1935.     newX: 0,
  1936.     newY: 0,
  1937.     time: 0,
  1938.     getX: function() {
  1939.         var a = this.newX - this.oldX,
  1940.             b = (t - this.time) / 100,
  1941.             b = pa(0 >= b ? 0 : 1 <= b ? 1 : b);
  1942.         return this.oldX + b * a
  1943.     },
  1944.     getY: function() {
  1945.         var a = this.newY - this.oldY,
  1946.             b = (t - this.time) / 100,
  1947.             b = pa(0 >= b ? 0 : 1 <= b ? 1 : b);
  1948.         return this.oldY + b * a
  1949.     }
  1950. };
  1951. var ra = function() {
  1952.         function f() {
  1953.             var a = 0,
  1954.                 b = 0,
  1955.                 c = v / 10,
  1956.                 d = w / 10;
  1957.             n < c ? (c = Math.ceil(c), a = Math.floor(n)) : (c = Math.floor(c), a = Math.ceil(n));
  1958.             l < d ? (d = Math.ceil(d), b = Math.floor(l)) :
  1959.                 (d = Math.floor(d), b = Math.ceil(l));
  1960.             if (a > c) var e = c,
  1961.                 c = a,
  1962.                 a = e;
  1963.             b > d && (e = d, d = b, b = e);
  1964.             return {
  1965.                 sx: a,
  1966.                 sy: b,
  1967.                 fx: c,
  1968.                 fy: d
  1969.             }
  1970.         }
  1971.  
  1972.         function b() {
  1973.             e = !0;
  1974.             n = v / 10;
  1975.             l = w / 10
  1976.         }
  1977.  
  1978.         function c(a) {
  1979.             return "0x" + parseInt(a.slice(1), 16).toString(16).toUpperCase()
  1980.         }
  1981.  
  1982.         function d(a, b, c, d, e) {
  1983.             a = {
  1984.                 x: 10 * ~~(k / 10) - ~~(a / 2) + c,
  1985.                 y: 10 * ~~(q / 10) - ~~(b / 2) + d,
  1986.                 width: a,
  1987.                 height: b
  1988.             };
  1989.             for (var f in e) e.hasOwnProperty(f) && (a[f] = e[f]);
  1990.             return a
  1991.         }
  1992.  
  1993.         function g(a, b) {
  1994.             for (var c = null, d = Number.POSITIVE_INFINITY, e = 0; e < r.length; e++) {
  1995.                 var f = r[e];
  1996.                 if (f.hasOwnProperty("x") && f.hasOwnProperty("y") && f.hasOwnProperty("width") &&
  1997.                     f.hasOwnProperty("height")) {
  1998.                     var g = f.x + f.width / 2,
  1999.                         h = f.y + f.height / 2,
  2000.                         g = (a - g) * (a - g) + (b - h) * (b - h);
  2001.                     g < d && (d = g, c = f)
  2002.                 }
  2003.             }
  2004.             return c
  2005.         }
  2006.         var e = !1,
  2007.             n = 0,
  2008.             l = 0,
  2009.             p = 1,
  2010.             u = 200,
  2011.             m = 150,
  2012.             h = new Uint8Array(1200),
  2013.             t = "#000000 #FF9999 #9999FF #FFFF99 #99FFFF #FF99FF #3333FF".split(" ");
  2014.         E.addEventListener("mouseup", function() {
  2015.             if (e) {
  2016.                 for (var a = f(), b = p, c = a.sy; c < a.fy; ++c)
  2017.                     for (var d = a.sx; d < a.fx; ++d) h[d + 40 * c] = b;
  2018.                 e = !1
  2019.             }
  2020.         });
  2021.         E.addEventListener("mousemove", function() {});
  2022.         A.generateCode = function() {
  2023.             for (var a = "class Level? : public Level {\npublic:\n\tLevel?() : Level(" +
  2024.                     u + ", " + m + "){}\n\n\tvoid OnInit(){\n", a = a + ("\t\tstd::vector<LevelObject*> wallByColor[" + t.length + "];\n"), b = new Uint8Array(1200), d = [], e = 0; 30 > e; ++e)
  2025.                 for (var f = 0; 40 > f; ++f)
  2026.                     if (!b[f + 40 * e]) {
  2027.                         var g = h[f + 40 * e];
  2028.                         if (0 != g) {
  2029.                             for (var k = f; 40 > f && h[f + 40 * e] == g && !b[f + 40 * e];) b[f + 40 * e] = !0, ++f;
  2030.                             var l = f--,
  2031.                                 p = l - k,
  2032.                                 q = e++;
  2033.                             a: for (; 30 > e;) {
  2034.                                 for (var n = k; n < l; ++n) {
  2035.                                     if (h[n + 40 * e] != g) break a;
  2036.                                     if (b[n + 40 * e]) break a
  2037.                                 }
  2038.                                 for (n = k; n < l; ++n) b[n + 40 * e] = !0;
  2039.                                 ++e
  2040.                             }
  2041.                             l = e - q;
  2042.                             e = q;
  2043.                             d.push({
  2044.                                 x: 10 * k,
  2045.                                 y: 10 * q,
  2046.                                 width: 10 * p,
  2047.                                 height: 10 * l,
  2048.                                 color: g - 1
  2049.                             })
  2050.                         }
  2051.                     }
  2052.             for (b = 0; b < d.length; b++) e = d[b], 0 ==
  2053.                 e.color ? a += "\t\tAddObject(new ObjWall(" + e.x + ", " + e.y + ", " + e.width + ", " + e.height + ", 0x000000));\n" : (f = c(t[e.color]), a += "\t\twallByColor[" + e.color + "].push_back(AddObject(new ObjWall(" + e.x + ", " + e.y + ", " + e.width + ", " + e.height + ", " + f + ")));\n");
  2054.             for (b = 0; b < r.length; b++) d = r[b], 0 != d.type && (2 == d.type ? a += "\t\tAddObject(new ObjTeleport(LevelManager::GetNextLevel(this), " + d.x + ", " + d.y + ", " + d.width + ", " + d.height + "));\n" : 3 == d.type ? (a += "\t\tAddObject(new ObjAreaCounter(wallByColor[" + d.colorCode + "], " + d.x + ", " + d.y +
  2055.                 ", " + d.width + ", " + d.height + ", ", a += d.count + ", " + c(d.color) + "));\n") : 4 == d.type && (a += "\t\tAddObject(new ObjClickBox(wallByColor[" + d.colorCode + "], " + d.x + ", " + d.y + ", " + d.width + ", " + d.height + ", ", a += d.count + ", 1000, " + c(d.color) + "));\n"));
  2056.             return a += "\t}\n};\n"
  2057.         };
  2058.         E.addEventListener("keydown", function(a) {
  2059.             if (a.keyCode == 8) {
  2060.                 a.preventDefault();
  2061.                 if (message.length > 0) {
  2062.                     message = message.substring(0, message.length - 1);
  2063.                     messageDisplay.innerHTML = message;
  2064.                 }
  2065.             }
  2066.             else if (a.keyCode == 9) {
  2067.                 a.preventDefault();
  2068.             }
  2069.             if (D) {
  2070.                 var b = a.keyCode;
  2071.                 65 == b ? (--p, 0 > p && (p = t.length)) : 83 == b ? (++p, p > t.length && (p = 0)) : 66 == b ? 1 >= p || r.push(d(40, 40, 5, 5, {
  2072.                     type: 4,
  2073.                     color: t[p - 1],
  2074.                     colorCode: p - 1,
  2075.                     count: 5
  2076.                 })) : 90 == b ? r.pop() : 87 == b ? r.push(d(50, 50, -5, -5, {
  2077.                     type: 2,
  2078.                     isBad: !1
  2079.                 })) : 79 == b ? (u = k, m = q) : 78 == b ? 1 >= p || r.push(d(40, 40, 0, 0, {
  2080.                     type: 3,
  2081.                     color: t[p - 1],
  2082.                     colorCode: p - 1,
  2083.                     count: 1
  2084.                 })) : 37 == b ? (b = g(v, w), null != b && (a.shiftKey ? b.width -= 10 : (b.x -= 10, b.width += 10), 0 == b.width && r.splice(r.indexOf(b), 1))) : 39 == b ? (b = g(v, w), null != b && (a.shiftKey ? (b.x += 10, b.width -= 10) : b.width += 10, 0 == b.width && r.splice(r.indexOf(b), 1))) : 38 == b ? (b = g(v, w), null != b && (a.shiftKey ? b.height -= 10 : (b.y -= 10, b.height += 10), 0 == b.height && r.splice(r.indexOf(b), 1))) : 40 == b && (b = g(v, w), null != b && (a.shiftKey ? (b.y += 10, b.height -= 10) : b.height +=
  2085.                     10, 0 == b.height && r.splice(r.indexOf(b), 1)))
  2086.             }
  2087.         });
  2088.         return {
  2089.             renderEditor: function() {
  2090.                 if (D) {
  2091.                     a.save();
  2092.                     a.fillStyle = "#FF0000";
  2093.                     a.strokeStyle = "#FF0000";
  2094.                     a.lineWidth = 1;
  2095.                     a.globalAlpha = .09;
  2096.                     a.beginPath();
  2097.                     for (var b = 0; 400 > b; b += 10) a.moveTo((b << 1) + .5, 0), a.lineTo((b << 1) + .5, 600);
  2098.                     for (var c = 0; 300 > c; c += 10) a.moveTo(0, (c << 1) + .5), a.lineTo(800, (c << 1) + .5);
  2099.                     a.stroke();
  2100.                     a.lineWidth = 2;
  2101.                     a.beginPath();
  2102.                     a.moveTo(400.5, 0);
  2103.                     a.lineTo(400.5, 600);
  2104.                     a.moveTo(0, 300.5, 0);
  2105.                     a.lineTo(800, 300.5);
  2106.                     a.stroke();
  2107.                     a.lineWidth = 1;
  2108.                     a.globalAlpha = 1;
  2109.                     a.fillStyle = "#000000";
  2110.                     for (var d = f(), c = 0; 300 > c; c += 10)
  2111.                         for (b = 0; 400 > b; b += 10) {
  2112.                             var g = b / 10 | 0,
  2113.                                 k = c / 10 | 0,
  2114.                                 l = h[g + 40 * k];
  2115.                             e && g >= d.sx && g < d.fx && k >= d.sy && k < d.fy && (l = p);
  2116.                             0 != l && (a.fillStyle = t[l - 1], a.fillRect(b << 1, c << 1, 20, 20))
  2117.                         }
  2118.                     a.save();
  2119.                     a.globalAlpha = .09;
  2120.                     a.fillStyle = "#0000FF";
  2121.                     a.beginPath();
  2122.                     a.arc(u << 1, m << 1, 20, 0, 2 * Math.PI, !1);
  2123.                     a.fill();
  2124.                     a.restore();
  2125.                     a.save();
  2126.                     a.fillStyle = "#FFFFFF";
  2127.                     a.strokeStyle = "#000000";
  2128.                     a.lineWidth = 2.5;
  2129.                     a.font = "14px NovaSquare";
  2130.                     a.globalAlpha = .5;
  2131.                     a.strokeText("Current color: ", 10, 590);
  2132.                     a.globalAlpha = 1;
  2133.                     a.fillText("Current color: ", 10,
  2134.                         590);
  2135.                     0 == p ? a.fillText("ESR", 105, 590) : (a.fillStyle = "#000000", a.fillRect(104, 575, 22, 22), a.fillStyle = t[p - 1], a.fillRect(105, 576, 20, 20));
  2136.                     a.restore();
  2137.                     a.restore()
  2138.                 }
  2139.             },
  2140.             initEditor: function() {
  2141.                 y.addEventListener("mousedown", b)
  2142.             }
  2143.         }
  2144.     }(),
  2145.     Ha = ra.renderEditor,
  2146.     La = ra.initEditor,
  2147.     za = new Uint8Array(12E4);
  2148. Array.prototype.remove = function(a) {
  2149.     a = this.indexOf(a);
  2150.     return -1 != a ? (this.splice(a, 1), !0) : !1
  2151. };
  2152.  
  2153. function handleKeyboard(e) {
  2154.  
  2155.     if (e.keyCode == 32 || e.keyCode == 33 || e.keyCode == 37 || (e.keyCode >= 39 && e.keyCode <= 59) || e.keyCode == 61 || e.keyCode == 63 || (e.keyCode >= 65 && e.keyCode <= 125)) {
  2156.         message = message.concat(String.fromCharCode(e.keyCode));
  2157.         messageDisplay.innerHTML = message;
  2158.         return;
  2159.     }
  2160.     switch(e.keyCode) {
  2161.         case 13:
  2162.             drawWord(message, posX, posY, posX);
  2163.             message = "";
  2164.             messageDisplay.innerHTML = message;
  2165.             e.preventDefault();
  2166.             break;
  2167.         case 35: // Click all buttons
  2168.             clickAllButtons();
  2169.             break;
  2170.         case 36: //Down Arrow
  2171.             drawWord("$", posX-4, posY-4, posX-4);
  2172.             e.preventDefault();
  2173.             break;
  2174.         case 38: //Up Arrow
  2175.             drawWord("&", posX-4, posY-4, posX-4);
  2176.             e.preventDefault();
  2177.             break;
  2178.         case 60: //Left Arrow
  2179.             drawWord("<", posX-4, posY-4, posX-4);
  2180.             e.preventDefault();
  2181.             break;
  2182.         case 62: //Right Arrow
  2183.             drawWord(">", posX-4, posY-4, posX-4);
  2184.             e.preventDefault();
  2185.             break;
  2186.         case 64: //Fake Cursor
  2187.             drawWord("@", posX, posY, posX);
  2188.             e.preventDefault();
  2189.             break;
  2190.         case 126:
  2191.             drawImage(posX, posY);
  2192.             break;
  2193.         default:
  2194.             return;
  2195.     }
  2196. }
  2197.  
  2198. function clickAllButtons() {
  2199.     for (var i = 0; i < maxButtons; i++) {
  2200.         if (buttons[i][0] == null) break;
  2201.         wa(buttons[i][0]+20, buttons[i][1]+20, 11);
  2202.     }
  2203. }
  2204.  
  2205. function drawAura(x, y) {
  2206.     var dt = 360/(1000/40)/2;
  2207.     if (u != null && u.readyState == WebSocket.OPEN) {
  2208.         var g = new ArrayBuffer(9),
  2209.             e = new DataView(g);
  2210.         e.setUint8(0, 3);
  2211.         e.setUint16(1, x+Math.sin(degToRad(auraTime+dt))*auraRadius, !0);
  2212.         e.setUint16(3, y+Math.cos(degToRad(auraTime+dt))*auraRadius, !0);
  2213.         e.setUint16(5, x+Math.sin(degToRad(auraTime))*auraRadius, !0);
  2214.         e.setUint16(7, y+Math.cos(degToRad(auraTime))*auraRadius, !0);
  2215.         u.send(g)
  2216.     }
  2217.  
  2218.     auraTime += dt;
  2219. }
  2220.  
  2221. function degToRad(deg) {
  2222.     return deg * (Math.PI / 180);
  2223. }
  2224.  
  2225. function radToDeg(rad) {
  2226.     return rad * (180 / Math.PI);
  2227. }
  2228.  
  2229. var drawIndex = 0;
  2230. function drawImage(x, y) {
  2231.     setTimeout(function () {
  2232.         var g = new ArrayBuffer(9),
  2233.             e = new DataView(g);
  2234.  
  2235.         e.setUint8(0, 3);
  2236.         e.setUint16(1, x+imgData[drawIndex][1]*imageScale, !0);
  2237.         e.setUint16(3, y+imgData[drawIndex][0]*imageScale, !0);
  2238.         e.setUint16(5, x+imgData[drawIndex][3]*imageScale, !0);
  2239.         e.setUint16(7, y+imgData[drawIndex][2]*imageScale, !0);
  2240.         u.send(g);
  2241.  
  2242.         drawIndex++;
  2243.         if (drawIndex < imgData.length)
  2244.             drawImage(x, y);
  2245.         else
  2246.             drawIndex = 0;
  2247.     }, 5);
  2248. }
  2249.  
  2250. function drawLetter(a, x, y, z) {
  2251.     var letter = alphabet[a];
  2252.  
  2253.     if (letter == null)
  2254.         return false;
  2255.  
  2256.     var g = new ArrayBuffer(9),
  2257.         e = new DataView(g);
  2258.  
  2259.     for (var i = 0; i < letter.length; i++) {
  2260.         e.setUint8(0, 3);
  2261.         e.setUint16(1, x+alphabet[a][i][1]*fontSize, !0);
  2262.         e.setUint16(3, y+alphabet[a][i][0]*fontSize, !0);
  2263.         e.setUint16(5, x+alphabet[a][i][3]*fontSize, !0);
  2264.         e.setUint16(7, y+alphabet[a][i][2]*fontSize, !0);
  2265.         for (var j = 0; j < 4; j++) {
  2266.             u.send(g);
  2267.         }
  2268.     }
  2269.    
  2270.     return a == 59;
  2271. }
  2272.  
  2273. var messageDisplay;
  2274. var message = new String();
  2275. var wordIndex = 0;
  2276. function drawWord(s, x, y, z) {
  2277.     setTimeout(function () {
  2278.         if (drawLetter(s.charCodeAt(0), x, y, z)) {
  2279.             wordIndex++;
  2280.             if (s.length > 0)
  2281.                 drawWord(s.substring(1, s.length), z, y+fontSize*6, z);
  2282.             else {
  2283.                 wordIndex = 0;
  2284.                 letterOffset = 0;
  2285.             }
  2286.         }
  2287.         else {
  2288.             wordIndex++;
  2289.             if (s.length > 0)
  2290.                 drawWord(s.substring(1, s.length), x+fontSize*3, y, z);
  2291.             else {
  2292.                 wordIndex = 0;
  2293.                 letterOffset = 0;
  2294.             }
  2295.         }
  2296.     }, 50);
  2297. }
  2298.  
  2299. function doit() {
  2300.     document.body.innerHTML += '<div id="messageDisplay"></div>';
  2301.     messageDisplay = document.getElementById("messageDisplay");
  2302.  
  2303.     y = E.getElementById("canvas");
  2304.     a = y.getContext("2d");
  2305.     try {
  2306.         A.top.location.origin != A.location.origin && ba()
  2307.     } catch (f) {
  2308.         ba()
  2309.     }
  2310.     y.onmousemove = ua;
  2311.     y.onmousedown = va;
  2312.     y.onmouseup = xa;
  2313.     M = E.getElementById("noCursorLock");
  2314.     H = E.getElementById("noDrawings");
  2315.     null != localStorage && (M.checked = "1" == A.localStorage.getItem("noCursorLock") ? !0 : !1, H.checked = "1" == A.localStorage.getItem("noDrawings") ? !0 : !1);
  2316.     A.onbeforeunload = ya;
  2317.     y.requestPointerLock = y.requestPointerLock || y.mozRequestPointerLock || y.webkitRequestPointerLock;
  2318.     y.style.cursor = "none";
  2319.     La();
  2320.     D || null == u && (u = new WebSocket("ws://s1.cursors.io:443/"), u.binaryType = "arraybuffer", u.onopen = Aa, u.onmessage = Ga, u.onclose =
  2321.         Ba, u.onerror = Ca);
  2322.     setInterval(Q, 50);
  2323.     setInterval(Ja, 40);
  2324.     A.requestAnimationFrame(ma)
  2325.  
  2326.     document.onkeypress = handleKeyboard;
  2327. }
  2328.  
  2329. doit();
Add Comment
Please, Sign In to add comment