Created
March 17, 2019 01:29
-
-
Save ddugovic/64b7638338fa7d366b22e113ed9669b3 to your computer and use it in GitHub Desktop.
untested.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function play(min,sec){var challenges=$(".challenge");if(arguments.length===0)return challenges.eq(Math.floor(Math.random()*challenges.length)).find(".accept").click();else{challenges=challenges.filter(function(){return $(this).find(".desc").text().search(new RegExp(min+"\\+"+sec))!==-1});if(challenges.length===0)console.log("No challenges matching the specified time control");else{return challenges.eq(Math.floor(Math.random()*challenges.length)).find(".accept").click()}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to an anonymous viewer of IM Eric Rosen's twitch channel. (Sorry I didn't record the author's name.)