Last active
July 20, 2022 19:46
-
-
Save nthitz/6505092 to your computer and use it in GitHub Desktop.
plug dj woot!
This file contains 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
javascript:var voteTimeout=null;var djCheckTimeout=null;var user=null;once();function once(){if(typeof ran!=="undefined"){return;}ran=true;API.on(API.DJ_ADVANCE,advance);$('#audience').remove();$('#playback').css('opacity',0);$('#room-wheel').css('background','black');voteTimeout=setTimeout(vote,2000);djCheckTimeout=setTimeout(checkIfDJing,1000);user=API.getUser();}function advance(obj){clearTimeout(voteTimeout);clearTimeout(djCheckTimeout);if(obj==null)return;var timer=30000+30000*Math.random();voteTimeout=setTimeout(vote,timer);djCheckTimeout=setTimeout(checkIfDJing,5000);}function vote(){$('#room #woot').click();}function checkIfDJing(){return;var curDJs=API.getDJs();var djing=false;for(var i=0;i<curDJs.length;i++){var dj=curDJs[i];if(dj.id===user.id){djing=true;break;}}if(djing){return;}var inWaitList=API.getWaitListPosition();if(inWaitList!=-1){return;}$('.button-dj:visible').click();} |
This file contains 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
var voteTimeout = null; | |
var djCheckTimeout = null; | |
var user = null; | |
once(); | |
function once() { | |
if(typeof ran !== "undefined") { | |
return; | |
} | |
ran = true; | |
API.on(API.DJ_ADVANCE,advance); | |
$('#audience').remove(); | |
$('#playback').css('opacity',0); | |
$('#room-wheel').css('background','black'); | |
voteTimeout = setTimeout(vote,2000); | |
djCheckTimeout = setTimeout(checkIfDJing,1000); | |
user = API.getUser(); | |
} | |
function advance(obj) | |
{ | |
clearTimeout(voteTimeout); | |
clearTimeout(djCheckTimeout); | |
if (obj == null) return; // no dj | |
var timer = 30000 + 30000 * Math.random(); | |
voteTimeout = setTimeout(vote,timer); | |
djCheckTimeout = setTimeout(checkIfDJing, 5000); | |
} | |
function vote() { | |
$('#room #woot').click(); | |
} | |
function checkIfDJing() { | |
return; | |
var curDJs = API.getDJs(); | |
var djing = false; | |
for(var i = 0; i < curDJs.length; i++) { | |
var dj = curDJs[i]; | |
if(dj.id === user.id) { | |
djing = true; | |
break; | |
} | |
} | |
if(djing) { | |
return; | |
} | |
var inWaitList = API.getWaitListPosition(); | |
if(inWaitList != -1) { | |
return; | |
} | |
$('.button-dj:visible').click(); | |
} | |
//http://subsimple.com/bookmarklets/jsbuilder.htm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment