Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Models.history.load();
- var skippedsongs = new Array();
- API.addEventListener(API.DJ_UPDATE, repeatcheck);
- function inarray(array, id) {
- for(var i=0;i<array.length;i++) {
- if(array[i][0].id == id) {
- return true;
- }
- }
- return false;
- }
- function repeatcheck(user) {
- var historylist=Models.history.data;
- var currentID=Models.room.data.media.cid;
- for(var j=1; j<50;j++) {
- if (historylist[j].media.cid == currentID) {
- var result = inarray(skippedsongs, currentID);
- if (result === false) {
- API.moderateForceSkip();
- API.sendChat("Sorry, that song's still in history");
- skippedsongs.push(currentID);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment