Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play limit #21

Open
btburbank opened this issue May 5, 2013 · 7 comments
Open

Play limit #21

btburbank opened this issue May 5, 2013 · 7 comments

Comments

@btburbank
Copy link

I was wondering if it could be enforced on a condition of that there must be 5 dj's on deck for the playlimit to be enforced. When there are less than 5 dj's on deck = no enforcement.

@samuri51
Copy link
Owner

samuri51 commented May 5, 2013

this is the standard play limit code plus two conditions added.

  1. in order for play limit to enforce there must be more than zero people in the queue
  2. must be 5 dj's on stage

this is what you meant?

 //iterates through the dj list incrementing dj song counts and
    //removing them if they are over the limit.
    var djId = data.room.metadata.current_dj;

    if (typeof (djs20[djId]) !== 'undefined')
    {
        if (++djs20[djId].nbSong >= playLimit)
        {
            if (PLAYLIMIT === true && queueList.length > 0 && currentDjs.length >== 5) //if play limit is on and no one is in queue
            {                                                                          //and greater than or equal to 5 dj's on stage
                if (djId == currentDjs[0] && playLimit === 1) //if person is in the far left seat and limit is set to one
                {
                    var checklist33 = theUsersList.indexOf(djId) + 1;
                    bot.speak('@' + theUsersList[checklist33] + ' you are over the playlimit of ' + playLimit + ' song');
                    bot.remDj(djId);
                }
                else if (djId != USERID && playLimit !== 1) //if limit is more than one
                {
                    var checklist33 = theUsersList.indexOf(djId) + 1;
                    bot.speak('@' + theUsersList[checklist33] + ' you are over the playlimit of ' + playLimit + ' songs');
                    bot.remDj(djId);
                }
            }
        }
    }

@btburbank
Copy link
Author

Right. I've had less than 5 dj's on stage with no one in the q and it still escorts people.

@samuri51
Copy link
Owner

samuri51 commented May 5, 2013

well it shouldn't now... it was never setup to only escort when 5 dj's on stage in the first place

@btburbank
Copy link
Author

Ok, so what do I need to change?

@samuri51
Copy link
Owner

samuri51 commented May 5, 2013

this code should work...

@samuri51
Copy link
Owner

samuri51 commented May 5, 2013

only activates when play limit is turned on, more than zero people in the queue and 5 dj's on stage. it also waits until it loop around the left side when the play limit is set to 1

@samuri51
Copy link
Owner

samuri51 commented May 5, 2013

its found in the endsong event at the very end of the file... you should see an old version of it in your file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants