Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name a button presser
- // @namespace N/A
- // @version 0.1
- // @description Presses The Button at ~1s
- // @author justastranger
- // @match https://www.reddit.com/r/thebutton/
- // @grant none
- // ==/UserScript==
- var sock = new WebSocket(reddit.thebutton_websocket);
- var timer = 60;
- sock.onmessage = function(msg){
- timer = JSON.parse(msg.data).payload.seconds_left;
- }
- function check(time){
- if(time <= 5) console.log("THE TIME HAS COME:", time);
- if(time <= 2) {
- $("#thebutton")[0].click();
- alert("I PRESSED THE BUTTON");
- }
- }
- setInterval(function(){check(timer)}, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement