RemyMod(Macro)

just a simple macro(sorry no auto heal)

  1. // ==UserScript==
  2. // @name RemyMod(Macro)
  3. // @version v2
  4. // @description just a simple macro(sorry no auto heal)
  5. // @author Remy:D
  6. // @match *://*.moomoo.io/*
  7. // @match *://*.sandbox.moomoo.io/*
  8. // @require https://code.jquery.com/jquery-3.3.1.slim.min.js
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/msgpack-lite/0.1.26/msgpack.min.js
  10. // @require https://code.jquery.com/jquery-3.3.1.slim.min.js
  11. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  12. // @require http://code.jquery.com/jquery-3.3.1.min.js
  13. // @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
  14. // @require https://cdn.jsdelivr.net/npm/fontfaceobserver@2.1.0/fontfaceobserver.standalone.min.js
  15. // @require https://greatest.deepsurf.us/scripts/423602-msgpack/code/msgpack.js
  16. // @require https://cdn.jsdelivr.net/npm/fontfaceobserver@2.1.0/fontfaceobserver.standalone.min.js
  17. // @grant none
  18. // @icon https://moomoo.io/img/favicon.png?v=1
  19. // @namespace https://greatest.deepsurf.us/users/823036
  20. // ==/UserScript==
  21.  
  22. //Visual xd
  23. //i did it by myself
  24. document.getElementById('loadingText').style = "text-shadow: black 2px 2px 40px;";
  25. document.getElementById("loadingText").innerHTML = "Loading wait";
  26. document.getElementById("pingDisplay").style.color = "#00ff00";
  27. document.getElementById("enterGame").style.backgroundColor = "black";
  28. document.getElementById("enterGame").style.color = "white";
  29. document.getElementById('enterGame').innerHTML = 'Macro frr';
  30. document.getElementById('diedText').innerHTML = 'U died..';
  31. document.getElementById("storeHolder").style = "height: 1000px; width: 480px;";
  32. $("#mapDisplay").css({background: `url('http://i.imgur.com/Qllo1mA.png')`});
  33. document.getElementById('diedText').style.color = "red";
  34. document.getElementById('gameName').style = "text-shadow: #ff0000 2px 2px 40px;";
  35. document.getElementById('gameName').innerHTML = 'RemyMod';
  36. document.getElementById('chatBox').style.color = "#800000";
  37. document.getElementById('chatBox').style.backgroundColor = "gray";
  38. document.getElementById("ageText").style.color = "white";
  39. document.getElementById("leaderboard").style.color = "black";
  40. document.getElementById("leaderboard").style.backgroundColor = "rgba(0, 0, 0, 0.75)";
  41.  
  42. //Health bar rainbow:D
  43. //QWAKE GAMING
  44. let hue = 0;
  45.  
  46. let replaceInterval = setInterval(() => {
  47. if (CanvasRenderingContext2D.prototype.roundRect) {
  48. CanvasRenderingContext2D.prototype.roundRect = ((oldFunc) => function() { if (this.fillStyle == "#8ecc51") this.fillStyle = `hsl(${hue}, 100%, 50%)`; return oldFunc.call(this, ...arguments); })(CanvasRenderingContext2D.prototype.roundRect);
  49. clearInterval(replaceInterval);
  50. }}, 10);
  51.  
  52. function changeHue() {
  53. hue += Math.random() * 3;
  54. }
  55.  
  56. setInterval(changeHue, 10);
  57.  
  58. // hats
  59. //W4IT
  60. setInterval(() => window.follmoo && follmoo(), 10);
  61.  
  62. function Hat(id){
  63. storeBuy(id);
  64. storeEquip(id);
  65. }
  66.  
  67. document.addEventListener('keydown', function(e) {
  68. if (e.keyCode == 66 && document.activeElement.id.toLowerCase() !== 'chatbox') { // B for Solider
  69. Hat(6);
  70. }
  71. if (e.keyCode == 27 && document.activeElement.id.toLowerCase() !== 'chatbox') { // ESC for uneuip hat
  72. Hat(0);
  73. }
  74. if (e.keyCode == 71 && document.activeElement.id.toLowerCase() !== 'chatbox') { // G for Turret gear
  75. Hat(53);
  76. }
  77. if (e.keyCode == 16 && document.activeElement.id.toLowerCase() !== 'chatbox') { // SHIFT for booster hat
  78. Hat(12);
  79. }
  80. if (e.keyCode == 188 && document.activeElement.id.toLowerCase() !== 'chatbox') { // "," for snow hat
  81. Hat(15);
  82. }
  83. if (e.keyCode == 67 && document.activeElement.id.toLowerCase() !== 'chatbox') { // < for flipper hat
  84. Hat(31);;
  85. }
  86. if (e.keyCode == 90 && document.activeElement.id.toLowerCase() !== 'chatbox') { // Z for tank gear
  87. Hat(40);
  88. }
  89. if (e.keyCode == 74 && document.activeElement.id.toLowerCase() !== 'chatbox') { // J for emp helmet
  90. Hat(22);
  91. }
  92. if (e.keyCode == 84 && document.activeElement.id.toLowerCase() !== 'chatbox') { // T for bull helmet
  93. Hat(7);
  94. }
  95. if (e.keyCode == 89 && document.activeElement.id.toLowerCase() !== 'chatbox') { // Y for samurai
  96. Hat(20);
  97. }
  98. if (e.keyCode == 192 && document.activeElement.id.toLowerCase() !== 'chatbox') { //
  99. Hat(45);
  100. }
  101. if (e.keyCode == 82 && document.activeElement.id.toLowerCase() !== 'chatbox') { //
  102. Hat(29);
  103. }
  104. });
  105. //Anti- kick
  106. //Nudo
  107. (function() {
  108. const { msgpack } = window
  109.  
  110. function AntiKick() {
  111. this.resetDelay = 500
  112. this.packetsLimit = 40
  113.  
  114. this.ignoreTypes = [ "pp", "rmd" ]
  115. this.ignoreQueuePackets = [ "5", "c", "33", "2", "7", "13c" ]
  116.  
  117. this.packetsStorage = new Map()
  118. this.tmpPackets = []
  119. this.packetsQueue = []
  120.  
  121. this.lastSent = Date.now()
  122.  
  123. this.onSend = function(data) {
  124. const binary = new Uint8Array(data)
  125. const parsed = msgpack.decode(binary)
  126.  
  127. if (Date.now() - this.lastSent > this.resetDelay) {
  128. this.tmpPackets = []
  129.  
  130. this.lastSent = Date.now()
  131. }
  132.  
  133. if (!this.ignoreTypes.includes(parsed[0])) {
  134. if (this.packetsStorage.has(parsed[0])) {
  135. const oldPacket = this.packetsStorage.get(parsed[0])
  136.  
  137. switch (parsed[0]) {
  138. case "2":
  139. case "33":
  140. if (oldPacket[0] == parsed[1][0]) return true
  141. break
  142. }
  143. }
  144.  
  145. if (this.tmpPackets.length > this.packetsLimit) {
  146. if (!this.ignoreQueuePackets.includes(parsed[0])) {
  147. this.packetsQueue.push(data)
  148. }
  149.  
  150. return true
  151. }
  152.  
  153. this.tmpPackets.push({
  154. type: parsed[0],
  155. data: parsed[1]
  156. })
  157.  
  158. this.packetsStorage.set(parsed[0], parsed[1])
  159. }
  160.  
  161. return false
  162. }
  163. }
  164.  
  165. const antiKick = new AntiKick()
  166.  
  167. let firstSend = false
  168.  
  169. window.WebSocket.prototype.send = new Proxy(window.WebSocket.prototype.send, {
  170. apply: function(target, _this) {
  171. if (!firstSend) {
  172. _this.addEventListener("message", (event) => {
  173. if (!antiKick.packetsQueue.length) return
  174.  
  175. const binary = new Uint8Array(event.data)
  176. const parsed = msgpack.decode(binary)
  177.  
  178. if (parsed[0] === "33") {
  179. _this.send(antiKick.packetsQueue[0])
  180.  
  181. antiKick.packetsQueue.shift()
  182. }
  183. })
  184.  
  185. firstSend = true
  186. }
  187.  
  188. if (antiKick.onSend(arguments[2][0])) return
  189.  
  190. return Reflect.apply(...arguments)
  191. }
  192. })
  193. })()
  194. //rebinds
  195. //W4It - sorry i edited it a bit:(
  196. document.querySelector("#pre-content-container").remove();
  197. document.getElementById("enterGame").addEventListener('click', autohide);
  198. function autohide(){
  199. $("#ot-sdk-btn-floating").hide();
  200. }
  201. let mouseX;
  202. let mouseY;
  203. let width;
  204. let height;
  205. function aim(x, y){
  206. var cvs = document.getElementById("gameCanvas");
  207. cvs.dispatchEvent(new MouseEvent("mousemove", {
  208. clientX: x,
  209. clientY: y
  210. }));
  211. }
  212. let coreURL = new URL(window.location.href);
  213. window.sessionStorage.force = coreURL.searchParams.get("fc");
  214. var millType;
  215. var boostType;
  216. var spikeType;
  217. var turretType;
  218. var ws;
  219. var msgpack5 = msgpack;
  220. let myPlayer = {
  221. id: null,
  222. x: null,
  223. y: null,
  224. dir: null,
  225. object: null,
  226. weapon: null,
  227. clan: null,
  228. isLeader: null,
  229. hat: null,
  230. accessory: null,
  231. isSkull: null
  232. };
  233. let healSpeed = 100;
  234. let healToggle = 1;
  235. document.msgpack = msgpack;
  236. function n(){
  237. this.buffer = new Uint8Array([0]);
  238. this.buffer.__proto__ = new Uint8Array;
  239. this.type = 0;
  240. }
  241. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  242. WebSocket.prototype.send = function(m){
  243. if (!ws){
  244. document.ws = this;
  245. ws = this;
  246. socketFound(this);
  247. }
  248. this.oldSend(m);
  249. };
  250. function socketFound(socket){
  251. socket.addEventListener('message', function(message){
  252. handleMessage(message);
  253. });
  254. }
  255. function handleMessage(m){
  256. let temp = msgpack5.decode(new Uint8Array(m.data));
  257. let data;
  258. if(temp.length > 1) {
  259. data = [temp[0], ...temp[1]];
  260. if (data[1] instanceof Array){
  261. data = data;
  262. }
  263. } else {
  264. data = temp;
  265. }
  266. let item = data[0];
  267. if(!data) {return};
  268. if(item === "io-init") {
  269. let cvs = document.getElementById("gameCanvas");
  270. width = cvs.clientWidth;
  271. height = cvs.clientHeight;
  272. $(window).resize(function() {
  273. width = cvs.clientWidth;
  274. height = cvs.clientHeight;
  275. });
  276. cvs.addEventListener("mousemove", e => {
  277. mouseX = e.clientX;
  278. mouseY = e.clientY;
  279. });
  280. }
  281. if (item == "1" && myPlayer.id == null){
  282. myPlayer.id = data[1];
  283. }
  284. if(item == "h" && data[1] == myPlayer.id) {
  285. if(data[2] < 91 && healToggle == 1) {
  286. setTimeout(() => {
  287. place(foodType, null);
  288. place(foodType, null);
  289. }, healSpeed);
  290. }
  291. }
  292. update();
  293. }
  294. function doNewSend(sender){
  295. ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
  296. }
  297. function hold(id) {
  298. doNewSend(["5", [id]]);
  299. }
  300. function place(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  301. doNewSend(["5", [id, null]]);
  302. doNewSend(['c', [1, angle]]);
  303. doNewSend(['c', [0, angle]]);
  304. doNewSend(['5', [myPlayer.weapon, true]]);
  305. }
  306. document.addEventListener('keydown', (e)=>{
  307. if(e.keyCode == 86 && document.activeElement.id.toLowerCase()!== 'chatbox') {
  308. hold(spikeType);
  309. }
  310. if(e.keyCode == 70 && document.activeElement.id.toLowerCase()!== 'chatbox') {
  311. hold(boostType);
  312. }
  313. if(e.keyCode == 78 && document.activeElement.id.toLowerCase()!== 'chatbox') {
  314. hold(millType);
  315. }
  316. if(e.keyCode == 72 && document.activeElement.id.toLowerCase()!== 'chatbox') {
  317. hold(turretType);
  318. }
  319. })
  320.  
  321. function isElementVisible(e) {
  322. return (e.offsetParent !== null);
  323. }
  324. function toRad(angle) {
  325. return angle * 0.01745329251;
  326. }
  327. function update() {
  328. for (let i=22;i<26;i++){
  329. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  330. spikeType = i - 16;
  331. }
  332. }
  333. for (let i=26;i<29;i++){
  334. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  335. millType = i - 16;
  336. }
  337. }
  338. for (let i=31;i<33;i++){
  339. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  340. boostType = i - 16;
  341. }
  342. }
  343. for (let i=33;i<39;i++) {
  344. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  345. turretType = i- 16;
  346. }
  347. }
  348. }