NCTPRO

Free

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/29374/191760/NCTPRO.js

  1. /* global WebSocket, io */
  2. // ==UserScript==
  3. // @name NCTPRO
  4. // @namespace NCTPRO
  5. // @version Free
  6. // @description Free
  7. // @author Free
  8. // @match *://104.207.132.60/*
  9. // @match *.germs.io/*
  10. // @match *.galx.io/*
  11. // @match *.agma.io/*
  12. // @match *.rata.io/*
  13. // @match http://agar.io/
  14. // @match *.gota.io/*
  15. // @match *.cellcraft.io/*
  16. // @match *.agariofun.com/*
  17. // @match *.agar.pro/*
  18. // @match *.gaver.io/*
  19. // @match *.warball.co/*
  20. // @match *.agariom.net/*
  21. // @match *.agar.re/*
  22. // @match *.agarpx.com/*
  23. // @match *.easyagario.com/*
  24. // @match *.playagario.org/*
  25. // @match *.agariofr.com/*
  26. // @match *.agario.xyz/*
  27. // @match *.mgar.io/*
  28. // @match *.agarios.org/*
  29. // @match *.agariowun.com/*
  30. // @match *.usagar.com/*
  31. // @match *.agarioplay.com/*
  32. // @match *.privateagario.net/*
  33. // @match *.agariorage.com/*
  34. // @match *.blong.io/*
  35. // @match *.agar.blue/*
  36. // @match *.agar.bio/*
  37. // @match *.agario.se/*
  38. // @match *.nbkio.com/*
  39. // @match *.agariohit.com/*
  40. // @match *.agariomultiplayer.com/*
  41. // @match *.agariogameplay.com/*
  42. // @match *.agariowow.com/*
  43. // @match *.bestagario.net/*
  44. // @match *.nbk.io/*
  45. // @match *.kralagario.com/*
  46. // @match *.agario.zafer2.com/*
  47. // @match *.agarprivateserver.net/*
  48. // @match *.agarca.com/*
  49. // @match *.agarioplay.mobi/*
  50. // @match *.agario.mobi*
  51. // @match *.abs0rb.me/*
  52. // @match *.ugar.pw/*
  53. // @match *.agariojoy.com/*
  54. // @match *.agario.ch/*
  55. // @match *.ogarz.ovh/*
  56. // @match *.agar.red/*
  57. // @match *.agario.run/*
  58. // @match *.agarpvp.us/*
  59. // @match *.agario.pw/*
  60. // @match *.ogario.net/*
  61. // @match *.ogario.net/*
  62. // @match *.alis.io/*
  63. // @match *.agario.info/*
  64. // @match *.inciagario.com/*
  65. // @match *.agar.io.biz.tr/*
  66. // @match *.agariown.com/*
  67. // @match *.agario.dk/*
  68. // @match *.agario.lol/*
  69. // @match *.agario.gen.tr/*
  70. // @match *.agarioprivateserver.us/*
  71. // @match *.agariot.com/*
  72. // @match *.agarw.com/*
  73. // @match *.agariocity.io/*
  74. // @match *.agario.ovh/*
  75. // @match *.feedy.io/*
  76. // @match *.agar.zircon.at/*
  77. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  78. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
  79. // @resource https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
  80. // @grant none
  81. // @run-at document-end
  82. // ==/UserScript==
  83. if (localStorage.getItem("fe_uuid") === null) {
  84.  
  85. console.log("%c Empty UUID. Generating UUID...", "background-color: #000000; color: #ff9a00;");
  86. localStorage.setItem("fe_uuid", getUserId());
  87. window.location.reload();
  88. } else {
  89.  
  90. console.log("%c UUID: %s", "background-color: #000000; color: #3cff00;", localStorage.getItem("fe_uuid"));
  91. }
  92.  
  93. function getUserId() {
  94.  
  95. function s4() {
  96.  
  97. return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
  98. }
  99.  
  100. return s4() + s4() + s4() +
  101. s4();
  102. }
  103.  
  104. $(document).ready(function() {
  105.  
  106. //5.196.23.192
  107. var socket = io.connect("ws://103.27.202.60:997");
  108.  
  109. var html = "<div id='gbots-box' style='display: table; position: absolute;top: 15%;left: 10px;font-family: Ubuntu;color: rgb(255, 255, 255);z-index: 9999;border-radius: 15px;min-width: 200px;background-color: rgba(0, 0, 0, 0.5);'> <div style='display:table-cell;padding: 0px 12px 0px 12px;'> <div id='gbots-header' style='font-size: 16px;margin: 8px 0px 8px 0px;'> <span style='font-size: 20px;'></span>NCTPRO<span id='bot_'><span style='color:#ff8a8a;'></span></span><br> <span class='hide' id='position'> </span> </div> <div id='gbots-dl' style='display: block; padding: 12px 0px; border-top: 1px solid rgba(255, 255, 255, 0.85098); width: auto; margin-left: auto; margin-right: 10px; text-align: left; font-size: 20px;'><i class='glyphicon glyphicon-time' style='font-size: 14px;margin-right: 2px;color:#bbb;'></i>Time: <span id='bot_t' style='color:#bbb;'><hr><span style='font-size: 20px;'></span>R - <span><span style='color:#ff8a8a;'>Split</span></span><br> E - <span><span style='color:#ff8a8a;'>Eject</span></span> </span><br>Bots:<span id='bot_a' style='color:#ff8a8a;'>Waiting....</span></span> </div> </div> </div>";
  110. $("body").append(html);
  111.  
  112. var fe = {
  113.  
  114. uuid: '',
  115.  
  116. mouse_x: null,
  117. mouse_y: null,
  118. server: null,
  119. origin: null,
  120.  
  121. extra: {
  122.  
  123. collect_mass: true,
  124. rage_mode: true
  125. },
  126.  
  127. hotkeys: {
  128.  
  129. empty: true
  130. },
  131.  
  132. getUuid: function() {
  133.  
  134. return localStorage.getItem("fe_uuid");
  135. },
  136.  
  137. getMouse: function(callback) {
  138.  
  139.  
  140. if (window.location.origin === "http://alis.io") {
  141.  
  142. function test() {
  143.  
  144.  
  145. callback(getCurrentX(), getCurrentY(), window.webSocket.url, window.location.origin);
  146. }
  147.  
  148.  
  149. setInterval(test, 200);
  150. } else {
  151.  
  152. WebSocket.prototype._send = WebSocket.prototype.send;
  153.  
  154. WebSocket.prototype.send = function(data) {
  155. var self = this;
  156.  
  157. this._send(data);
  158. var msg = new DataView(data);
  159. if (msg.byteLength === 21) { // Most clones
  160. if (msg.getInt8(0, true) === 16) {
  161.  
  162. callback(msg.getFloat64(1, true), msg.getFloat64(9, true), self.url, window.location.origin);
  163. }
  164. }
  165. if (msg.byteLength === 13) {
  166. if (msg.getUint8(0, true) === 16) {
  167.  
  168. callback(msg.getInt32(1, true), msg.getInt32(5, true), self.url, window.location.origin);
  169. }
  170. }
  171. };
  172. }
  173. },
  174.  
  175. sendData: function(socket) {
  176.  
  177. var data = {
  178.  
  179. mouse_x: fe.mouse_x,
  180. mouse_y: fe.mouse_y,
  181. server: fe.server,
  182. origin: fe.origin,
  183. extra: fe.extra
  184. };
  185.  
  186. socket.emit('data', data);
  187. },
  188.  
  189. sendSplit: function(socket) {
  190.  
  191. socket.emit('action', "split");
  192. },
  193.  
  194. sendEject: function(socket) {
  195.  
  196. socket.emit('action', "eject");
  197. },
  198.  
  199. sendAi_on: function(socket) {
  200.  
  201. socket.emit('action', "ai_on");
  202. },
  203.  
  204. sendAi_off: function(socket) {
  205.  
  206. socket.emit('action', "ai_off");
  207. }
  208. };
  209.  
  210. if (fe.getUuid() !== null) {
  211.  
  212. fe.uuid = fe.getUuid();
  213. }
  214.  
  215. fe.getMouse(function(x, y, ip, origin) {
  216.  
  217. fe.mouse_x = x;
  218. fe.mouse_y = y;
  219. fe.server = ip;
  220. fe.origin = origin;
  221. });
  222.  
  223. socket.on("request_uuid", function() {
  224.  
  225. socket.emit('request_uuid', fe.uuid);
  226. });
  227.  
  228. setInterval(() => {
  229.  
  230. fe.sendData(socket);
  231. }, 150);
  232.  
  233. document.addEventListener('keydown', function(e) {
  234. if (e.key === "e") {
  235.  
  236. fe.sendSplit(socket);
  237. }
  238.  
  239. if (e.key === "r") {
  240.  
  241. fe.sendEject(socket);
  242. }
  243.  
  244.  
  245. if (e.key === "x") {
  246.  
  247. fe.sendAi_on(socket);
  248. }
  249.  
  250. if (e.key === "c") {
  251.  
  252. fe.sendAi_off(socket);
  253. }
  254.  
  255. });
  256.  
  257. var info = {
  258. bot_a: document.getElementById("bot_a"),
  259. bot_t: document.getElementById("bot_t"),
  260. };
  261.  
  262. socket.on('info', function(data) {
  263.  
  264. info.bot_a.innerHTML = data.bot_a;
  265. info.bot_t.innerHTML = (data.bot_t / 60).toString().substring(0,0) + "15(min)";
  266. });
  267.  
  268. });