BumpyBall Unlimiter

Every server is Super Server!

  1. // ==UserScript==
  2. // @name BumpyBall Unlimiter
  3. // @name:ru BumpyBall Unlimiter
  4. // @description Every server is Super Server!
  5. // @description:ru Каждый сервер это Супер Сервер!
  6. // @author 0vC4
  7. // @version 3.2
  8. // @namespace https://gf.qytechs.cn/users/670183-exnonull
  9. // @match http://www.pucks.io/
  10. // @match https://www.pucks.io/
  11. // @match http://www.bumpyball.io/
  12. // @match https://www.bumpyball.io/
  13. // @icon https://www.google.com/s2/favicons?domain=bumpyball.io
  14. // @run-at document-start
  15. // @grant none
  16. // @license MIT
  17. // @require https://gf.qytechs.cn/scripts/438620-workertimer/code/WorkerTimer.js
  18. // @require https://gf.qytechs.cn/scripts/448029-rblu/code/RBLU.js
  19. // ==/UserScript==
  20.  
  21. //hello from O
  22.  
  23. document.addEventListener('DOMContentLoaded', e => document.body.style.overflow = 'hidden');
  24. window.logout = () => {
  25. window.indexedDB.databases().then(d=>d[2]).then(d=>window.indexedDB.deleteDatabase(d.name))
  26. };
  27. // try { window.logout(); } catch (e) {}
  28.  
  29.  
  30.  
  31. const r7bit = arr => {let r=0,e=0;for(;35!=e;){let f=arr[e/7];if(r|=(127&f)<<e,0==(128&f))return[r,e/7+1];e+=7}};
  32. const int7 = (arr, start) => {
  33. let [value, bytes] = r7bit(arr.slice(start));
  34. return [value, start+bytes];
  35. };
  36. const float = (arr, start) => {
  37. let value = new Float32Array(new Uint8Array(arr.slice(start, start+4)).buffer)[0]
  38. return [value, start+4];
  39. };
  40. const w7bit = num => {let r=[];for(;num>=128;num>>=7)r.push((128|num)%256);return r.push(num%256),r};
  41.  
  42.  
  43.  
  44. const client = window.client = {
  45. bots: [],
  46. num: 15,
  47. team: 2,
  48. enabled: false,
  49. chatEnabled: false,
  50. moveEnabled: true,
  51.  
  52. antiAfk: WorkerTimer.setInterval(()=>{
  53. const hiddenForward = new Uint8Array([8,7,18,10,18,5,13,0,0,128,63,24,200,1]).buffer;
  54. if (client.ws && client.ws.readyState === 1 && client.ws.id > -1) client.ws._send(hiddenForward);
  55. client.bots.forEach(b => {
  56. if (b.readyState === 1 && b.id > -1) b._send(hiddenForward);
  57. });
  58. }, 1000),
  59.  
  60. sendMessage(text='') {
  61. if (!this.ws || !this.ws.constId) return;
  62. const msg = new TextEncoder().encode(text);
  63. const body = [8,...w7bit(this.ws.constId), 18,...w7bit(msg.length),...msg];
  64. const head = [8,5, 18,...w7bit(body.length)];
  65. const data = new Uint8Array([...head, ...body]);
  66. this.ws.send(data);
  67. },
  68.  
  69. bot(num=15, team=2){
  70. this.team = team;
  71. this.num = num;
  72. return this.enabled = !this.enabled
  73. },
  74.  
  75. move(on = null){
  76. if (on == null) return this.moveEnabled = !this.moveEnabled;
  77. return this.moveEnabled = !!on;
  78. },
  79.  
  80. chatBot(on = null){
  81. if (on == null) return this.chatEnabled = !this.chatEnabled;
  82. return this.chatEnabled = !!on;
  83. },
  84.  
  85. // 0 - blue, 1 - red
  86. close(team=2){
  87. this.bots.forEach(b=>{
  88. if (team === 2 || team === b.team) {
  89. WorkerTimer.clearInterval(b.inter);
  90. b.close();
  91. }
  92. });
  93.  
  94. this.bots = this.bots.filter(b => team !== b.team);
  95. if (team === 2) this.bots = [];
  96. },
  97.  
  98. setup(data, num=this.num){
  99. if (!this.ws.url || !this.enabled) return false;
  100. for(;num--;){
  101. WorkerTimer.setTimeout(()=>{
  102. const ws = new WebSocket(this.ws.url);
  103. this.bots.push(ws);
  104. ws.query = [data];
  105. ws.onopen=function(){
  106. ws.inter = WorkerTimer.setInterval(()=>{
  107. if (!ws.query.length) return;
  108. let data = [...new Uint8Array(ws.query.shift())];
  109. ws.send(new Uint8Array(data).buffer);
  110. }, 17);
  111. }
  112. }, 57*num);
  113. }
  114. }
  115. };
  116.  
  117.  
  118.  
  119. const packet = {};
  120. packet.open = (arr, pos=0) => {
  121. packet.cancel = false;
  122. packet.arr = arr;
  123. packet.value = undefined;
  124. packet.pos = pos;
  125. return packet;
  126. }
  127. packet.null = () => {
  128. packet.cancel = true;
  129. packet.value = null;
  130. return packet;
  131. }
  132. packet.len = () => {
  133. if (packet.cancel) return packet;
  134. let {arr, pos, value} = packet;
  135.  
  136. if (arr[pos++] !== 10) return packet.null();
  137. [value, pos] = int7(arr, pos);
  138.  
  139. return Object.assign(packet, {pos, value});
  140. }
  141. packet.code = () => {
  142. if (packet.cancel) return packet;
  143. let {arr, pos, value} = packet;
  144.  
  145. if (arr[pos++] !== 8) return packet.null();
  146. [value, pos] = int7(arr, pos);
  147.  
  148. return Object.assign(packet, {pos, value});
  149. }
  150. packet.player = () => {
  151. if (packet.cancel) return packet;
  152. let {arr, pos, value} = packet;
  153.  
  154. let data = {
  155. id: null,
  156. constId: null,
  157. team: null,
  158. x: null,
  159. z: null
  160. };
  161.  
  162. if (arr[pos++] !== 10) return packet.null();
  163. [value, pos] = int7(arr, pos);
  164.  
  165. if (arr[pos++] !== 8) return packet.null();
  166. if (arr[pos++] !== 8) return packet.null();
  167.  
  168. if (arr[pos++] !== 18) return packet.null();
  169. [value, pos] = int7(arr, pos);
  170.  
  171. if (arr[pos++] !== 16) return packet.null();
  172. [value, pos] = int7(arr, pos);
  173. data.id = value;
  174.  
  175. if (arr[pos++] !== 26) return packet.null();
  176. [value, pos] = int7(arr, pos);
  177.  
  178. if (arr[pos++] !== 10) return packet.null();
  179. [value, pos] = int7(arr, pos);
  180.  
  181. if (arr[pos++] !== 13) return packet.null();
  182. [value, pos] = float(arr, pos);
  183. data.x = value;
  184.  
  185. if (arr[pos++] !== 21) return packet.null();
  186. [value, pos] = float(arr, pos);
  187. data.z = value;
  188.  
  189. if (arr[pos++] !== 24) return packet.null();
  190. [value, pos] = int7(arr, pos);
  191. data.constId = value;
  192.  
  193. if (arr[pos] === 42) { //42,0
  194. data.team = 0;
  195. pos += 2;
  196. packet.value = data;
  197. return Object.assign(packet, {pos});
  198. }
  199.  
  200. //37,219,15,73,192, 42,0
  201. data.team = 1;
  202. pos += 5+2;
  203. packet.value = data;
  204. return Object.assign(packet, {pos});
  205. }
  206. packet.players = () => {
  207. if (packet.cancel) return packet;
  208. let {arr, pos, value} = packet;
  209. const players = [];
  210.  
  211. for (let i = 0; i < arr.length; i++) {
  212. if (arr[i] !== 10) continue;
  213. packet.pos = i;
  214. let data = packet.player().value;
  215. if (data === null) {
  216. packet.cancel = false;
  217. continue;
  218. }
  219. players.push(data);
  220. i = packet.pos-1;
  221. }
  222.  
  223. packet.value = players;
  224. return packet;
  225. }
  226.  
  227.  
  228.  
  229. const isConnected = arr => {
  230. packet.open(arr);
  231. const code = packet.len().code().value;
  232. if (code === null) return false;
  233. if (code === 3) return true;
  234. return false;
  235. }
  236. const isJoinOther = arr => {
  237. packet.open(arr);
  238. const code = packet.len().code().value;
  239. if (code === null) return false;
  240. if (code === 2) return true;
  241. return false;
  242. }
  243. const isSpawn = arr => {
  244. packet.open(arr);
  245. const code = packet.len().code().value;
  246. if (code === null) return false;
  247. if (code === 8) return packet.player().value;
  248. return false;
  249. }
  250.  
  251.  
  252.  
  253. const getId = arr => {
  254. // 10,x, 8,8,18,x, 16,id, 26,x, 10,10,13,... ,0,42];
  255. if (isConnected(arr)) return packet.id(arr).value;
  256. if (isJoinOther(arr)) return null;
  257. if (isSpawn(arr)) return packet.id(arr).value;
  258. }
  259. window.r7bit = r7bit;
  260. window.w7bit = w7bit;
  261. window.getId = getId;
  262.  
  263.  
  264. (()=>{
  265. const proto = WebSocket.prototype;
  266. proto._send = proto.send;
  267. proto.send = function (data) {
  268. if (!this.event) {
  269. this.event = true;
  270. this.addEventListener('message', async function(e){
  271. const data = [...new Uint8Array(await e.data.arrayBuffer())];
  272. const players = packet.open(data).players().value;
  273. if (players == null) return;
  274.  
  275. if (players.length) {
  276. if (this.constId == null) Object.assign(this, players[0]);
  277. const player = players.find(p => p.constId === this.constId);
  278. if (player) Object.assign(this, player);
  279. }
  280.  
  281. if (client.team !== 2 && client.bots.every(b => b.team > -1)) client.close(+(!client.team));
  282. });
  283. }
  284.  
  285. if (!client.ws) {
  286. client.ws = this;
  287. this.addEventListener('close', e=>{
  288. delete client.ws;
  289. client.close();
  290. });
  291. this.own = true;
  292. client.setup(data);
  293. }
  294.  
  295. if (this.own) {
  296. const d = [...new Uint8Array(data)];
  297. let move = false;
  298. let packet = d;
  299.  
  300. if (
  301. (d[0]==8&&d[1]==7&&d[2]==18) // move
  302. ) {
  303. move = true;
  304. packet = d.slice(0, d.length-w7bit(this.id||0).length);
  305. }
  306.  
  307. if (
  308. client.moveEnabled&&
  309. !(!client.chatEnabled&&d[0]==8&&d[1]==5&&d[2]==18) // chat
  310. ) {
  311. client.bots.forEach(b=>{
  312. if (move && b.id == null) return;
  313. if (b.readyState===3) return;
  314. if (b.readyState!==1) return b.query.push(packet);
  315. if (move) b.send(new Uint8Array([...packet, ...w7bit(b.id)]));
  316. else b.send(new Uint8Array(packet));
  317. })
  318. }
  319. }
  320.  
  321. //if (this.own) console.log('own', new Uint8Array(data));
  322. //else console.log('bot', new Uint8Array(data));
  323. this._send(data);
  324. }
  325. })();
  326.  
  327.  
  328.  
  329. window.genMatrix = () => {
  330. const steps = 10;
  331. const fps = 1000/20;
  332. const time = performance.now()/100;
  333. const step = time/fps>>0;
  334.  
  335. const light = num => {
  336. const gradient = "_O";
  337. const max = gradient.length-1;
  338. num = Math.min(100, Math.max(num, 0));
  339. const x = max*num/100>>0;
  340. return gradient[x];
  341. }
  342.  
  343. const matrix = Array(10).fill(0).map((a,y)=>{
  344. //y = y + step%steps >> 0;
  345. return Array(10).fill(0).map((a,x)=>{
  346. //x = x + step%steps >> 0;
  347. const dxy = x^y;
  348. const drawIf = dxy>time%25 || x==0 || x == 9 || y == 0 || y == 9;
  349. const formula = drawIf*100;
  350. const color = light(formula);
  351. return color;
  352. }).join('');
  353. });
  354.  
  355. return matrix;
  356. };
  357. window.genMatrix2 = () => {
  358. return [
  359. 'OOOOOOOOOO',
  360. 'O________O',
  361. 'O_O____O_O',
  362. 'O_O____O_O',
  363. 'O_O____O_O',
  364. 'O________O',
  365. 'O_O____O_O',
  366. 'O__OOOO__O',
  367. 'O________O',
  368. 'OOOOOOOOOO',
  369. ];
  370. };
  371. window.genMatrix3 = () => {
  372. return [
  373. 'OOOOOOOOOO',
  374. 'O________O',
  375. 'O_O____O_O',
  376. 'O_O____O_O',
  377. 'O_O____O_O',
  378. 'O________O',
  379. 'O__OOOO__O',
  380. 'O_O____O_O',
  381. 'O________O',
  382. 'OOOOOOOOOO',
  383. ];
  384. };
  385. var iter = null;
  386. const fps = 1000/250;
  387. document.onkeydown = e => {
  388. if (e.code == 'NumpadAdd') {
  389. client.sendMessage('');
  390. for(let i=0;i<9;i++)client.sendMessage('');
  391. return;
  392. }
  393. if (e.code == 'NumpadMultiply') {
  394. const matrix = window.genMatrix2();
  395. for(let i=0;i<10;i++)client.sendMessage(matrix[i]);
  396. return;
  397. }
  398. if (e.code == 'NumpadDivide') {
  399. const matrix = window.genMatrix3();
  400. for(let i=0;i<10;i++)client.sendMessage(matrix[i]);
  401. return;
  402. }
  403. if (e.code == 'NumpadSubtract') {
  404. if (iter != null) {
  405. WorkerTimer.clearInterval(iter);
  406. iter = null;
  407. return;
  408. }
  409. let g = 0;
  410. iter = WorkerTimer.setInterval(()=>{
  411. let matrix = Array(120).fill(' ').join('');
  412. client.sendMessage(matrix);
  413. }, fps);
  414. return;
  415. }
  416. }
  417. // 0vC4#7152

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址