Guest User

Untitled

a guest
Jun 25th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 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.  
  13. function updateElem() {
  14. currServ = bso ? bso.ip + ':' + bso.po : 'None';
  15. var x = snake ? parseInt(snake.xx) : 0;
  16. var y = snake ? parseInt(snake.yy) : 0;
  17. topElem.textContent = 'Server: ' + currServ + ', ' + 'X: ' + x + ', Y: ' + y;
  18. }
  19.  
  20. function force(elem) {
  21. var splitArr = elem.value.split(':');
  22. if (splitArr.length > 1) forceServer((splitArr[0] || ''), (splitArr[1] || ''));
  23. };
  24.  
  25. var topElem = document.createElement('span');
  26. window.onload = function(){
  27. topElem.style.position = 'fixed';
  28. topElem.style.zIndex = '666';
  29. topElem.style.top = '5px';
  30. topElem.style.textAlign = 'center';
  31. topElem.style.width = '100%';
  32. topElem.style.fontSize = '20px';
  33. topElem.style.fontFamily = 'Verdana';
  34. topElem.style.color = '#FFF';
  35. document.body.appendChild(topElem);
  36.  
  37. var parent = document.getElementById('playh');
  38. var div = document.createElement('div');
  39. var input = document.createElement('input');
  40. var button = document.createElement('span');
  41. var currServ = 'None';
  42.  
  43. div.style.width = '244px';
  44. div.style.margin = '14px auto';
  45. div.style.background = '#4c447c none repeat scroll 0% 0%';
  46. div.style.boxShadow = '0px 6px 50px rgb(0, 0, 0)';
  47. div.style.border = '2px solid rgba(0, 0, 0, 1)';
  48. div.style.borderRadius = '29px';
  49. div.style.display = 'block';
  50. div.style.padding = '5px';
  51. div.style.fontFamily = 'Verdana';
  52. div.style.position = 'relative';
  53.  
  54. input.type = 'text';
  55. input.placeholder = 'IP-Address:Port';
  56. input.style.margin = '2px';
  57. input.style.background = 'rgba(0, 0, 0, 0) none repeat scroll 0 0';
  58. input.style.border = '0 none';
  59. input.style.color = '#e0e0ff';
  60. input.style.fontSize = '15px';
  61.  
  62. button.textContent = 'Go!';
  63. button.style.cursor = 'pointer';
  64. button.style.color = '#FFF';
  65. button.style.borderRadius = '24px';
  66. button.style.margin = '2px';
  67. button.style.padding = '2px 6px';
  68. button.style.background = 'linear-gradient(180deg, #9DA, #485)';
  69. button.onclick = function() { force(input); };
  70.  
  71. div.appendChild(input);
  72. div.appendChild(button);
  73.  
  74. parent.appendChild(div);
  75. timerID = setInterval(function () {
  76. updateElem();
  77. }, 1000);
  78. };
Add Comment
Please, Sign In to add comment