Apps Home
|
Create an App
Dreamland Special
Author:
aristoteles3
Description
Source Code
Launch App
Current Users
Created by:
Aristoteles3
var mute_grays_yes = "yes"; var mute_grays_without_ticket = "without ticket"; var mute_grays_no = "no"; cb.settings_choices = [ { name: "ticket_price", type: "int", minValue: 1, maxValue: 1000, defaultValue: 125, label: "Admission Fee" }, { name: "hide_message", label: "Cam Message", type: "str", minLength: 1, maxLength: 256, defaultValue: "Something is happening in Dreamland. Tip {ticket_price} tokens to unlock the door and join!" }, { name: "welcome_message", label: "Welcome Message for New Users", type: "str", minLength: 1, maxLength: 256, defaultValue: "Welcome to my room, {username}! Something is happening in Dreamland. Tip {ticket_price} tokens to unlock the door and join!" }, { name: "ticket_holder_message", label: "Welcome Message for Ticket Holders", type: "str", minLength: 1, maxLength: 256, defaultValue: "Welcome to my room, {username}! Door of Dreamland is open for you. Have fun!" }, { name: "unlocked_message", label: "Unlocked Message", type: "str", minLength: 1, maxLength: 256, defaultValue: "You have unlocked the door of Dreamland. Have fun! If you have problems, then try to refresh the page." }, { name: "mute_grays", label: "Mute Grays", type: "choice", choice1: mute_grays_yes, choice2: mute_grays_without_ticket, choice3: mute_grays_no, defaultValue: mute_grays_without_ticket }, { name: "ticket_holders", label: "Default Ticket Holders (comma-separated list)", type: "str", maxLength: 256, required: false, defaultValue: "" }, ]; function replaceMacros(message, username) { return message .replace("{ticket_price}", cb.settings.ticket_price) .replace("{username}", username || "?"); } function sendNoticeToEveryone(message) { sendNoticeToUser(message, null); } function sendNoticeToBroadcaster(message) { sendNoticeToUser(message, cb.room_slug); } function sendNoticeToUser(message, username) { message = replaceMacros(message, username); cb.sendNotice(message, username, "#ffffff", "#000080", "bold"); } function help() { cb.sendNotice( "Use \"/help\" to show this help\n" + "Use \"/add username\" to add a user to the show\n" + "Use \"/remove username\" to remove a user from the show\n" + "Use \"/list\" to show all users with access to the show\n" + "Use \"/clear\" to remove all users from the show\n" + "Use \"/start\" to start the show\n" + "Use \"/stop\" to stop the show\n" + "Use \"/mutegrays yes\" to mute all grays\n" + "Use \"/mutegrays withoutticket\" to mute grays without ticket\n" + "Use \"/mutegrays no\" to unmute grays", cb.room_slug, "#ffffff", "#008000", "bold"); } function init() { if (cb.settings == null || cb.settings.ticket_holders == null) { return; } var ticket_holders = cb.settings.ticket_holders.split(","); for (var n = 0; n < ticket_holders.length; n++) { var username = ticket_holders[n].trim(); if (username != "") { cb.limitCam_addUsers([username]); sendNoticeToBroadcaster("Added " + username + " to the show."); sendNoticeToUser(cb.settings.ticket_holder_message, username); } } } cb.onEnter(function (user) { var username = user["user"]; if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username)) { sendNoticeToUser(cb.settings.ticket_holder_message, username); } else { sendNoticeToUser(cb.settings.welcome_message, username); } }); cb.onTip(function (tip) { var username = tip["from_user"]; if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username) && parseInt(tip.amount) >= cb.settings.ticket_price) { cb.limitCam_addUsers([username]); sendNoticeToBroadcaster("Added " + username + " to the show."); sendNoticeToUser(cb.settings.unlocked_message, username); } }); cb.onMessage(function (msg) { var message = msg["m"].trim(); if (cb.room_slug == msg["user"]) { if (message == "/start" && !cb.limitCam_isRunning()) { sendNoticeToEveryone(cb.room_slug + " has started the show!"); cb.limitCam_start(replaceMacros(cb.settings.hide_message)); } if (message == "/stop" && cb.limitCam_isRunning()) { sendNoticeToEveryone(cb.room_slug + " has stopped the show!"); cb.limitCam_stop(); } if (message.substring(0, 4) == "/add") { var username = message.substring(5).trim(); if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username)) { sendNoticeToBroadcaster(username + " is already on the list."); } else { cb.limitCam_addUsers([username]); sendNoticeToBroadcaster("Added " + username + " to the show."); sendNoticeToUser(cb.settings.unlocked_message, username); } } if (message.substring(0, 7) == "/remove") { var username = message.substring(8).trim(); if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username)) { cb.limitCam_removeUsers([username]); sendNoticeToBroadcaster(username + " has been kicked out of the show."); } else { sendNoticeToBroadcaster(username + " is not on the list."); } } if (message.substr(0, 6) == "/check") { var username = message.substring(7).trim(); if (cb.limitCam_userHasAccess(username)) { sendNoticeToBroadcaster(username + " is in the show."); } else { sendNoticeToBroadcaster(username + " is NOT in the show."); } } if (message == "/list") { var usernames = cb.limitCam_allUsersWithAccess(); if (usernames.length > 0) { sendNoticeToBroadcaster("" + usernames.length + (usernames.length > 1 ? " users are" : " user is") + " in the show: " + cbjs.arrayJoin(usernames, ", ")); } else { sendNoticeToBroadcaster("No users in the show."); } } if (message == "/clear") { var usernames = cb.limitCam_allUsersWithAccess(); if (usernames.length > 0) { sendNoticeToEveryone(cb.room_slug + " has removed all user from the show."); cb.limitCam_removeAllUsers(); } else { sendNoticeToBroadcaster("No users in the show."); } } if (message.substring(0, 10) == "/mutegrays") { var mute_grays = message.substring(11).trim(); if (mute_grays == "yes") { cb.settings.mute_grays = mute_grays_yes; sendNoticeToBroadcaster("Muting all grays."); } else if (mute_grays == "withoutticket") { cb.settings.mute_grays = mute_grays_without_ticket; sendNoticeToBroadcaster("Muting all grays without ticket."); } else if (mute_grays == mute_grays_no) { cb.settings.mute_grays = mute_grays_no; sendNoticeToBroadcaster("Unmuting all grays."); } } if (message == "/help") { help(); } } if (message[0] == "/") { msg["X-Spam"] = true; } var isGray = !msg["has_tokens"] && !msg["is_mod"] && !msg["in_fanclub"] && !msg["tipped_recently"] && !msg["tipped_alot_recently"] && !msg["tipped_tons_recently"]; if (isGray && (cb.settings.mute_grays == mute_grays_yes || (cb.settings.mute_grays == mute_grays_without_ticket && !cb.limitCam_userHasAccess(msg["user"])))) { msg["X-Spam"] = true; } return msg; }); help(); init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.