Agar.io 10/10

ItsVoid

当前为 2015-06-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Agar.io 10/10
  3. // @namespace Agar.io
  4. // @description ItsVoid
  5. // @include http://agar.io/*
  6. // @version 1.2
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. // ------------------------------------------------------
  11.  
  12. // Agar.io++, created by ItsVoid. http://iammichael.nl
  13. // Thanks, mikeyk730 for creating the awesome stats and charts userscript!
  14. // Thanks, zeach for creating this awesome game, agar.io!
  15.  
  16. // ------------------------------------------------------
  17.  
  18. // Configuration
  19. // Auto-enabled settings
  20.  
  21. setShowMass(true); // Show your mass
  22. setDarkTheme(true); // Enable Dark theme by default
  23. setNames(true); // Show player names
  24. $("#nick").val("Edit userscript to change this!"); // Set username
  25.  
  26. // ------------------------------------------------------
  27.  
  28. // Userscript code, please do not touch unless you know what you're doing.
  29. // Add custom css function
  30.  
  31. function addStyleSheet(style){
  32. var getHead = document.getElementsByTagName("HEAD")[0];
  33. var cssNode = window.document.createElement( 'style' );
  34. var elementStyle= getHead.appendChild(cssNode)
  35. elementStyle.innerHTML = style;
  36. return elementStyle;
  37. }
  38.  
  39. // Import Bootstrap Paper and Fontawesome using custom css function
  40.  
  41. addStyleSheet('@import "http://bootswatch.com/paper/bootstrap.css"; @import "http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"; html * { font-family: Raleway, sans-serif; }');
  42.  
  43. // At first time opening agar.io with this userscript, alert user.
  44.  
  45. var alerted = localStorage.getItem('alerted') || '';
  46. if (alerted != 'yes') {
  47. alert("Make sure you have the Charts & Stats userscript installed for ingame statistics! Check the description on Greasyfork for more info.");
  48. localStorage.setItem('alerted','yes');
  49. }
  50.  
  51. // Connect to IP & Reconnect
  52. $(document).ready(function() {
  53. var region = $("#region");
  54. if (region.length) {
  55. $("<br/><div class=\"input-group\"><div class=\"form-group\"><input id=\"serverInput\" class=\"form-control\" placeholder=\"255.255.255.255:443\" maxlength=\"20\"><span class=\"input-group-btn\"> &<button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-warning\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\">Join</button><button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-info\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\"><span class=\"fa fa-lg fa-refresh\"></span></button> </input></div>").insertAfter("#helloDialog > form > div:nth-child(3)");
  56. }
  57. });
  58.  
  59. // Remove instructions text and ad-blocker image
  60.  
  61. var elmDeleted = document.getElementById("instructions");
  62. elmDeleted.parentNode.removeChild(elmDeleted);
  63.  
  64. var elmDeleted = document.getElementById("blocker");
  65. elmDeleted.parentNode.removeChild(elmDeleted);
  66.  
  67. // Import Raleway font from Google Fonts
  68.  
  69. WebFontConfig = {
  70. google: { families: [ 'Raleway::latin' ] }
  71. };
  72. (function() {
  73. var wf = document.createElement('script');
  74. wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
  75. '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  76. wf.type = 'text/javascript';
  77. wf.async = 'true';
  78. var s = document.getElementsByTagName('script')[0];
  79. s.parentNode.insertBefore(wf, s);
  80. })();
  81.  
  82. // ------------------------------------------------------
  83. // End of userscript
  84. // ------------------------------------------------------
  85.