// ==UserScript== // @name Robin Autovoter // @namespace http://ayra.ch // @version 0.2 // @description Autovotes via text on /r/robin // @author /u/AyrA_ch // @match https://www.reddit.com/robin* // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; function sendMessage(message){ $("#robinSendMessage > input[type='text']").val(message); $("#robinSendMessage > input[type='submit']").click(); } function rnd(l,h) { var i=(Math.random()*(h-l)+l)|0; console.debug("rnd",i); return i; } var PropagandaText=decodeURIComponent( "%E0%BC%BC%20%E3%81%A4%20%E2%97%95_%E2%97%95%20%E0%BC%"+ "BD%E3%81%A4%F0%9F%8E%A9%F0%9F%8E%A9%F0%9F%8E%A9%20PRA"+ "ISE%20FRANK%2C%20BLESSED%20ARE%20HATS%20%F0%9F%8E%A9%"+ "F0%9F%8E%A9%F0%9F%8E%A9%E0%BC%BC%20%E3%81%A4%20%E2%97"+ "%95_%E2%97%95%20%E0%BC%BD%E3%81%A4 - Better autovoting: https://redd.it/4cz28d"); //wait 5 seconds before initializing setTimeout(function(){ var txtBox=$("#robinSendMessage > input[type='text']"); txtBox.on("keyup",function(){ if(txtBox.val()=="/frank") { txtBox.val(PropagandaText); } }); sendMessage("/vote grow"); sendMessage(PropagandaText); //reaload after some time (5 Minutes) setTimeout(function(){ window.location.reload(); }, rnd(200,400)*1000); console.debug("Initialized voter"); }, 5*1000);