Closed samuri51 closed 11 years ago
change the contents of the vipListCheck function to this.
you can see what i mean on line 507 of the stock chillybot script
//this kicks all users off stage when the vip list is not empty
if (vipList.length !== 0 && currentDjs.length != vipList.length) //manual added
{
for (var p = 0; p < currentDjs.length; p++)
{
var checkIfVip = vipList.indexOf(currentDjs[p]);
if (checkIfVip == -1 && currentDjs[p] != USERID)
{
bot.remDj(currentDjs[p]);
}
}
}
else if(tempVip.length !== 0 && currentDjs.length != tempVip.length) //command added
{
for(var i = 0; i < tempVip.length; i++)
{
var checkTempVip = tempVip.indexOf(currentDjs[i]);
//if currently being looked at dj is not a vip, and
//they are not your bot
if(checkTempVip == -1 && currentDjs[i] != USERID)
{
bot.remDj(currentDjs[i]);
}
}
}
change the code inside of the 'add_dj' event that corresponds to the following code, to this. starts around line 2617 in the stock chillybot script.
//removes dj when they try to join the stage if the vip list has members in it.
//does not remove the bot
var checkVip = vipList.indexOf(data.user[0].userid);
var checkTempVip = tempVip.indexOf(data.user[0].userid);
if (vipList.length !== 0 && checkVip == -1 && data.user[0].userid != USERID)
{
bot.remDj(data.user[0].userid);
bot.pm('The vip list is currently active, only the vips may dj at this time', data.user[0].userid);
if (typeof people[data.user[0].userid] != 'undefined')
{
++people[data.user[0].userid].spamCount;
}
if (timer[data.user[0].userid] !== null)
{
clearTimeout(timer[data.user[0].userid]);
timer[data.user[0].userid] = null;
}
timer[data.user[0].userid] = setTimeout(function ()
{
people[data.user[0].userid] = {
spamCount: 0
};
}, 10 * 1000);
}
else if(tempVip.length !== 0 && checkTempVip == -1 && data.user[0].userid != USERID)
{
bot.remDj(data.user[0].userid);
bot.pm('The vip list is currently active, only the vips may dj at this time', data.user[0].userid);
if (typeof people[data.user[0].userid] != 'undefined')
{
++people[data.user[0].userid].spamCount;
}
if (timer[data.user[0].userid] !== null)
{
clearTimeout(timer[data.user[0].userid]);
timer[data.user[0].userid] = null;
}
timer[data.user[0].userid] = setTimeout(function ()
{
people[data.user[0].userid] = {
spamCount: 0
};
}, 10 * 1000);
}