Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Last active March 10, 2016 21:01
Show Gist options
  • Select an option

  • Save davidmyersdev/6c8a19720b1e9d913af3 to your computer and use it in GitHub Desktop.

Select an option

Save davidmyersdev/6c8a19720b1e9d913af3 to your computer and use it in GitHub Desktop.
;(function (window, $)
{
'use strict';
var TheButton = $('#thebutton');
var DesiredTime = parseInt(window.prompt('Enter Your Desired Time: '), 10);
console.log('The Button Will Be Pressed At: ' + DesiredTime + 's');
var RunLoop = window.setInterval(function ()
{
var currentTime = parseInt($('#thebutton-s-10s').text() + $('#thebutton-s-1s').text(), 10);
if (currentTime <= (DesiredTime - 1))
{
TheButton.click();
window.clearInterval(RunLoop);
console.log('The Button Has Been Pressed...');
}
}, 10);
})(window, jQuery);
@davidmyersdev

Copy link
Copy Markdown
Author

This script is meant to be used on https://reddit.com/r/thebutton. When pasted into the console and run, it will prompt for your desired press time. Then, it will continue to run in the background until your time comes up, and it will press the button for you.

Note: If you refresh or leave the page, this will obviously stop running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment