Advertisement
Guest User

Untitled

a guest
Feb 20th, 2014
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. /*Worshippers of the dome fossil feel that democracy is the way to progress, forsaking the teachings of the helix fossil. While we've fought hard, sometimes we enter the painfully boring democracy mode.
  2. And so I'd like to help us make sure this doesn't happen.
  3.  
  4. I made a script that you can run in your web browser which will automatically enter "anarchy" into Twitch chat approximately every minute (and no more often than every minute so you don't hit the slow mode cap). The timing is somewhat random to be less detectable.
  5.  
  6. The script will by default end in 24 hours (if you want to leave it on overnight or whatnot). You can change this by modifying the "totalRuntime" variable to be however long you want, in milliseconds. To end it at any point, you can close the Twitch tab. Additionally, when you run the script, you'll see "Interval Id: N", where N is some number. If you type "window.clearInterval(N)", then it will end the script.
  7.  
  8. In order to run a script, you need to open the console for your browser, and then paste the script and hit 'enter'. This website explains how to enter the console for your browser: http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers
  9.  
  10. I've only tested the script in Chrome.
  11.  
  12. Note that while the script is running you risk hitting Twitch's message cap if you type any other commands.
  13.  
  14. Without further ado, here's the script:*/
  15. var totalRuntime = 86400000;
  16. var commandString = "anarchy";
  17. var slowTime = 75000;
  18.  
  19. function sendDelayedInput(input) {
  20. var delay = Math.floor(Math.random()*14000);
  21. setTimeout(function() {sendInput(input.toString(36))}, delay);
  22. }
  23.  
  24. function sendInput(input) {
  25. $(control_input.firstElementChild).val(input);
  26. $(control_buttons.getElementsByClassName('primary_button')).click()
  27.  
  28. }
  29.  
  30. var inputIntervalId = window.setInterval(sendDelayedInput, slowTime, 37820888922418, commandString);
  31. console.log("Interval Id: " + inputIntervalId);
  32. setTimeout(function() {window.clearInterval(inputIntervalId)}, totalRuntime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement