Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. // ==UserScript==
  2. // @name slitherio plugin
  3. // @namespace hc.priv.no
  4. // @description Plugin for slither.io
  5. // @include http://slither.io/*
  6. // @include https://slither.io/*
  7. // @updateURL https://github.com/Montaron/Slitherio-Plugin/raw/master/slitherio-plugin.meta.js
  8. // @downloadURL https://github.com/Montaron/Slitherio-Plugin/raw/master/slitherio-plugin.user.js
  9. // @version 1.13
  10. // @grant none
  11. // ==/UserScript==
  12. function updateElem() {
  13. currServ = bso ? bso.ip + ':' + bso.po : 'None';
  14. var x = snake ? parseInt(snake.xx) : 0;
  15. var y = snake ? parseInt(snake.yy) : 0;
  16. topElem.textContent = 'Server: ' + currServ + ', ' + 'X: ' + x + ', Y: ' + y;
  17. }
  18. function force(elem) {
  19. var splitArr = elem.value.split(':');
  20. if (splitArr.length > 1) forceServer((splitArr[0] || ''), (splitArr[1] || ''));
  21. };
  22. var topElem = document.createElement('span');
  23. window.onload = function(){
  24. topElem.style.position = 'fixed';
  25. topElem.style.zIndex = '666';
  26. topElem.style.top = '5px';
  27. topElem.style.textAlign = 'center';
  28. topElem.style.width = '100%';
  29. topElem.style.fontSize = '20px';
  30. topElem.style.fontFamily = 'Verdana';
  31. topElem.style.color = '#FFF';
  32. document.body.appendChild(topElem);
  33. var parent = document.getElementById('playh');
  34. var div = document.createElement('div');
  35. var input = document.createElement('input');
  36. var button = document.createElement('span');
  37. var currServ = 'None';
  38. div.style.width = '244px';
  39. div.style.margin = '14px auto';
  40. div.style.background = '#4c447c none repeat scroll 0% 0%';
  41. div.style.boxShadow = '0px 6px 50px rgb(0, 0, 0)';
  42. div.style.border = '2px solid rgba(0, 0, 0, 1)';
  43. div.style.borderRadius = '29px';
  44. div.style.display = 'block';
  45. div.style.padding = '5px';
  46. div.style.fontFamily = 'Verdana';
  47. div.style.position = 'relative';
  48. input.type = 'text';
  49. input.placeholder = 'IP-Address:Port';
  50. input.style.margin = '2px';
  51. input.style.background = 'rgba(0, 0, 0, 0) none repeat scroll 0 0';
  52. input.style.border = '0 none';
  53. input.style.color = '#e0e0ff';
  54. input.style.fontSize = '15px';
  55. button.textContent = 'Go!';
  56. button.style.cursor = 'pointer';
  57. button.style.color = '#FFF';
  58. button.style.borderRadius = '24px';
  59. button.style.margin = '2px';
  60. button.style.padding = '2px 6px';
  61. button.style.background = 'linear-gradient(180deg, #9DA, #485)';
  62. button.onclick = function() { force(input); };
  63. div.appendChild(input);
  64. div.appendChild(button);
  65. parent.appendChild(div);
  66. timerID = setInterval(function () {
  67. updateElem();
  68. }, 1000);
  69. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement