Bumpyball.io/Pucks.io Back Boosting(WASD)

Hard to spam the spacebar to backboost? No worries this will fix that problem

当前为 2025-04-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bumpyball.io/Pucks.io Back Boosting(WASD)
  3. // @namespace https://greasyfork.org/en/users/1462379-3lectr0n-nj
  4. // @version V1
  5. // @description Hard to spam the spacebar to backboost? No worries this will fix that problem
  6. // @author 3lectr0N!nj@
  7. // @match https://www.pucks.io/
  8. // @match https://www.bumpyball.io/staging/
  9. // @match https://www.bumpyball.io/
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=pucks.io
  11. // @grant none
  12. // ==/UserScript==
  13. let bboost
  14. let t = 200
  15. let key = "KeyS"
  16. function Space_down() {
  17. const event = new KeyboardEvent('keydown', { key: ' ', code: 'Space', which: 32, keyCode: 32, bubbles: true, cancelable: true });
  18. document.dispatchEvent(event);
  19. }
  20. function Space_up() {
  21. const event = new KeyboardEvent('keyup', { key: ' ', code: 'Space', which: 32, keyCode: 32, bubbles: true, cancelable: true });
  22. document.dispatchEvent(event);
  23. }
  24. const game = window.game = {
  25. b_boost(){
  26. document.onkeydown = e => {
  27. if (e.code === key) {
  28. if (!bboost) {
  29. bboost = setInterval(() => {
  30. Space_down();
  31. setTimeout(() => {
  32. Space_up();
  33. }, t);
  34. }, t);
  35. }
  36. document.onkeyup = x => {
  37. if (x.code === key) {
  38. clearInterval(bboost);
  39. bboost = null;
  40. }
  41. };
  42. }
  43. }
  44. }
  45. }
  46. WebSocket.prototype._send = WebSocket.prototype.send
  47. WebSocket.prototype.send = function(e){
  48. const data = new Uint8Array(e)
  49. const d =data
  50. if(d[0]==8 && d[1]==1 && d[2]==18){
  51. const encoder = new TextEncoder()
  52. const n = top.player_name.slice(12)
  53. const name = encoder.encode(n)
  54. const join = [8,1,18,name.length+37,10 ,name.length,...name,18,28, 65, 85, 51, 115, 49, 111, 120, 101, 86, 113, 79, 80, 74, 116, 56, 87, 114, 104, 52, 104, 69, 102, 52, 121, 102, 56, 57, 50, 24, 230, 6, 32, 14, 56, 1]
  55. game.ws = this
  56. this._send(new Uint8Array(join))
  57. console.log(join)
  58. }
  59. if(!game.ws)game.ws = this
  60. if(!this.event){
  61. this.event = true
  62. game.b_boost()
  63. }
  64. this._send(data)
  65. if (!game.ws || game.ws.readyState === WebSocket.CLOSED) {
  66. game.ws = this;
  67. this.addEventListener('close', e => {
  68. delete game.ws;
  69. return;
  70. clearInterval(bboost);
  71. bboost = null;
  72. }
  73. );
  74. }
  75. }