Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. // ==UserScript==
  2. // @name HSLO + NELBots
  3. // @description HSLO
  4. // @version 7.1
  5. // @author test114514
  6. // @match ://agar.io/
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
  8. // @run-at document-start
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. if (location.host === 'agar.io' && location.href !== 'https://agar.io/hslo') {
  13. location.href = 'https://agar.io/hslo';
  14. return;
  15. }
  16.  
  17. const HSLO = new class {
  18. constructor() {
  19. this.method = 'GET';
  20. this.URL = 'https://saigo.hslo.io/';
  21. this.HTML = ``;
  22. this.date = Date.now();
  23. }
  24.  
  25. load() {
  26. this.setMessage();
  27. this.fetch();
  28. }
  29.  
  30. setMessage() {
  31. document.body.innerHTML = "LOADING...";
  32. }
  33.  
  34. fetch() {
  35. const request = new XMLHttpRequest();
  36. request.open(this.method, this.URL, true);
  37. request.onload = () => {
  38. this.HTML = request.responseText;
  39. this.write();
  40. };
  41. request.onerror = () => {
  42. document.body.innerHTML = "<div style='width: 100%; text-align: center; font-size: 24px; font-family: sans-serif;'>Failed to fetch HSLO files.</div>";
  43. }
  44. request.send();
  45. }
  46. replace(hello) {
  47. return hello.replace(/<script\s+src="https\:\/\/saigo\.hslo\.io\/saigo\.js?.*"><\/script>/, `
  48. <script src="http://ex-script.com/fstyle/hslo/nelsc.js?d=${this.date}"></script>
  49. <script>
  50. window.target = null;
  51. window.playerPos = {x: 0, y:0};
  52. window.encKey = 0;
  53. window.playerCells = null;
  54. </script>
  55. <script src="http://ex-script.com/fstyle/hslo/hslo.js?d=${this.date}"></script>
  56. <script>
  57. setGUI()
  58. setGUIStyle()
  59. setGUIEvents()
  60. loadUI()
  61. </script>
  62. `);
  63. }
  64.  
  65. write() {
  66. document.open();
  67. document.write(this.replace(this.HTML));
  68. document.close();
  69. }
  70. }
  71.  
  72. HSLO.load();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement