fast split and auto unban ip

fast_split + auto unban

  1. // ==UserScript==
  2. // @name fast split and auto unban ip
  3. // @version 0.1
  4. // @match *://agma.io/*
  5. // @icon https://www.google.com/s2/favicons?sz=64&domain=agma.io
  6. // @grant unsafeWindow
  7. // @author Anonymous Agma
  8. // @run-at document-start
  9. // @description fast_split + auto unban
  10. // @namespace https://greasyfork.org/users/1238627
  11. // ==/UserScript==
  12. // change the keybind here, please do not change longfs because it is not changable and will lead to errors.
  13. let keybind = {
  14. onefs: 't',
  15. doublefs: 'r',
  16. longfs:'z'// cant change!
  17. }
  18. unsafeWindow.Writer = class{
  19. constructor(e) {
  20. (this.buffer = new DataView(new ArrayBuffer(e))), (this.position = 0), (this.littleEndian = !0);
  21. }
  22. setString(e) {
  23. for (let t = 0; t < e.length; t++) this.setUint16(e.charCodeAt(t));
  24. return this;
  25. }
  26. setInt8(e) {
  27. return this.buffer.setInt8(this.position++, e), this;
  28. }
  29. setUint8(e) {
  30. return this.buffer.setUint8(this.position++, e), this;
  31. }
  32. setInt16(e) {
  33. return this.buffer.setInt16((this.position += 2) - 2, e, this.littleEndian), this;
  34. }
  35. setUint16(e) {
  36. return this.buffer.setUint16((this.position += 2) - 2, e, this.littleEndian), this;
  37. }
  38. setInt32(e) {
  39. return this.buffer.setInt32((this.position += 4) - 4, e, this.littleEndian), this;
  40. }
  41. setUint32(e) {
  42. return e % 1 != 0 && 88 == e.toString().slice(-2) && (e += 2), this.buffer.setUint32((this.position += 4) - 4, e, this.littleEndian), this;
  43. }
  44. setFloat32(e) {
  45. return this.buffer.setFloat32((this.position += 4) - 4, e, this.littleEndian), this;
  46. }
  47. setFloat64(e) {
  48. return this.buffer.setFloat64((this.position += 8) - 8, e, this.littleEndian), this;
  49. }
  50. send() {
  51. return send(this.buffer);
  52. }
  53. }
  54. let send,
  55. curserTimeout,
  56. enabled = false;
  57. const osend = WebSocket.prototype.send;
  58. (WebSocket.prototype.send = function () {
  59. return (send = (...e) => osend.call(this, ...e)), osend.apply(this, arguments);
  60. });
  61. const wsend = (e) => send(new Uint8Array([e]));
  62. unsafeWindow.send=(e)=>{send(e)}
  63. window.addEventListener("DOMContentLoaded",()=>{
  64.  
  65. unsafeWindow.addEventListener("keydown",async e=>{
  66. if (!$("input, textarea").is(":focus")) {
  67. e.key == keybind.onefs&& onefs()
  68. e.key == keybind.doublefs&& doublefs()
  69. e.key == 'Shift' &&!e.repeat&&(enabled = !enabled,curserMsg(`Long Split: ${enabled?'ON':'OFF'} `,'green',500))
  70. e.key == 'z'&& (enabled?(cursorlock(1),await delay(80),onefs(),await delay(750),cursorlock(0)):undefined);
  71. }})
  72. unsafeWindow.curserMsg = (e, t, r) => {
  73. "green" == t && (t = "rgb(0, 192, 0)"),
  74. "red" == t && (t = "rgb(255, 0, 0)"),
  75. "gray" == t && (t = "rgb(153, 153, 153)"),
  76. clearTimeout(curserTimeout),
  77. $("#curser").text(e).show().css("color", t),
  78. 0 !== r && (curserTimeout = setTimeout(() => $("#curser").fadeOut(400), r ?? 4e3));
  79. }
  80. const delay = (t) => new Promise((resolve) => setTimeout(resolve, t));
  81. const onefs = async (ms1,ms2) =>{
  82. wsend(17)
  83. await delay(0);
  84. wsend(35);
  85. await delay(60);
  86. wsend(35);
  87. }
  88. const doublefs = async (ms1,ms2) =>{
  89. wsend(17);
  90. await delay(50);
  91. onefs()
  92. }
  93. const cursorlock = (t) => {
  94. unsafeWindow[`onkey${t? 'down':'up'}`]({ keyCode: JSON.parse(localStorage.getItem("hotkeys")).C?.c||67});
  95. };
  96. setInterval(()=>{
  97. if(localStorage.getItem('cdbi')){
  98. localStorage.removeItem('cdbi')
  99. }
  100. if(localStorage.getItem('cdbi1')){
  101. localStorage.removeItem('cdbi1')
  102. }
  103. if(localStorage.getItem('cdbi2')){
  104. localStorage.removeItem('cdbi2')
  105. }
  106. if(localStorage.getItem('cdbi3')){
  107. localStorage.removeItem('cdbi3')
  108. }
  109. if(localStorage.getItem('cdbi4')){
  110. localStorage.removeItem('cdbi4')
  111. curserMsg('Unbanned, use new ip')
  112. }
  113. })
  114. })