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

Fixed "!locksip <reason>" Adds #71 #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 52 additions & 11 deletions basicBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,11 @@
var waitlistlength = API.getWaitList().length;
var locked = false;
basicBot.room.queueable = false;

$.getJSON('https://stg.plug.dj/_/rooms/state', function(data) {
if (waitlistlength == 50) {
basicBot.roomUtilities.booth.lockBooth();
if (data.data[0].booth.shouldCycle) {
basicBot.roomUtilities.changeDJCycle();
}
locked = true;
}
setTimeout(function (id) {
Expand All @@ -734,11 +736,12 @@
basicBot.room.queueable = true;
if (locked) {
setTimeout(function () {
basicBot.roomUtilities.booth.unlockBooth();
basicBot.roomUtilities.changeDJCycle();
}, 1000);
}
}, 1500, id);
}, 1000, id);
});
},
changeDJCycle: function () {
$.getJSON('https://stg.plug.dj/_/rooms/state', function(data) {
Expand Down Expand Up @@ -2598,6 +2601,7 @@
if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);
if (!basicBot.commands.executable(this.rank, chat)) return void (0);
else {
$.getJSON('https://stg.plug.dj/_/rooms/state', function(data) {
if (basicBot.room.skippable) {
var dj = API.getDJ();
var id = dj.id;
Expand All @@ -2607,7 +2611,22 @@

if (chat.message.length === cmd.length) {
API.sendChat(subChat(basicBot.chat.usedlockskip, {name: chat.un}));
basicBot.roomUtilities.booth.lockBooth();

if (data.data[0].booth.shouldCycle) {
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
setTimeout(function () {
basicBot.room.skippable = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semi colon.

}, 5 * 1000);
setTimeout(function (id) {
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
}, 1500, id);
}, 1000, id);

}else if (!data.data[0].booth.shouldCycle) {
basicBot.roomUtilities.changeDJCycle();
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
Expand All @@ -2618,25 +2637,42 @@
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
setTimeout(function () {
basicBot.roomUtilities.booth.unlockBooth();
basicBot.roomUtilities.changeDJCycle();
}, 1000);
}, 1500, id);
}, 1000, id);
}

return void (0);
}
var validReason = false;
var msg = chat.message;
var reason = msg.substring(cmd.length + 1);
for (var i = 0; i < basicBot.settings.lockskipReasons.length; i++) {
var r = basicBot.settings.lockskipReasons[i][0];
for (var i = 0; i < basicBot.settings.skipReasons.length; i++) {
var r = basicBot.settings.skipReasons[i][0];
if (reason.indexOf(r) !== -1) {
validReason = true;
msgSend += basicBot.settings.lockskipReasons[i][1];
msgSend += basicBot.settings.skipReasons[i][1];
}
}
if (validReason) {
API.sendChat(subChat(basicBot.chat.usedlockskip, {name: chat.un}));
basicBot.roomUtilities.booth.lockBooth();
if (data.data[0].booth.shouldCycle) {
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
API.sendChat(msgSend);
setTimeout(function () {
basicBot.room.skippable = true;
}, 5 * 1000);
setTimeout(function (id) {
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
}, 1500, id);
}, 1000, id);

}else {
basicBot.roomUtilities.changeDJCycle();
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
Expand All @@ -2648,15 +2684,20 @@
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
setTimeout(function () {
basicBot.roomUtilities.booth.unlockBooth();
basicBot.roomUtilities.changeDJCycle();
}, 1000);
}, 1500, id);
}, 1000, id);

}


return void (0);
}
}
});
}
}
}
},

locktimerCommand: {
Expand Down