|
|
The viewers determine when you can stop!
/**
* Bot: Cruel Crowd
* Version: 1.0
* Author: nightgownfetish
* Date: 04.10.15
*/
cb.settings_choices = [
{name:'action', type:'str', minLength:1, maxLength:255, defaultValue:"MASTURBATING", label:'Action to perform (ending with "ing")'},
{name:'minimum', type:'int', minValue:3, defaultValue:30, label: "Minimum Time (in minutes)"},
{name:'finish', type:'int', minValue:3, defaultValue:15, label: "Finish Time (in minutes)"},
{name:'reminder1', type:'int', minValue:0, defaultValue:5, label: "1st Reminder Time (in minutes)"},
{name:'reminder2', type:'int', minValue:0, defaultValue:10, label: "2nd Reminder Time (in minutes)"},
{name:'bathroom', type:'int', minValue:0, defaultValue:0, label: "Bathroom Break Time (in minutes, optional)"},
{name:'highlightColor', type:'str', minLength:7, maxLength:7, defaultValue:"#FFFF00", label:'Highlight Color (hex value)'}
];
var minimum = cb.settings.minimum;
var reminder1 = cb.settings.reminder1;
var reminder2 = cb.settings.reminder2;
var finish = cb.settings.finish;
var bathroom = cb.settings.bathroom;
var action = cb.settings.action;
var highlightColor = cb.settings.highlightColor;
var forTips = false;
var minimumTip = 1;
cb.sendNotice("Thanks for using Cruel Crowd! If you like this bot then please tip the author: nightgownfetish.", "", highlightColor);
cb.sendNotice("Enter /ccstart to start your session.", cb.room_slug, highlightColor);
cb.sendNotice("Enter /ccstop to stop your session, though you will be punished if you do!.", cb.room_slug, highlightColor);
var delay = minimum - finish;
var startTime = new Date().getTime();
var sessionStarted = false;
var lastMessageTime;
function timeSinceStart() {
var totalMinutes = (new Date().getTime() - startTime) / 60000;
var timeSinceStart = parseMinutes(totalMinutes)
if(timeSinceStart == "") {
return false;
}
return timeSinceStart;
}
function parseMinutes(totalMinutes) {
var timeString = "";
var hours = Math.floor(totalMinutes / 60);
if(hours > 1) {
timeString += hours + " hours ";
} else if(hours > 0) {
timeString += hours + " hour ";
}
var minutes = Math.round(totalMinutes % 60);
if(minutes > 1) {
timeString += minutes + " minutes";
} else if(minutes > 0) {
timeString += minutes + " minute";
}
return timeString;
}
function showNotice(minutes) {
cb.sendNotice(cb.room_slug + " will be allowed to stop " + action + " in " + parseMinutes(minutes) + " if nobody posts another message here.", "", highlightColor);
if(timeSinceStart() !== false) {
cb.sendNotice("( " + cb.room_slug + " has been " + action + " for " + timeSinceStart() + " already! )", "", highlightColor);
}
}
function checkNotices() {
if(sessionStarted === true) {
var time = new Date().getTime();
if(time > lastMessageTime && time < lastMessageTime + 59999) {
showNotice(finish);
}
if(reminder1 > 0 && time > lastMessageTime + (reminder1 * 60000) && time < lastMessageTime + ((reminder1 + 1) * 60000) - 1) {
showNotice(finish - reminder1);
}
if(reminder2 > 0 && time > lastMessageTime + (reminder2 * 60000) && time < lastMessageTime + ((reminder2 + 1) * 60000) - 1) {
showNotice(finish - reminder2);
}
if(time > lastMessageTime + (finish * 60000)) {
sessionStarted = false;
var notice = "############## SESSION OVER ##############\n";
notice += cb.room_slug + " is allowed to stop " + action + " now. " + cb.room_slug + " should have only been " + action + " or performing other acts specified in the session rules since the session started up until now.\n";
notice += "############## THANKS FOR WATCHING! ########";
cb.sendNotice(notice, "", highlightColor);
}
setTimeout(checkNotices, 60000);
}
}
cb.onMessage(function(msg) {
if(msg['user'] == cb.room_slug) {
if (msg['m'].match(/\/ccstop/i) && sessionStarted === true) {
sessionStarted = false;
var notice = "############## SESSION STOPPED BY BROADCASTER ##############\n";
notice += cb.room_slug + " has stopped " + action + "... WITHOUT PERMISSION! " + cb.room_slug + " now must be PUNISHED SEVERELY on camera for disobeying the bot!";
cb.sendNotice(notice, "", highlightColor);
} else if (msg['m'].match(/\/ccstop/i) && sessionStarted === false) {
cb.sendNotice("No session started. Enter /ccstart to start a new session.", cb.room_slug, highlightColor);
} else if (msg['m'].match(/\/ccstart/i) && sessionStarted === false) {
sessionStarted = true;
var notice = "############## START SESSION NOW ##############\n";
notice += cb.room_slug + " must start " + action + " RIGHT NOW! " + cb.room_slug + " is NOT allowed to stop " + action + " until this bot says that the session is over. This will only happen if nobody posts a message here for " + parseMinutes(finish) + " after a minimum of " + parseMinutes(minimum) + ".";
cb.sendNotice(notice, "", highlightColor);
startTime = new Date().getTime();
lastMessageTime = new Date().getTime() + delay * 60000;
setTimeout(checkNotices, 60000);
if(bathroom > 0) {
var breakTime = bathroom * 60000;
function bathroomBreak() {
if(sessionStarted === true) {
cb.sendNotice("############## BATHROOM BREAK ##############", "", highlightColor);
cb.sendNotice(cb.room_slug + " is allowed a very short bathroom break after " + parseMinutes(bathroom) + ". Make it quick " + cb.room_slug + "!", "", highlightColor);
setTimeout(bathroomBreak, breakTime);
}
}
setTimeout(bathroomBreak, breakTime);
}
}
}
if (new Date().getTime() > lastMessageTime && sessionStarted === true) {
lastMessageTime = new Date().getTime();
}
});
© Copyright Chaturbate 2011- 2026. All Rights Reserved.