Advertisement
mateon1

Plug.dj AutoCycle

Dec 21st, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Plug.dj automatic DJ Cycle toggle
  2. // (I hope that works....)
  3.  
  4. /**
  5.  * !autocycle - shows status
  6.  * !autocycle status - shows status
  7.  * !autocycle disable - disable
  8.  * !autocycle enable - enable
  9.  * !autocycle amount [#1] [#2] - set DJ amount to enable cycle at [#1] and disable at [#2]
  10.  */
  11.  
  12. (function(undefined){var en=4,dis=6,on=true;function e(){return $(".cycle-toggle")[0].className.indexOf("enabled")!==-1}function t(){$(".cycle-toggle").click()}API.on(API.WAIT_LIST_UPDATE,function(a){on&&(e()?a.length>=dis&&t():a.length<=en&&t())});API.on(API.CHAT,function(a){if(_=/!autocycle(?:\s+(status|enable|disable|amount)(?:\s+(\d+)\s+(\d+))?)?/.exec(a.message)){switch(_[1]){case"status":case undefined:API.sendChat("AutoCycle status: running: "+on+", enable/disable at: "+en+"/"+dis);break;case"disable":if(API.hasPermission(a.fromID,API.ROLE.BOUNCER)){on=false;API.sendChat("AutoCycle disabled.")}break;case"enable":if(API.hasPermission(a.fromID,API.ROLE.BOUNCER)){on=true;API.sendChat("AutoCycle enabled.")}break;case"amount":if(_[2]!==undefined&&_[3]!==undefined&&API.hasPermission(a.fromID,API.ROLE.BOUNCER)){en=Number(_[2]);dis=Number(_[3]);API.sendChat("AutoCycle: Set enable/disable to "+_[2]+"/"+_[3])}}}})})()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement