Guest User

Untitled

a guest
Mar 5th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TagPro Stupid Namechanging Script
  3. // @namespace http://www.reddit.com/user/ruarai/
  4. // @description 'Help' your team with stupid name changes. Original by contact-lens-linux/steppin (?)
  5. // @include http://tagpro-*.koalabeast.com:*
  6. // @include http://tangent.jukejuice.com:*
  7. // @include http://*.newcompte.fr:*
  8. // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  9. // @author ruarai
  10. // @version 0.3
  11. // ==/UserScript==
  12. (function() {
  13.  
  14. function contentEval(source) {
  15. // Check for function input.
  16. if ('function' == typeof source) {
  17. // Execute this function with no arguments, by adding parentheses.
  18. // One set around the function, required for valid syntax, and a
  19. // second empty set calls the surrounded function.
  20. source = '(' + source + ')();'
  21. }
  22.  
  23. // Create a script node holding this source code.
  24. var script = document.createElement('script');
  25. script.setAttribute("type", "application/javascript");
  26. script.textContent = source;
  27.  
  28. // Insert the script node into the page, so it will run, and immediately
  29. // remove it to clean up.
  30. document.body.appendChild(script);
  31. document.body.removeChild(script);
  32. }
  33.  
  34. function actualScript() {
  35.  
  36. var macros = ["CHANGE","NAMES","HERE"];
  37. //you can add more names as much as you want
  38.  
  39. //you can change the interval, low intervals may not work though
  40. var tid = setInterval(mycode, 5000);
  41. function mycode() {
  42. change(macros[Math.floor(Math.random()*macros.length)]);
  43. }
  44.  
  45.  
  46.  
  47. var lastMessage = 0;
  48.  
  49. function change(Message) {
  50. var limit = 500 + 10;
  51. var now = new Date();
  52. var timeDiff = now - lastMessage;
  53. if (timeDiff > limit) {
  54. tagpro.socket.emit("name", Message);
  55. lastMessage = new Date();
  56. } else if (timeDiff >= 0) {
  57. setTimeout(chat, limit - timeDiff, Message)
  58. }
  59. }
  60.  
  61. }
  62.  
  63. contentEval(actualScript);
  64. })();
Add Comment
Please, Sign In to add comment