View difference between Paste ID: RTD54FGb and h6gW9AZV
SHOW: | | - or go back to the newest paste.
1
Models.history.load(); //history needs to be loaded so it doesn't return blank array
2
3
API.addEventListener(API.DJ_UPDATE, repeatcheck); //activates when there's a new DJ
4
5
function repeatcheck(user) {
6-
var historylist=Models.history.data; //gets array of songs in history
6+
7-
var currentID=Models.room.data.media.cid; //gets ID of current song
7+
8
if (Models.history.data[j].media.cid == Models.room.data.media.cid) { //if the ID of the current song is the same as the ID of an item in history
9
API.sendChat("j"); //just test code, if it works, will replace with code to skip and send message
10
}
11-
if (historylist[j].media.cid == currentID) {
11+
12-
API.sendChat(j); //just test code, if it works, will replace with code to skip and send message
12+
13
14
}