AyrA

Reddit Robin auto grow script

Apr 1st, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Robin Autovoter
  3. // @namespace    http://ayra.ch
  4. // @version      0.2
  5. // @description  Autovotes via text on /r/robin
  6. // @author       /u/AyrA_ch
  7. // @match        https://www.reddit.com/robin*
  8. // @grant        none
  9. // ==/UserScript==
  10. /* jshint -W097 */
  11. 'use strict';
  12.  
  13. function sendMessage(message){
  14.     $("#robinSendMessage > input[type='text']").val(message);
  15.     $("#robinSendMessage > input[type='submit']").click();
  16. }
  17.  
  18. function rnd(l,h)
  19. {
  20.     var i=(Math.random()*(h-l)+l)|0;
  21.     console.debug("rnd",i);
  22.     return i;
  23. }
  24.  
  25. var PropagandaText=decodeURIComponent(
  26.     "%E0%BC%BC%20%E3%81%A4%20%E2%97%95_%E2%97%95%20%E0%BC%"+
  27.     "BD%E3%81%A4%F0%9F%8E%A9%F0%9F%8E%A9%F0%9F%8E%A9%20PRA"+
  28.     "ISE%20FRANK%2C%20BLESSED%20ARE%20HATS%20%F0%9F%8E%A9%"+
  29.     "F0%9F%8E%A9%F0%9F%8E%A9%E0%BC%BC%20%E3%81%A4%20%E2%97"+
  30.     "%95_%E2%97%95%20%E0%BC%BD%E3%81%A4 - Better autovoting: https://redd.it/4cz28d");
  31.  
  32. //wait 5 seconds before initializing
  33. setTimeout(function(){
  34.     var txtBox=$("#robinSendMessage > input[type='text']");
  35.     txtBox.on("keyup",function(){
  36.         if(txtBox.val()=="/frank")
  37.         {
  38.             txtBox.val(PropagandaText);
  39.         }
  40.     });
  41.     sendMessage("/vote grow");
  42.     sendMessage(PropagandaText);
  43.     //reaload after some time (5 Minutes)
  44.     setTimeout(function(){
  45.         window.location.reload();
  46.     }, rnd(200,400)*1000);
  47.     console.debug("Initialized voter");
  48. }, 5*1000);
Add Comment
Please, Sign In to add comment