Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. alert("Subscribe to TrapKillo YT");
  2. window.addEventListener('keydown', keydown);
  3. window.addEventListener('keyup', keyup);
  4. var Feed = false;
  5. var Dingus = false;
  6. var imlost = 25;
  7. document.getElementById("instructions").innerHTML += "<center><span class='text-muted'><span data-itr='instructions_e'> Press <b>T</b> to Tricksplit</span></span></center>";
  8. document.getElementById("instructions").innerHTML += "<center><span class='text-muted'><span data-itr='instructions_q'> Press and hold <b>W</b> for macro feed</span></span></center>";
  9. document.getElementById("instructions").innerHTML += "<center><span class='text-muted'><span data-itr='instructions_q'> Press and hold <b>W</b> for macro feed</span></span></center>";
  10. load();
  11.  
  12. window.onAgarioCoreLoaded = function() {
  13. startScript();
  14. };
  15. var doZoom = true;
  16. var drawGrid = false; //Change to true, if you would like to draw grid
  17. var drawBorders = true;
  18. function startScript() {
  19. handleSettings();
  20. handleDrawing();
  21. }
  22.  
  23. function handleSettings() {
  24. if (doZoom === true) {
  25. window.agar.minScale = -30; //If doZoom is true, then set the minScale too -30(infinite zoom)
  26. }
  27. if(drawGrid === true) {
  28. window.agar.drawGrid = true; //if draw grid is true, set window.agar.draw grid to true
  29. } else {
  30. window.agar.drawGrid = false; //else set draw grid too false
  31. }
  32. $("h2").replaceWith('<h3>Xhing Extension</h3>'); //replace all h2 elements with TestExt#1
  33. }
  34.  
  35. function handleDrawing() {
  36. window.agar.beforeDraw = function() {
  37. try {
  38. draw();
  39. } catch(e) {}
  40. };
  41. }
  42. function draw() {
  43. minX = window.agar.dimensions[0];
  44. minY = window.agar.dimensions[1];
  45. maxX = window.agar.dimensions[2];
  46. maxY = window.agar.dimensions[3];
  47. if (drawBorders === true) {
  48. ctx.save();
  49. ctx.strokeStyle = "#000"; //Google 'hex color codes' for more info on that
  50. ctx.lineWidth = 20;
  51. ctx.beginPath();
  52. ctx.moveTo(minX, minY);
  53. ctx.lineTo(maxX, minY);
  54. ctx.lineTo(maxX, maxY);
  55. ctx.lineTo(minX, maxY);
  56. ctx.closePath();
  57. ctx.stroke();
  58. ctx.restore();
  59. }
  60. }
  61. function hookKeys() {
  62. $(document).on('keyup', function(e) {
  63. var key = e.which || e.keyCode;
  64. keysHold[key] = false;
  65. if(key == 69) { // key E
  66. clearInterval(ejectorLoop);
  67. ejectorLoop = null;
  68. }
  69. else if(key >= 37 && key <= 40 || key >= 73 && key <= 76) handleMovementKeys();
  70. });
  71.  
  72. $(document).on('keydown', function(e) {
  73. var key = e.which || e.keyCode;
  74. var spKeys = e.ctrlKey || e.altKey || e.shiftKey;
  75. //console.log('keydown ' + key);
  76. if($('#overlays').is(':hidden') && !spKeys) {
  77. if(key == 27) overlaysOpened = true; // key ESC
  78. if(!keysHold[key]) {
  79. if(key == 69) { // key E
  80. if(!ejectorLoop) {
  81. ejectorLoop = setInterval(function() {
  82. window.onkeydown({ keyCode: 87 });
  83. window.onkeyup({ keyCode: 87 });
  84. }, 10);
  85. }
  86. }
  87. else if(key == 82) { // key R
  88. setIntervalX(function() {
  89. window.onkeydown({ keyCode: 87 }); // key W
  90. window.onkeyup({ keyCode: 87 });
  91. }, 120, 7);
  92. }
  93. else if(key == 84) { // key T
  94. setIntervalX(function() {
  95. window.onkeydown({ keyCode: 32 }); // key SPACE
  96. window.onkeyup({ keyCode: 32 });
  97. }, 60, 4);
  98. }
  99. else if(key == 83) { // key S
  100. var mEv = new MouseEvent('mousemove', { 'clientX': window.innerWidth / 2, 'clientY': window.innerHeight / 2 });
  101. canvas.dispatchEvent(mEv);
  102. }
  103. else if(key == 86) showPanel(2); // key V
  104. else if(key == 66) showPanel(1); // key B
  105. else if(key == 78) showPanel(3); // key N
  106. else if(key == 77) showPanel(4); // key M
  107. else if(key == 188) showPanel(5); // key ,
  108. }
  109. keysHold[key] = true;
  110. if(key >= 37 && key <= 40 || key >= 73 && key <= 76) handleMovementKeys();
  111. }
  112. if(document.activeElement.tagName.toUpperCase() != 'INPUT' && document.activeElement.type != 'text') {
  113. if(key == 192) { // key ~
  114. $('#playerListBox a').eq(0).click();
  115. keysHold[key] = true;
  116. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement