Auto Place and Zoom in and out Combination

Zoom in and Zoom out, Press 1, 2, 3, 4, 5, 6, or 7 *depending on which building you want to place automatically* NaTh BuildSystem 1.2 + ZOOM HACK for Bloble.io! Sorry for Copying. Before installing this script, Get the Extension: Tampermonkey

目前为 2018-01-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Place and Zoom in and out Combination
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Zoom in and Zoom out, Press 1, 2, 3, 4, 5, 6, or 7 *depending on which building you want to place automatically* NaTh BuildSystem 1.2 + ZOOM HACK for Bloble.io! Sorry for Copying. Before installing this script, Get the Extension: Tampermonkey
  6. // @author BuildFast (Credit goes to MaximusSRB Zoom hack and this unknown guy who made NaTh BuildSystem 1.2)
  7. // @match http://bloble.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. $("#youtuberOf").hide();
  12. $("#youtubeFollow").hide();
  13. $("#adCard").hide();
  14. $("#mobileInstructions").hide();
  15. $("#promoImgHolder").hide();
  16. $("#downloadButtonContainer").hide();
  17. $("#mobileDownloadButtonContainer").hide();
  18. $(".downloadBadge").hide();
  19.  
  20. var scroll = 0;
  21.  
  22. mainCanvas.addEventListener ? (window.addEventListener("mousewheel", zoom, !1),
  23. mainCanvas.addEventListener("DOMMouseScroll", zoom, !1)) : window.attachEvent("onmousewheel", zoom);
  24.  
  25. function zoom(a) {
  26. a = window.event || a;
  27. a.preventDefault();
  28. a.stopPropagation();
  29. scroll = Math.max(-1, Math.min(1, a.wheelDelta || -a.detail))
  30. if (scroll == -1) { //zoom out
  31. if (maxScreenHeight < 10000) {
  32. (maxScreenHeight += 250, maxScreenWidth += 250, resize());
  33. scroll = 0
  34. }
  35. }
  36.  
  37. if (scroll == 1) { //zoom in
  38. if (maxScreenHeight > 1000) {
  39. (maxScreenHeight -= 250, maxScreenWidth -= 250, resize())
  40. scroll = 0
  41. }
  42. }
  43. }
  44.  
  45. mainCanvas.onkeydown = function(event) {
  46. var k = event.keyCode ? event.keyCode : event.which;
  47. if (k == 70) { // F to zoom out
  48. if (maxScreenHeight < 10000) {
  49. (maxScreenHeight += 250, maxScreenWidth += 250, resize());
  50. }
  51. }
  52. if (k == 67) {// C to zoom in
  53. if (maxScreenHeight > 1000) {
  54. (maxScreenHeight -= 250, maxScreenWidth -= 250, resize())
  55. }
  56.  
  57. }
  58.  
  59. {if(65==a||37==a)cameraKeys.l=0,updateCameraInput();if(68==a||39==a)cameraKeys.r=0,updateCameraInput();if(87==a||38==a)cameraKeys.u=0,updateCameraInput();if(83==a||40==a)cameraKeys.d=0,updateCameraInput();if(32==a){var d=unitList.indexOf(activeUnit);sendUnit(d)}void 0!=upgrInputsToIndex["k"+a]&&toggleActiveUnit(upgrInputsToIndex["k"+a]);46==a&&selUnits.length&&sellSelUnits();84==a&&toggleChat("none"==chatListWrapper.style.display);
  60. 27==a&&(toggleActiveUnit(),disableSelUnit(),showSelector=!1);82==a&&(camY=camX=0)}};mainCanvas.onkeydown=function(a){a=a.keyCode?a.keyCode:a.which;socket&&player&&!player.dead&&(65!=a&&37!=a||cameraKeys.l||(cameraKeys.l=-1,cameraKeys.r=0,updateCameraInput()),68!=a&&39!=a||cameraKeys.r||(cameraKeys.r=1,cameraKeys.l=0,updateCameraInput()),87!=a&&38!=a||cameraKeys.u||(cameraKeys.u=-1,cameraKeys.d=0,updateCameraInput()),83!=a&&40!=a||cameraKeys.d||(cameraKeys.d=1,cameraKeys.u=0,updateCameraInput()))}
  61.  
  62.  
  63. addEventListener("keydown", function(a) {
  64. if (a.keyCode == 51) { //Generators
  65. for(i=-3.14;i<=2.36;i+=0.050){
  66. socket.emit("1",i,132,3);
  67. }
  68. }
  69. if (a.keyCode == 54) { //Armory
  70. socket.emit("1",UTILS.roundToTwo(2.75),UTILS.roundToTwo(175),7);
  71. }
  72. if (a.keyCode == 52) { //Houses
  73. for(i=-3.134;i<=2.492;i+=0.04620){
  74. socket.emit("1",i,194,4);
  75. }
  76. }
  77.  
  78. if (a.keyCode == 50) {//Turrets
  79. socket.emit("1",2.75,245.75,2);socket.emit("1",2.50,245,2);socket.emit("1",3,245,2);
  80. for(i=-2.98;i<=2.2;i+=0.3235){
  81. socket.emit("1",i,245,2);
  82. }
  83. }
  84. if (a.keyCode == 49) {//Walls
  85. for(i=-3.14;i<3.14;i+=0.216){
  86. socket.emit("1",i,1e3,1);
  87. }
  88. }
  89. if (a.keyCode == 55) {//Barracks
  90. socket.emit("1",0.32,310,8);
  91. socket.emit("1",-0.98,310,8);
  92. socket.emit("1",1.61,310,8);
  93. socket.emit("1",-2.27,310,8);
  94. }
  95. });
  96.  
  97. addEventListener("keydown", function(a) {
  98. if (a.keyCode == 77){
  99. for(i=0;i<users.length;++i){
  100. if(users[i].name.startsWith("[G]")&&users[i].name !== player.name){
  101. camX = users[i].x-player.x;
  102. camY = users[i].y-player.y;
  103. }
  104. }
  105. }
  106. });