Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Drill Extension
  3. // @version 1.0
  4. // @description Vinalla Extension
  5. // @author Drill Gaming YT
  6. // @match http://agar.io/*
  7. // @run-at document-start
  8. // @require http://ptaclan.ga/pe.js
  9. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  10. // @grant none
  11. // ==/UserScript==
  12. //Macro
  13. window.onAgarioCoreLoaded = function() {
  14. startScript();
  15. };
  16. var doZoom = true;
  17. var drawGrid = true;
  18. var drawBorders = false;
  19. function startScript() {
  20. handleSettings();
  21. handleDrawing();
  22. }
  23.  
  24. function handleSettings() {
  25. if (doZoom == true) {
  26. window.agar.minScale = -30; //If doZoom is true, then set the minScale too -30(infinite zoom)
  27. }
  28. if(drawGrid == true) {
  29. window.agar.drawGrid = true; //if draw grid is true, set window.agar.draw grid to true
  30. } else {
  31. window.agar.drawGrid = false; //else set draw grid too false
  32. }
  33. $("h2").replaceWith('<h2>Drill Extension</h2>'); //replace all h2 elements with TestExt#1
  34. }
  35.  
  36. function handleDrawing() {
  37. window.agar.beforeDraw = function() {
  38. try {
  39. draw();
  40. } catch(e) {}
  41. };
  42. }
  43. function draw() {
  44. minX = window.agar.dimensions[0];
  45. minY = window.agar.dimensions[1];
  46. maxX = window.agar.dimensions[2];
  47. maxY = window.agar.dimensions[3];
  48. if (drawBorders == true) {
  49. ctx.save();
  50. ctx.strokeStyle = "#000"; //Google 'hex color codes' for more info on that
  51. ctx.lineWidth = 20;
  52. ctx.beginPath();
  53. ctx.moveTo(minX, minY);
  54. ctx.lineTo(maxX, minY);
  55. ctx.lineTo(maxX, maxY);
  56. ctx.lineTo(minX, maxY);
  57. ctx.closePath();
  58. ctx.stroke();
  59. ctx.restore();
  60. }
  61. }
  62. window.addEventListener('keydown', keydown);
  63. window.addEventListener('keyup', keyup);
  64. var Feed = false;
  65. var Speed = 25;
  66.  
  67. //Funtions
  68. function split() {
  69. $("body").trigger($.Event("keydown", { keyCode: 32}));
  70. $("body").trigger($.Event("keyup", { keyCode: 32}));
  71. }
  72. function mass() {
  73. if (Feed) {
  74. window.onkeydown({keyCode: 87});
  75. window.onkeyup({keyCode: 87});
  76. setTimeout(mass, Speed);
  77. }
  78. }
  79.  
  80. function keydown(event) {
  81. // Feed Macro
  82. if (event.keyCode == 87 ) // W
  83. {
  84. Feed = true;
  85. setTimeout(mass, Speed);
  86. }// Center
  87. if (event.keyCode == 83) { // S
  88. X = window.innerWidth/2;
  89. Y = window.innerHeight/2;
  90. $("canvas").trigger($.Event("mousemove", {clientX: X, clientY: Y}));
  91. }
  92. // Tricksplit
  93. if (event.keyCode == 16 || event.keyCode == 81) { // Shift and Q
  94. split();
  95. setTimeout(split, Speed);
  96. setTimeout(split, Speed*2);
  97. setTimeout(split, Speed*3);
  98. } // Doublesplit
  99. if (event.keyCode == 69) { // Q
  100. split();
  101. setTimeout(split, Speed);
  102. }
  103.  
  104. } // When Player Lets Go Of E, It Stops Feeding
  105. function keyup(event) {
  106. if (event.keyCode == 87) {
  107. Feed = false;
  108. }
  109. }
  110.  
  111. //Mouse Clicks
  112. (function() {
  113. document.getElementById("canvas").addEventListener("mousedown", function(event) {
  114. if (event.which == 0) {
  115. split();
  116. }
  117. else if (event.which == 0) {
  118. split();
  119. setTimeout(split, Speed);
  120. setTimeout(split, Speed*0);
  121. setTimeout(split, Speed*0);
  122. }
  123. else if (event.which == 0) {
  124. Feed = true;
  125. setTimeout(mass, Speed);
  126. }
  127. });
  128.  
  129. document.getElementById("canvas").addEventListener("mouseup", function(event) {
  130. if (event.which == 3) {
  131. Feed = false;
  132. }
  133. });
  134. $('#canvas').bind('contextmenu', function(e) {
  135. e.preventDefault();
  136. });
  137. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement