Apps Home
|
Create an App
CT_1
Author:
nimrod
Description
Source Code
Launch App
Current Users
Created by:
Nimrod
/////////////////////////////////////////////////////// // Title: CrazyTicket // A Hidden Cam Show Ticket Selling App // By: CrazyWare // // Author: 'acrazyguy' and 'phatkatmeow' // Thumbsup: Concept and inspiration: 'birdylovesit' // // Version: 2.3 (2023.06.15) // Build: .121 /////////////////////////////////////////////////////// // TODO var reCmdSplit = new RegExp("^\/(\\S+)(?:\\b\\s*)(.*)?"); // /ctb You should always use the CrazyTicket App in the Active App slot rather than the Bot if there is nothing in the App slot already. It will give viewers AND YOU more info - Stripfap24 // ********** APP DATA ********** var app = { name : "CrazyTicket", /* Script name */ type : 'App', /* Script type: bot|app */ version : '2.3', /* Internal: Script version number */ build : '.121', /* Internal: Script build number */ date : '2023.06.15', /* Internal: Script build date */ acg : 'acrazyguy', /* main developer */ nr : 'nimrod', /* Testbed developer */ pkm : 'phatkatmeow', /* main developer */ rx : 'robx7', /* Associate developer */ bli : 'birdylovesit', /* The inspiration */ bf : 'blazefyre', /* The inspiration's sidekick */ CD : 'dump' /* debug: quick overview */ }; // ********** APP COLORS ********** const COLOR = { WHITE : '#FFFFFF', DEVELOPER : '#D9F7F7', // ACG and PKM NOTICE : '#6900CC', // Chat notice colour - Blue-purple HILITE : "linear-gradient(to right bottom, #FFFFFF, #EDE5FF, #FFFFFF)", BRED : '#FF1407', // Bright red MOD : '#DC0000', // Moderator red MRED : '#D80A00', // Medium red REDCBBG : "#FD0201", // CB red background REDHL : "linear-gradient(to right bottom, #FFFFFF, #FFE5E5, #FFFFFF)", ORANGE : '#FF7F00', // Orange ORANGEHL : "linear-gradient(to right bottom, #FFFFFF, #FFF0E5, #FFFFFF)", HOST : "#DC5500", // Broadcaster orange GREEN : '#009900', // Fan green GREENHL : "linear-gradient(to right bottom, #FFFFFF, #E5FFE5, #FFFFFF)", BLUE : '#0000FF', // Blue BLUEHL : "linear-gradient(to right bottom, #FFFFFF, #E5E5FF, #FFFFFF)", DBLUE : '#000099', // Dark blue - Dev text DBLUEHL : "linear-gradient(to right bottom, #FFFFFF, #E0E0F9, #FFFFFF)", VIOLET : '#7F00FF', // Violet VIOLETHL : "linear-gradient(to right bottom, #FFFFFF, #F0E5FF, #FFFFFF)", PINK : '#FC0FC0', // Shocking Pink PINKHL : "linear-gradient(to right bottom, #FFFFFF, #FFE5F3, #FFFFFF)", MAG : '#E509E5', // Magenta MAGHL : "linear-gradient(to right bottom, #FFFFFF, #FFE5FF, #FFFFFF)", DMAG : '#990099', // Dark Magenta PURP : '#8C65BD', // Purple (Royal)---> 7851A9 PURPHL : "linear-gradient(to right bottom, #FFFFFF, #EFE5FF, #FFFFFF)", SYNTAX : '#995B00', // Usage notice colour - Brownish HVTEXT : '#D80A00', // Text colour for hi-vis notices - Red HVBACK : "linear-gradient(to right bottom, #FFFFFF, #FFFFBF, #FFFFFF)", TBMTEXT : '#12447A', // To BC and Mods text color TBMBACK : "linear-gradient(to right bottom, #FFFFFF, #E5F1FF, #FFFFFF)", INFO : '#144D8C', // Neutral notice - Blue-grey BLI : 'linear-gradient(to right bottom, #FFFFFF, #DDFFCC 90%)', // Pastel green - Birdy BF : 'linear-gradient(to right bottom, #FFFFFF, #FFE0EA 90%)' // Pastel pink - Blaze }; // ********** FLAGS *********** var FLAG = { stats : false, gift : true, /* Allows gifting of tickets */ goal : false, /* Indicates a goal has been set if true*/ priceup : false, /* Indicates a price increase */ debug : false, /* Internal debug state: false (off by default) */ dev : false, /* Internal dev hl state: false (off by default) */ hilite : true, /* On (true) by default for COLOR.HILITE */ schat : false, /* Used by '/schat' command to suppress public chat */ toff : false, /* Used by '/tipsoff' to suppress the tip total info from being written to the info panel */ cdtimer : false, /* Indicates if countdown show timer has is running */ hcam : false, /* Indicates 'hidden cam' show is active */ sover : false, /* Sell no tickets */ end : false, /* End of show - /showend, /stopshow */ email : false, /* Turns on/off email detection in tip note */ ots : false, /* Indicates if the Outstanding Ticket System is in use. Off by default */ olo : false, recbuy : false, /* Record paid ticket prices */ lb100 : true }; //********** MISC VARIABLES ********** //var cmdPrefix = '/'; var dashLine = "------------------------------------------------------------"; var typeCmds = " Type '/cmds' to see all commands."; var newTeaser = "-------- WHAT'S NEW ---------- 2023.04.15 ---------\n\u25CF To see what's new in " +app.name+ ", type: /new\n"+dashLine; var whatsNew = "--------------------- WHAT'S NEW ----------------------\n\u25CF CT commands that require a username (/add, etc)\n\u25CF will now accept usernames starting with an '@'\n\u25CF character.\n\u25CF You can type /add (and a space), then click on a\n\u25CF username in the chat and select\n\u25CF :MTU \n\u25CF This will avoid typing/spelling errors and the '@'\n\u25CF will be automatically stripped from the name.\n"+dashLine; var otsMsg = "You have an outstanding ticket that you can use for this show.\n\u25CF To use your ticket simply type /useticket in the chat and you will be added to the ticket holders list for this show.\n\u25CF If you change your mind BEFORE the show starts simply type /saveticket in the chat, and your ticket will become available for another time.\n"; var giftAd = dashLine+"\n\u25CF :alert1 CrazyTicket will now let viewers gift tickets\n\u25CF to other viewers\n\u25CF Type /giftinfo for more information\n"+dashLine; //var roomTeaser = dashLine+"\n\u25CF :alert1 CrazyTicket is now compatible with\n\u25CF Anonymous Tipping\n"+dashLine; var roomHost = cb.room_slug; var MODS = 'red'; var FANS = 'green'; var stats = app.acg; var ticketPrice = null; var fanPrice = null; var totalTipped = 0; var cdTimerMinutes = 0; var hideTime = 0; var cdMilliSecs = 0; var cdTimerID; //var showTimerID; var oldPrice = 0; var newPrice = 0; // ********** ARRAYS ********** // var ticketList = []; /* Backup ticket list */ var paidList = []; /* Viewers who have paid for tickets */ // var viewerList = []; /* Ticket holders currently in the room */ // var nirList = []; /* Ticket holders currently NOT in the room */ // var pnirList = []; /* PAID ticket holders currently NOT in the room */ var addList = []; /* Manually added ticket holders */ var autoList = []; /* Auto-added ticket holders */ var lifeList = []; /* Lifetime ticket holders list */ var otsTickets = []; /* Viewers who have an OTS ticket available to them */ var usedOTS = []; /* Viewers who have used their OTS tickets */ var devList = []; var miscList = []; var opList = []; /* List of viewers that paid pre-increase price */ var nfcList = []; /* List of reg viewers that paid fanclub price */ var ctPrices = []; /* Track price changes */ var ctBuyers = []; /* Price change stats */ // Track these commands var cmdList = ['add','starttimer','timeleft','startshow','endwarn','showover','stopsales','showend','alist','pnrlist','pnr','ctprice']; var giftList = { gifter : [], giftee : [] }; var emList = { name : [], email : [] }; /************* APP LAUNCH SCREEN *************/ cb.settings_choices = [ { name: 'WARNING', type: 'str', defaultValue: "<<<< READ THIS !!", label: "** This version of CrazyTicket is NOT recommended for rooms that have a large number of users likely to buy a ticket and/or where there is a possibility of frantic rapid ticket buying that may cause a crash and the ticket list lost **. A new version is in development and will available soon. Under these conditions, use it at your own risk and keep a backup ticket list if possible" }, { name: 'includeACG', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Give a complimentary ticket to 'acrazyguy' the developer of CrazyTicket?" }, { name: 'goal', type: 'int', minValue: 0, label: "Token Goal (optional)", required: false }, { name: 'showDesc', type: 'str', minLength: 1, maxLength: 255, defaultValue: "", label: "Show Description (optional)", required: false }, { name: 'buyin', type: 'int', minValue: 1, defaultValue: 25, label: "Ticket Price" }, { name: 'fanbuyin', type: 'int', label: "Ticket price for FANS (leave blank if fans are auto-added or pay the regular price)", required: false }, { name: 'fanAdvertInt', type: 'int', label: "Enter time interval for Fan Price Notice (minutes). Leave blank to disable. *ONLY FANS SEE THIS NOTICE*", required: false }, { name: 'giftTickets', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Allow viewers to gift tickets to other viewers? NOTE: Mods and Fans are currently prohibited from gifting due to free entry and special pricing issues. We're STILL working on it" }, { name: 'lifeTime', type: 'str', minLength: 1, maxLength: 500, defaultValue: "", label: "Enter Lifetime Ticket Holders' names here. * NAMES MUST BE SEPARATED BY A COMMA *", required: false }, { name: 'hideTips', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Hide tip total from viewers?" }, { name: 'osTickets', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Enable the Outstanding Ticket System?" }, { name: 'otsHolders', type: 'str', minLength: 1, maxLength: 500, defaultValue: "", label: "Enter Outstanding Ticket holders' names here if you only have a few. * NAMES MUST BE SEPARATED BY A COMMA *", required: false }, { name: 'includeMods', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Allow moderators to add/delete users (and themselves) to the show?" }, { name: 'modPrice', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Allow moderators to change the ticket price for you?" }, { name: 'autoaddMods', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Automatically give Mods a ticket?" }, { name: 'autoaddFans', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Automatically give Fanclub Members a ticket?" } ]; if (cb.settings.buyin) ticketPrice = parseInt(cb.settings.buyin,10); // Regular ticket price if (cb.settings.fanbuyin) { fanPrice = parseInt(cb.settings.fanbuyin,10); // Fans only ticket price var fanMsg = dashLine + "\n\u25CF The broadcaster has set a special ticket price\n\u25CF for FAN CLUB members\n\u25CF Tip " + fanPrice + " tokens for a show ticket\n" + dashLine; var fcpMsg = "-------------------- :greenvip --------------------------\n\u25CF Ticket Price For Fan Club Members Is " + fanPrice + " Tokens\n" + dashLine; } else { fanPrice = null; } if (cb.settings.fanAdvertInt) var fanAdvertInt = parseInt(cb.settings.fanAdvertInt,10); else var fanAdvertInt = null; if (cb.settings.includeACG === 'Yes') FLAG.stats = true; if (cb.settings.giftTickets === 'No') FLAG.gift = false; if (cb.settings.hideTips === 'Yes') FLAG.toff = true; if (cb.settings.goal) { var tipGoal = parseInt(cb.settings.goal,10); // Goal amount FLAG.goal = true; FLAG.toff = false; } else { var tipGoal = null; } if (cb.settings.osTickets === 'Yes') FLAG.ots = true; // ********** END cb.settings_choices ********** // ***** Load lifeList array from setup field if used ***** if (cb.settings.lifeTime != "") { lifeList = String(cb.settings.lifeTime).split(/[,\s]+/); } // ***** Load otsTickets array from setup field if used ***** if (FLAG.ots && cb.settings.otsHolders != "") { otsTickets = String(cb.settings.otsHolders).split(/[,\s]+/); } /******************* *** onDrawPanel *** *******************/ cb.onDrawPanel(function(viewer) { var row1label = ""; var row1val = ""; if (FLAG.goal) { row1label = "Total Tips / Goal"; row1val = "" + totalTipped + " / " + tipGoal; } else { row1label = "Tips Received:"; row1val = "" + totalTipped; } if (FLAG.sover && !FLAG.end) { return { 'template' : '3_rows_of_labels', 'row1_label': "Ticket Holders:", 'row1_value': cb.limitCam_allUsersWithAccess().length, 'row2_label': "", 'row2_value': "", 'row3_label': "", 'row3_value': "" } } else if (FLAG.end) { return { 'template' : '3_rows_11_21_31', 'row1_value': "The show is over.", 'row2_value': "Ticket sales have", 'row3_value': "been suspended." } } else if (FLAG.goal && fanPrice && FLAG.toff) { return { 'template' : '3_rows_of_labels', 'row1_label': "Ticket Holders:", 'row1_value': cb.limitCam_allUsersWithAccess().length, 'row2_label': "Ticket Price:", 'row2_value': ticketPrice, 'row3_label': "**FAN CLUB ONLY**:", 'row3_value': fanPrice } } else if (FLAG.goal && fanPrice) { return { 'template' : '3_rows_11_21_31', 'row1_value': "Tips/Goal: " + totalTipped + " / " + tipGoal + " \u2003|\u2003 Ticket Holders: \u2002" + cb.limitCam_allUsersWithAccess().length, 'row2_value': "Ticket Price: " + ticketPrice, 'row3_value': "**FAN CLUB ONLY**: " + fanPrice } } else if (FLAG.toff && fanPrice) { return { 'template' : '3_rows_of_labels', 'row1_label': "Ticket Holders:", 'row1_value': cb.limitCam_allUsersWithAccess().length, 'row2_label': "Ticket Price:", 'row2_value': ticketPrice, 'row3_label': "**FAN CLUB ONLY**:", 'row3_value': fanPrice } } else if (FLAG.toff) { return { 'template' : '3_rows_of_labels', 'row1_label': "Ticket Holders:", 'row1_value': cb.limitCam_allUsersWithAccess().length, 'row2_label': "Ticket Price:", 'row2_value': ticketPrice, 'row3_label': "", 'row3_value': "" } } else if (fanPrice && !FLAG.goal) { return { 'template' : '3_rows_11_21_31', 'row1_value': "Tips: " + totalTipped + " \u2003|\u2003 Ticket Holders: " + cb.limitCam_allUsersWithAccess().length, 'row2_value': "Ticket Price: " + ticketPrice, 'row3_value': "**FAN CLUB ONLY**: " + fanPrice /* 'template' : '3_rows_of_labels', 'row1_label': row1label, 'row1_value': row1val, 'row2_label': "Ticket Holders:", 'row2_value': cb.limitCam_allUsersWithAccess().length, 'row3_label': "", 'row3_value': "" */ } } else { return { 'template' : '3_rows_of_labels', 'row1_label': row1label, 'row1_value': row1val, 'row2_label': "Ticket Holders:", 'row2_value': cb.limitCam_allUsersWithAccess().length, 'row3_label': "Ticket Price:", 'row3_value': ticketPrice } } }); /* END onDrawPanel() */ /************* *** onTip *** *************/ cb.onTip(function(tip) { var tipAmount = parseInt(tip['amount'],10); var viewer = tip['from_user']; var isAnon = tip['is_anon_tip']; var isMod = tip['from_user_is_mod']; var isFan = tip['from_user_in_fanclub']; var tMsg = tip['message']; var address = ""; var idx1 = 0; var idx2 = 0; /* if (cb.limitCam_userHasAccess(viewer) && !viewerList.includes(viewer)) viewerList.push(viewer); */ // track total tips totalTipped += tipAmount; if ((totalTipped >= tipGoal) && FLAG.goal) { cb.sendNotice( dashLine + "\n\u25CF :CGGoal15 HAS BEEN REACHED!! :CGGoal15R" + "\n\u25CF Thanks to all tippers\n" + dashLine, '', COLOR.REDHL, COLOR.MRED, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF :ml-gl IT'S SHOWTIME :ml-gl\n" + dashLine, '', COLOR.GREENHL, COLOR.GREEN, 'bold' ); tipGoal = 0; FLAG.goal = false; } if (FLAG.email) { address = tMsg.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) || ""; idx1 = emList.name.indexOf(viewer); if (idx1 > -1 && !emList.email[idx1]) { emList.email[idx1] = address; cb.sendNotice("\u25CF Missing email address recorded", roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } } // If price increased . . . if (FLAG.priceup && !cb.limitCam_userHasAccess(viewer)) { if ((opList.includes(viewer)) && (tipAmount >= (ticketPrice - oldPrice))) { user('add',viewer); if (isAnon) cb.sendNotice("\u25CF :CT12LT Ticket sold to 'anonymous'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); else cb.sendNotice("\u25CF :CT12LT Ticket sold to '" + viewer + "'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); cbjs.arrayRemove(opList,viewer); if (!paidList.includes(viewer)) paidList.push(viewer); // if (!viewerList.includes(viewer)) viewerList.push(viewer); cb.sendNotice( dashLine + "\n\u25CF You NOW have a ticket and will be able to view" + "\n\u25CF the 'Hidden Cam' show.\n" + dashLine, viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else if (tipAmount === oldPrice) { opList.push(viewer); cb.sendNotice( dashLine + "\n\u25CF :alert1 YOU TIPPED THE \u25CFOLD PRICE\u25CF AFTER" + "\n\u25CF THE PRICE WAS INCREASED TO " + ticketPrice + " TOKENS!!" + "\n\u25CF PLEASE TIP ANOTHER " + (ticketPrice - oldPrice) + " TOKENS TO GET" + "\n\u25CF YOUR TICKET!!\n" + dashLine, viewer, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } } // Non-fanclubber tips fanclub price if (fanPrice) { if (nfcList.includes(viewer) && (tipAmount >= (ticketPrice - fanPrice))) { user('add',viewer); cb.sendNotice("\u25CF :CT12LT Ticket sold to '" + viewer + "'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); cbjs.arrayRemove(nfcList,viewer); if (!paidList.includes(viewer)) paidList.push(viewer); // if (!viewerList.includes(viewer)) viewerList.push(viewer); cb.sendNotice( dashLine + "\n\u25CF You NOW have a ticket and will be able to view" + "\n\u25CF the 'Hidden Cam' show\n" + dashLine, viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else if (!cb.limitCam_userHasAccess(viewer) && (tipAmount == fanPrice) && !isFan && (fanPrice != ticketPrice)) { nfcList.push(viewer); cb.sendNotice( dashLine + "\n\u25CF :alert1 YOU TIPPED THE FANCLUB PRICE!! :alert1 " + "\n\u25CF YOUR PRICE IS \u25CF" + ticketPrice + "\u25CF TOKENS!!" + "\n\u25CF PLEASE TIP ANOTHER \u25CF" + (ticketPrice - fanPrice) + "\u25CF TOKENS TO GET" + "\n\u25CF YOUR TICKET!!\n" + dashLine, viewer, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } } // track viewers for ticket show if (((tipAmount >= ticketPrice) || (isFan && fanPrice && (tipAmount >= fanPrice))) && !FLAG.end) { if (!cb.limitCam_userHasAccess(viewer.toLowerCase())) { if (isFan) { if (isAnon) cb.sendNotice("\u25CF :CT12LT Ticket sold to 'anonymous'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); else cb.sendNotice("\u25CF :CT12LT Ticket sold to Fan Club member '" + viewer + "'", '',COLOR.GREENHL, COLOR.GREEN, 'bold' ); } if (!isFan) { if (isAnon) cb.sendNotice("\u25CF :CT12LT Ticket sold to 'anonymous'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); else cb.sendNotice("\u25CF :CT12LT Ticket sold to '" + viewer + "'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); } user('add',viewer.toLowerCase()); //if (!cbjs.arrayContains(tList,viewer) && (viewer != app.acg)) tList.push(viewer); if (!paidList.includes(viewer)) paidList.push(viewer); /* if (!viewerList.includes(viewer)) viewerList.push(viewer); */ if (!isFan && FLAG.recbuy) ctBuyers.push(tipAmount); cb.sendNotice( dashLine + "\n\u25CF You will be able to view the 'Hidden Cam' show\n" + dashLine, viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); if (FLAG.email) { address = tMsg.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i) || ""; emList.name.push(viewer); emList.email.push(address); if (!address) { cb.sendNotice("\u25CF You may have forgotten your email address in the tip note", viewer, '', COLOR.BRED, 'bold' ); cb.sendNotice("\u25CF Viewer '" + viewer + "' may have forgotten their email address in the tip note", roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice("\u25CF Viewer '" + viewer + "' may have forgotten their email address in the tip note", '', '', COLOR.MOD, 'bold', MODS ); } else { cb.sendNotice("\u25CF Email address recorded", roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } } // End if FLAG.email } // End if !cb.limit.. } // End if tipAmount cb.drawPanel(); }); /* END onTip() */ /*************** *** onEnter *** ***************/ cb.onEnter(function(viewer) { // Variables var viewr = viewer['user']; var isMod = viewer['is_mod']; var isFan = viewer['in_fanclub']; if (isMod) cb.sendNotice(newTeaser,viewr,COLOR.HVBACK,COLOR.HVTEXT,'bold'); /* if (user('check',viewr)) if (!viewerList.includes(viewr)) viewerList.push(viewr); */ /* if (nirList.includes(viewr)) cbjs.arrayRemove(nirList,viewr);*/ /* if (pnirList.includes(viewr)) cbjs.arrayRemove(pnirList,viewr);*/ // Show entering viewer various Notices. cb.sendNotice( dashLine + "\n\u25CF " + typeCmds + "\n" + dashLine, viewr, COLOR.REDHL, COLOR.MRED, 'bold' ); //cb.sendNotice(dashLine+"\n\u25CF :alert1 CrazyTicket supports Anonymous Tipping\n"+dashLine,viewr,COLOR.BLUEHL,COLOR.BLUE,'bold'); if ((viewr === app.acg) && FLAG.stats) cb.sendNotice(":alert1 Complimentary ticket", app.acg, COLOR.HILITE, COLOR.NOTICE, 'bold' ); if (FLAG.hcam && !FLAG.end) cb.sendNotice( dashLine + "\n\u25CF A Hidden Cam show is in progress" + "\n\u25CF Duration: " + getShowTime() + "\n\u25CF Tip " + ticketPrice + " tokens to see the show\n" + dashLine, viewr, '', COLOR.NOTICE, 'bold' ); if (FLAG.sover && !FLAG.end) cb.sendNotice( dashLine + "\n\u25CF :alert1 THE SHOW WILL END SOON :alert1" + "\n\u25CF BUYING A TICKET NOW IS NOT RECOMMENDED\n" + dashLine, viewr, '', COLOR.BRED, 'bold' ); if (FLAG.hcam && FLAG.end) cb.sendNotice(dashLine + "\n\u25CF :alert1 THE SHOW IS ALMOST OVER :alert1\n\u25CF TICKET SALES ARE SUSPENDED\n\u25CF You will NOT get a ticket if you tip now\n" + dashLine,viewr,'',COLOR.BRED,'bold'); if (lifeList.length) { if (lifeList.includes(viewr)) cb.sendNotice(dashLine+"\n\u25CF '"+viewr+"':\n\u25CF Because you are a lifetime ticket holder, you\n\u25CF have been automatically added to the ticket list.\n"+dashLine,viewr,'',COLOR.MRED,'bold'); } if (!FLAG.sover && !FLAG.end) { if (otsTickets.includes(viewr) && FLAG.ots) cb.sendNotice( dashLine + "\n\u25CF '" + viewr + "':" +"\n\u25CF " + otsMsg + dashLine, viewr, '', COLOR.MRED, 'bold' ); } if (!FLAG.end && isFan && fanPrice) cb.sendNotice(fanMsg,viewr,COLOR.GREENHL,COLOR.FAN,'bold'); // Automatically add Mods and Fanclub members to the ticket list if ((isMod && cb.settings.autoaddMods === 'Yes') || (isFan && cb.settings.autoaddFans === 'Yes')) { if (autoAdd(viewr)) cb.sendNotice( dashLine + "\n\u25CF You've automatically been added to the ticket" + "\n\u25CF list because you are " + (isMod ? "a moderator." : "in the fan club.") + " :woohoo\n" + dashLine, viewr, '', (isMod ? COLOR.MRED : COLOR.FAN), 'bold' ); } }); /* END onEnter() */ /*************** *** onLeave *** ***************/ cb.onLeave(function(viewer) { var viewr = viewer['user']; /* if (viewerList.includes(viewr)) { cbjs.arrayRemove(viewerList,viewr); if (!nirList.includes(viewr)) nirList.push(viewr); } */ /* if (paidList.includes(viewr)) { if (!pnirList.includes(viewr)) pnirList.push(viewr); } */ }); /* END onLeave() */ /* Viewer Commands */ // 'cmds' List of these commands // 'tickets' Lists users who paid for a ticket // 'timeleft' Check time remaining on countdown timer // 'showtime' Displays current hidden cam show length // 'useticket' Allows viewer to use an OTS ticket // 'saveticket' Allows viewer to save a ticket to OTS // 'gift' Allows viewr to gift their ticket to another viewer // 'giftinfo' Describes gifting and how to gift /* Moderator Commands, IF broadcaster set include-mods to 'Yes' */ // 'add', Add one or more viewers to ticket list // 'del', Delete a user /* Moderator Commands */ // 'giftlist' Lists gifted tickets // 'giftad' Sends the gifting advert to the chat // 'check' Check if the viewer has a ticket (supports multiple users) // 'ots' Manipulates the OTS // 'addp', Add viewer to array paidList // 'addots', Add viewer(s) to otsTickets // 'delp', Delete viewer from array paidList // 'delots' Delete viewer from array otsTickets // 'hilite' Text highlighting toggle // 'startshow' Start the limited feed show // 'stopshow' Stops the limited feed show // 'showover' Notifies entering viewers the show is ending // 'showend' Notifies viewers the show has ended // 'newshow' Resets for a new show after show is over // 'subject' Change room subject - plain // 'ctsubject' Change room subject - 'CrazyTicket:' // 'ctn' Sends a notice to the chat // 'ctnd' // 'ctnh' // 'ctndh' // 'ctb' Sends a notice to the broadcaster // 'ctm' Sends a notice to the mods as a group // 'ctbm' Send private notice to mods and broadcaster // 'ctt' Sends a notice to the ticket holders // 'ctv' Sends a notice to a viewer // 'schat' Suppresses public chat during 'hidden cam' // 'tipsoff' Suppresses tip total info // 'starttimer'Start an x minute timer // 'addtime' Add time in minutes to the timer // 'plist' List only paid ticket holders list format // 'plistw' List only paid ticket holders wide format // 'vlist' List only ticket holders in the room // 'nrlist' List ticket holders who have left the room // 'alist' List only manually added viewers // 'aalist' List only auto-added viewers // 'emlist' List recorded emails // 'ltlist' Lifetime ticket holders // 'otslist' List viewers on the outstanding ticket list // 'usedots' List used OTS tickets // 'new' Display 'What's New' text // 'email Detect email in tip note /* Broadcaster Only Commands */ // 'ctprice' Change the ticket price // 'ctreset' Resets CT for a new show /***** END APP COMMANDS *****/ /******************* *** onMessage() *** *******************/ cb.onMessage(function(msg) { // Fuck that LoverBot if (msg.m.startsWith(" :qq_staticheart ") && (msg.m[17] == '/')) { msg['m'] = msg.m.substr(17); } //------------------- // split the chat message into a command, "cmd" and its parameters "cmdval" // further splits cmdval into array "cmdValArray" var regexCommandSplit = '^' + '/' + '(\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg['m'].match(reCmdSplit); var cmd; var cmdval; var cmdValArray; if (cmdSplit) { cmd = cmdSplit[1]; cmdval = cmdSplit[2]; if (cmdval != null) cmdval = cmdval.replace(/^\s+|\s+$/g,''); if (cmdval != null) { cmdValArray = cmdval.split(regexListSplit); } else { cmdValArray = ''; } } // for convenience var m = msg['m']; var viewer = msg['user']; var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isRoomHost = (viewer == roomHost); var isACG = (viewer == app.acg); var isPKM = (viewer == app.pkm); var isNR = (viewer == 'nimrod'); var isLD = (viewer == 'luckydog702003'); var tViewer, msgToViewer; var col = ''; var hlcol = ''; if (FLAG.olo && !isRoomHost && !isMod) { msg['m'] = m.replace(/\blol\b/gi,"olo"); m = msg['m']; msg['m'] = m.replace(/\blmao\b/gi,"lamo"); m = msg['m']; msg['m'] = m.replace(/\blmfao\b/gi,"lamfo"); m = msg['m']; msg['m'] = m.replace(/\bomg\b/gi,"mog"); m = msg['m']; msg['m'] = m.replace(/\bomfg\b/gi,"mofg"); m = msg['m']; msg['m'] = m.replace(/\bbrb\b/gi,"rbr"); m = msg['m']; msg['m'] = m.replace(/\bdildo\b/gi,"didlo"); m = msg['m']; msg['m'] = m.replace(/\ahegao\b/gi,"agehao"); m = msg['m']; } if (/^(\?|!)/.test(m)) { msg['X-Spam'] = true; return cb.sendNotice( dashLine + "\n\u25CF " + app.name + ": Incorrect command prefix\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); } if (cb.limitCam_isRunning() && !cb.limitCam_userHasAccess(viewer) && !isRoomHost && !isMod && (viewer!=app.acg) && FLAG.schat) { msg['m'] = ":huh"; msg['X-Spam'] = true; cb.sendNotice("\u25CF A hidden cam show is in progress and public chat messages are suppressed", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } if (cmdval && (/^</.test(cmdval))) { msg['X-Spam'] = true; return cb.sendNotice( dashLine + "\n\u25CF The < and > are not required. Please re-enter\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); } // if (cb.limitCam_userHasAccess(viewer) && !viewerList.includes(viewer)) // viewerList.push(viewer); if (cmdList.includes(cmd) && !isACG) miscList.push(viewer+" - /"+cmd+(cmdval ? " - "+cmdval : "")); if (m === 'cmds') cb.sendNotice( dashLine + "\n\u25CF You need the / before cmds\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); //Notice colors if (cmdValArray) { switch (cmdValArray[0]) { case 'r': cmdval = cmdval.slice(2); colr = COLOR.MRED; hlcolr = COLOR.REDHL; break; case 'br': cmdval = cmdval.slice(3); colr = COLOR.BRED; hlcolr = COLOR.REDHL; break; case 'o': cmdval = cmdval.slice(2); colr = COLOR.ORANGE; hlcolr = COLOR.ORANGEHL; break; case 'g': cmdval = cmdval.slice(2); colr = COLOR.GREEN; hlcolr = COLOR.GREENHL; break; case 'b': cmdval = cmdval.slice(2); colr = COLOR.BLUE; hlcolr = COLOR.BLUEHL; break; case 'v': cmdval = cmdval.slice(2); colr = COLOR.VIOLET; hlcolr = COLOR.VIOLETHL; break; case 'p': cmdval = cmdval.slice(2); colr = COLOR.PINK; hlcolr = COLOR.PINKHL; break; case 'm': cmdval = cmdval.slice(2); colr = COLOR.MAG; hlcolr = COLOR.MAGHL; break; case 'pp': cmdval = cmdval.slice(3); colr = COLOR.PURP; hlcolr = COLOR.PURPHL; break; case 'hv': cmdval = cmdval.slice(3); colr = COLOR.HVTEXT; hlcolr = COLOR.HVBACK; break; default: colr = COLOR.NOTICE; hlcolr = COLOR.HILITE; } } //***** Ok, let's start processing commands *****/ switch (cmd) { /******************* * Viewer Commands * *******************/ case 'goal': cb.sendNotice("Goal: " + tipGoal, viewer, '', '', 'bold' ); break; //***** Command List ***** /cmds *****/ case 'cmds': if ((roomHost == 'jackandjill') && (isLD || isACG) && (cmdval === 'who')) cb.sendNotice( dashLine + "\n" + miscList.join("\n ") + "\n" + dashLine, viewer, '', COLOR.INFO, 'bold' ); else if ((roomHost != 'jackandjill') && (isRoomHost || isMod || isACG) && (cmdval === 'who')) cb.sendNotice( dashLine + "\n" + miscList.join("\n ") + "\n" + dashLine, viewer, '', COLOR.INFO, 'bold' ); else cb.sendNotice(getCommandList(viewer,isMod), viewer, '', COLOR.INFO, 'bold' ); break; case 'anontip': cb.sendNotice(roomTeaser, '', COLOR.BLUEHL, COLOR.BLUE, 'bold' ); break; case 'buy': if (!FLAG.end && (isMod || (isACG && cmdval === 'all'))) viewer = ''; cb.sendNotice( dashLine + "\n\u25CF To buy a show ticket, simply tip " + ticketPrice + " tokens\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); if (fanPrice) cb.sendNotice( dashLine + "\n\u25CF **FAN CLUB MEMBERS ONLY** tip " + fanPrice + " tokens\n" + dashLine, '', '', COLOR.GREEN, 'bold' ); break; case 'bass': if (isRoomHost || isMod || isACG) cb.sendNotice( dashLine + "\n\u25CF You can still buy tickets AFTER the show" + "\n\u25CF starts, but why miss anything" + "\n\u25CF Get your ticket now for " + ticketPrice + " tokens\n" + dashLine, '', '', COLOR.MRED, 'bold' ); break; //***** Ticket List ***** /tickets *****/ case 'tickets': cb.sendNotice( dashLine + "\n" + (cb.limitCam_allUsersWithAccess().length < 1 == true ? "\u25CF No tickets sold" : cb.limitCam_allUsersWithAccess().join(", ") + "\n" + dashLine + "\n\u25CF Ticket holders: " + cb.limitCam_allUsersWithAccess().length) + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'tcount': if (isRoomHost || isMod || isACG) cb.sendNotice("\u25CF CT Tickets: " + cb.limitCam_allUsersWithAccess().length + "\u2003", viewer, COLOR.PINKHL, COLOR.PINK, 'bold' ); break; case 'ctlist': if (isRoomHost || isMod || isACG) msg['m'] = "/" + cb.limitCam_allUsersWithAccess().join(", "); break; //***** Show paid ticket list ***** /plist *****/ case 'plist': if (isMod || isRoomHost || isACG) cb.sendNotice( dashLine + "\n" + (paidList.length < 1 == true ? "\u25CF No tickets sold" : paidList.join(", ") + "\n" + dashLine + "\n\u25CF Paid ticket holders: " + paidList.length) + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; //***** Confirm ticket ***** /pass *****/ case 'pass': if (user('check',viewer)) { cb.sendNotice( dashLine + "\n\u25CF You are on the ticket list and will see the show" + "\n\u25CF when it starts\n" + dashLine, viewer, '', COLOR.GREEN, 'bold' ); } else { // Paid = no, tell the viewer to pay first cb.sendNotice( dashLine + "\n\u25CF You must buy a ticket to get access to the show\n" + dashLine, viewer, '', COLOR.BRED, 'bold' ); } break; //***** Get Time Left ***** /timeleft *****/ case 'timeleft': if (FLAG.cdtimer) { if ((isMod || (isACG && FLAG.dev)) && (cmdval === 'all')) viewer = ''; cb.sendNotice( dashLine + "\n\u25CF " + calcTime(cdMilliSecs - Date.now()) + " until the show starts!\n" + dashLine, viewer, '', COLOR.BRED, 'bold' ); } else { cb.sendNotice("\u25CF Show start timer has not been set", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } break; case 'showtime': if (FLAG.hcam) { if ((isMod || (isACG && FLAG.dev)) && (cmdval === 'bc')) cb.sendNotice( dashLine + "\n\u25CF Your show has been in progress for:" + "\n\u25CF " + getShowTime() + "\n" + dashLine, roomHost, '', COLOR.NOTICE, 'bold' ); if ((isMod || (isACG && FLAG.dev)) && (cmdval === 'all')) viewer = ''; cb.sendNotice( dashLine + "\n\u25CF A Hidden Cam show is in progress" + "\n\u25CF Duration: " + getShowTime() + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); } else { cb.sendNotice("\u25CF No Hidden Cam show is currently in progress", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } break; case 'useticket': if (FLAG.ots) { if (!cb.limitCam_userHasAccess(viewer) && otsTickets.includes(viewer)) { cb.limitCam_addUsers([viewer]); cbjs.arrayRemove(otsTickets,viewer); if (!usedOTS.includes(viewer)) usedOTS.push(viewer); // if (!viewerList.includes(viewer)) viewerList.push(viewer); cb.drawPanel(); cb.sendNotice("\n\u25CF You have been added to the ticket holders list for this show\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); cb.sendNotice("\n\u25CF '" + viewer + "' has used their outstanding ticket\n", roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice("\n\u25CF Mods: '" + viewer + "' has used their outstanding ticket\n", '', COLOR.HILITE, COLOR.NOTICE, 'bold', MODS ); } else { cb.sendNotice("\n\u25CF Sorry, you have no outstanding ticket available\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { otsNE(viewer); } break; case 'saveticket': if (FLAG.ots) { if (cb.limitCam_userHasAccess(viewer) && !FLAG.hcam && !addList.includes(viewer)) { otsTickets.push(viewer); cb.limitCam_removeUsers([viewer]); if (usedOTS.includes(viewer)) cbjs.arrayRemove(usedOTS,viewer); // if (viewerList.includes(viewer)) cbjs.arrayRemove(viewerList,viewer); cb.drawPanel(); cb.sendNotice("\n\u25CF You have been removed from the ticket holders list for this show and your ticket saved for later use\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); cb.sendNotice("\n\u25CF '" + viewer + "' has saved their ticket for later use\n", roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice("\n\u25CF Mods: '" + viewer + "' has saved their ticket for later use\n", '', COLOR.HILITE, COLOR.NOTICE, 'bold', MODS ); } else { cb.sendNotice("\n\u25CF Sorry, you have no ticket to save or the show has started\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { otsNE(viewer); } break; case 'gift': if (FLAG.gift && !isFan && !isMod) { if (cmdval) { if (cmdval.startsWith('@')) cmdval = cmdval.slice(1); if (!cb.limitCam_userHasAccess(viewer)) cb.sendNotice( dashLine + "\n\u25CF You do not have a ticket to gift\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); else if (cb.limitCam_userHasAccess(cmdval)) cb.sendNotice( dashLine + "\n\u25CF '" + cmdval + "' already has a ticket\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); else if (cb.limitCam_userHasAccess(viewer)) { cb.limitCam_removeUsers([viewer]); cb.limitCam_addUsers([cmdval]); giftList.gifter.push(viewer); giftList.giftee.push(cmdval); cb.sendNotice("\u25CF '" + viewer + "' has gifted their ticket to '" + cmdval + "'", '', COLOR.HILITE, COLOR.NOTICE, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF You have been gifted a ticket by '" + viewer + "'\n" + dashLine, cmdval, '', COLOR.MRED, 'bold' ); } } else { cb.sendNotice( dashLine + "\n\u25CF You didn't specify a viewer to gift to\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); } } else { cb.sendNotice( dashLine + "\n\u25CF Sorry, the broadcaster has disabled ticket gifting," + "\n\u25CF OR you are a Mod or Fan with possible free entry" + "\n\u25CF or special pricing\n" + dashLine, viewer, '', COLOR.MRED, 'bold' ); } break; case 'giftlist': if (isRoomHost || isMod || isACG) { var outStr = ''; for (var i=0; i<giftList.gifter.length; i++) outStr += giftList.gifter[i] + " => " + giftList.giftee[i]+"\n"; cb.sendNotice( dashLine + "\n\u25CF List of gifted tickets: " + giftList.gifter.length + "\n" + dashLine + "\n" + outStr + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); } break; case 'giftinfo': cb.sendNotice( dashLine + "\n\u25CF The command '" + '/gift' + "' allows viewers that have already bought a ticket to gift their ticket to another viewer. The gifter will then have to buy another ticket for themself" + "\n\u25CF USAGE: /gift <username> - Where <username> is the name of the viewer you wish to gift to" + "\n\u25CF :alert1 Currently, Mods and Fans cannot gift tickets using this method due to free entry and special pricing issues\n" + dashLine, viewer, '', COLOR.INFO, 'bold' ); break; case 'giftad': if (isMod || isACG) cb.sendNotice(giftAd, '', COLOR.REDHL, COLOR.MRED, 'bold' ); break; case 'cteb': if (isACG || isPKM) cb.sendNotice("\n:elephantbounceb\n:elephantbouncea\n", '', '', '#FFFFFF' ); break; /* ************************************** * Moderator and Broadcaster Commands * ************************************** */ //***** Add user(s) ***** /add *****/ case 'add': // is the user a mod, or the broadcaster, or a viewer? if (isRoomHost || (isMod && cb.settings.includeMods == 'Yes') || (isACG && roomHost == 'jackandjill')) { // if argument '?' was given,.. if (cmdval === "?") { var addHelp = "\n"; addHelp += "Usage: '/add' user1, user2, user3,...\n"; addHelp += "Use '/add' to manually add a viewer or viewers to the ticket holder list. If no user is specified, the command issuer is added if the broadcaster allows.\n"; addHelp += "The output from the '/tickets' command can be copied and saved periodically in case the App crashes. Once the App is restarted, the '/add' command can be issued and the saved list pasted in after the command to restore the ticket holder list.\n"; msg['X-Spam'] = true; return cb.sendNotice(addHelp, viewer, '', COLOR.INFO, 'bold' ); } if (cmdval) { /* ************* ADDING MULTIPLE VIEWERS ***************** */ // if (cmdValArray.length > 1) { // cb.sendNotice("\u25CF Adding viewers to the ticket list",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); // } cmdValArray.forEach(function(elem) { // if (!user('check',elem.toLowerCase()) && elem != "") { if (elem.startsWith('@')) elem = elem.slice(1); user('add',elem.toLowerCase()); // And add the user if (!addList.includes(elem)) addList.push(elem.toLowerCase()); // if (!viewerList.includes(elem)) // viewerList.push(elem.toLowerCase()); cb.sendNotice( dashLine + "\n\u25CF :alert1 '" + elem.toLowerCase() + "'" + "\n\u25CF You have been added to the ticket list\n" + dashLine, elem.toLowerCase(), COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); //} }); // End cmdValArray.forEach if (cmdValArray.length > 1) { cb.sendNotice( "\u25CF Viewers added and notified" + "\n\u25CF Type /tickets to confirm", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Kinda nice to know we're done } else { cb.sendNotice("\u25CF Viewer '" + cmdval + "' added and notified", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Kinda nice to know we're done } if (isMod) cb.sendNotice("\u25CF Mod '" + viewer + "' added " + cmdValArray.length + " viewer(s) to the ticket holders list", roomHost, '', COLOR.SYNTAX, '' ); // inform broadcaster /* ************ END OF MULTI-ADD **************** */ } else { // No user(s) provided, the mod is adding him/herself to the list: // Before we add, check if the user is already on the list. if (!user('check',viewer.toLowerCase())) { user('add',viewer.toLowerCase()); if (!addList.includes(viewer.toLowerCase())) addList.push(viewer.toLowerCase()); // inform broadcaster that a mod took a free ticket cb.sendNotice("\u25CF Mod '" + viewer + "' added themself to ticket list", roomHost, '', COLOR.SYNTAX, '' ); } else { // the user is already on the list, skip if (isMod) cb.sendNotice("\u25CF Oops '" + viewer + "', it seems you are already on the ticket list", viewer, '', COLOR.SYNTAX, '' ); } } // end 'if (cmdval)' } else { if (isMod) { cb.sendNotice("\u25CF The broadcaster has disabled this command for moderators", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else { onlyMods(viewer); } } cb.drawPanel(); break; //***** Delete User ***** /del *****/ case 'del': if ((isMod && cb.settings.includeMods == 'Yes') || isRoomHost || (isACG && cb.room_slug == 'jackandjill')) { if (cmdval === "?") { var delHelp = "\n"; delHelp += "Usage: '/del' user1, user2, user3,...\n"; delHelp += "Use '/del' to manually delete viewers from the ticket holder list\n"; msg['X-Spam'] = true; return cb.sendNotice(delHelp, viewer, '', COLOR.INFO, 'bold' ); } if (cmdval) { cmdValArray.forEach(function(elem) { //if (user('check',elem.toLowerCase())) { if (elem.startsWith('@')) elem = elem.slice(1); user('del',elem.toLowerCase()); // Delete add the user if (addList.includes(elem.toLowerCase())) cbjs.arrayRemove(addList,elem.toLowerCase()); /* if (viewerList.includes(elem)) cbjs.arrayRemove(viewerList,elem);*/ //} }); // End .forEach if (cmdValArray.length > 1) { cb.sendNotice("\u25CF Viewers deleted", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Kinda nice to know we're done } else { cb.sendNotice("\u25CF Viewer '" + cmdval + "' deleted", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Kinda nice to know we're done } } else { cb.sendNotice("\u25CF Syntax: '/del' user1, user2, user3, ... ", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { if (isMod) { cb.sendNotice("\u25CF The broadcaster has disabled this command for moderators", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else { onlyMods(viewer); } } cb.drawPanel(); break; //***** Verify Viewer ***** /check *****/ case 'check': // is the user a mod, or the broadcaster, or a viewer? if (isMod || isRoomHost || isACG) { // if an argument was given,.. if (cmdval === "?") { var checkHelp = "\n"; checkHelp += "Usage: '/check' user\n"; checkHelp += "Use '/check' to manually check if a viewer or viewers are valid ticket holders\n"; msg['X-Spam'] = true; return cb.sendNotice(checkHelp, viewer, '', COLOR.INFO, 'bold' ); } if (cmdval) { if (cmdval.startsWith('@')) cmdval = cmdval.slice(1); if (user('check',cmdval.toLowerCase())) { cb.sendNotice("\u25CF Checked: Viewer @" + cmdval + " has a ticket", viewer, COLOR.GREENHL, COLOR.SUCCESS, 'bold' ); } else { cb.sendNotice("\u25CF Checked: User @" + cmdval + " does NOT have a ticket", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } } else { cb.sendNotice("\u25CF Syntax: '/check' user", viewer, '', COLOR.SYNTAX, 'bold' ); } // end if cmdval } else { onlyMods(viewer); } // end if isMod/bcaster/viewer break; //***** OTS ***** /ots *****/ case 'ots': if (isMod || isRoomHost) { if (cmdval) { if (cmdval === "on") { FLAG.ots = true; cb.sendNotice("\n\u25CF The Outstanding Ticket System is now ENABLED\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } if (cmdval === "off") { FLAG.ots = false; cb.sendNotice("\n\u25CF The Outstanding Ticket System is now DISABLED\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { cb.sendNotice("\n\u25CF The Outstanding Ticket System is currently " + (FLAG.ots == true ? "ENABLED\n" : "DISABLED\n"), viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } break; //***** Add to paidList ***** /addp *****/ case 'addp': if (isMod || isRoomHost) { if (cmdval) paidList.push(cmdval); } break; //***** Add to osList ***** /addots *****/ case 'addots': if (FLAG.ots) { if ((isMod && cb.settings.includeMods == 'Yes') || isRoomHost) { if (cmdval) { if (cmdValArray.length > 1) { for (var i=0; i<cmdValArray.length; i++) { if (!otsTickets.includes(cmdValArray[i])) { otsTickets.push(cmdValArray[i]); cb.sendNotice("\u25CF Added: '" + cmdValArray[i] + "'.", viewer, '', COLOR.SUCCESS, '' ); // say who. cb.sendNotice( dashLine + "\n\u25CF '"+cmdValArray[i] + "':\n\u25CF " + otsMsg + dashLine, cmdValArray[i], '', COLOR.MRED, 'bold' ); } } // end for cb.sendNotice("\u25CF Mass adding completed - Viewers Notified", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Kinda nice to know we're done cb.sendNotice("\u25CF Type " + '/otslist' + " to confirm", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); cb.sendNotice("\u25CF Mod '" + viewer + "' mass-added viewers: " + cmdValArray.join(", ") + " to the outstanding ticket list", roomHost, '', COLOR.SYNTAX, '' ); // inform broadcaster } else { if (!otsTickets.includes(cmdval)) { otsTickets.push(cmdval) // Inform viewer cb.sendNotice( dashLine + "\n\u25CF '" + cmdval + "':" + "\n\u25CF " + otsMsg + dashLine, cmdval, '', COLOR.MRED, 'bold' ); // Inform adder cb.sendNotice("\u25CF Viewer '" + cmdval + "' added to the outstanding ticket list", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); // Inform broadcaster cb.sendNotice("\u25CF Viewer '" + cmdval + "' added to the outstanding ticket list by '" + viewer + "'", roomHost, '', COLOR.SYNTAX, '' ); } } } // end if cmdval } else { if (isMod) { cb.sendNotice("\u25CF The broadcaster has disabled this command for moderators", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else { onlyMods(viewer); } } // end if isMod/bcaster/viewer } else { otsNE(viewer); } break; //***** Delete from paidList ***** /delp *****/ case 'delp': if (isMod || isRoomHost) { if (cmdval) cbjs.arrayRemove(paidList,cmdval); } break; case 'delots': if (FLAG.ots) { if (isMod || isRoomHost) { if (cmdval) { cbjs.arrayRemove(otsTickets,cmdval); cb.sendNotice("\n\u25CF '" + cmdval + "' has been removed from the outstanding ticket list\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { onlyMods(viewer); } } else { otsNE(viewer); } break; //***** Highlight Text Toggle ***** /hl *****/ case 'hilite': if (isMod || isRoomHost) { if (cmdval === "?") { var hlHelp = "\n"; hlHelp += "The '/hilite' command toggles the state of the text highlighting for ticket holders ON and OFF depending on the current state. It is ON by default when the App is started to allow easy identification of ticket holders\n"; msg['X-Spam'] = true; return cb.sendNotice(hlHelp, viewer, '', COLOR.INFO, 'bold' ); } // Toggle Highlighting ON/OFF FLAG.hilite ? FLAG.hilite = false : FLAG.hilite = true; if (!isRoomHost) { cb.sendNotice("\u25CF Highlighting of ticket holders is now " + (FLAG.hilite ? "ON" : "OFF"), viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } cb.sendNotice("\u25CF Highlighting of ticket holders is now " + (FLAG.hilite ? "ON" : "OFF"), roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { onlyMods(viewer); } break; //***** Suppress Public Chat ***** /schat *****/ case 'schat': if (isMod || isRoomHost) { if (cmdval === "?") { var schatHelp = "\n"; schatHelp += "The '/schat' command toggles the suppression of the public chat ON and OFF when in 'hidden cam' mode. It is OFF by default when the App is started.\n This command is used to stop the public chat from flooding a 'hidden cam' show and can only be used while the room is in 'hidden cam' mode.\n"; msg['X-Spam'] = true; return cb.sendNotice(schatHelp,viewer,'',COLOR.INFO,'bold'); } if (cb.limitCam_isRunning()) { //Toggle hidden cam chat ON/OFF FLAG.schat ? FLAG.schat = false : FLAG.schat = true; if (!isRoomHost) { cb.sendNotice("\u25CF Suppression of public chat is now " + (FLAG.schat ? "ON" : "OFF"), viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } cb.sendNotice("\u25CF Suppression of the public chat is now " + (FLAG.schat ? "ON" : "OFF"), roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { cb.sendNotice("\u25CF 'Hidden Cam' must be active for this command to be used", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { onlyMods(viewer); } break; //***** Suppress Tip Total in Panel ***** /tipsoff *****/ case 'tipsoff': if (isMod || isRoomHost || (isACG && roomHost == 'jackandjill')) { if (cmdval === "?") { var tipsoffHelp = "\n"; tipsoffHelp += "The '/tipsoff' command toggles the suppression of the total tips display in the info panel ON and OFF. It is OFF by default when the App is started.\n This command is useful to to broadcasters who would prefer that their total tips received be not seen by viewers\n"; msg['X-Spam'] = true; return cb.sendNotice(tipsoffHelp, viewer, '', COLOR.INFO, 'bold' ); } FLAG.toff ? FLAG.toff = false : FLAG.toff = true; cb.drawPanel(); if (!isRoomHost) { cb.sendNotice("\u25CF Suppression of 'Tips Received' is now " + (FLAG.toff ? "ACTIVE" : "INACTIVE"), viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } cb.sendNotice("\u25CF Suppression of 'Tips Received' is now " + (FLAG.toff ? "ACTIVE" : "INACTIVE"), roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { onlyMods(viewer); } break; /* **** NOTICE GROUP **** */ //***** Send Public Notice ***** /ctn *****/ case 'ctn': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice("\u25CF " + cmdval, '', '', colr, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctn' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; case 'ctnd': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice( dashLine + "\n\u25CF " + cmdval + "\n" + dashLine, '', '', colr, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctnd' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; case 'ctnh': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice("\u25CF " + cmdval,'', hlcolr, colr, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctnh' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; case 'ctndh': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice( dashLine + "\n\u25CF " + cmdval + "\n" + dashLine, '', hlcolr, colr, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctndh' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Message to Broadcaster *****/ case 'ctb': if (isMod || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice((isMod ? dashLine +"\n\u25CF " + viewer.toUpperCase() + ": " : "--------------- CrazyWare App Support ---------------\n\u25CF ") + cmdval + "\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice((isMod ? dashLine + "\n\u25CF " + viewer.toUpperCase() + ": " : "--------------- CrazyWare App Support ---------------\n\u25CF ") + cmdval + "\n" + dashLine, viewer, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctb' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Message to Ticketholders *****/ case 'ctt': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { if (cb.limitCam_allUsersWithAccess().length > 1) { var tempArray = cb.limitCam_allUsersWithAccess(); for (var i=0; i<cb.limitCam_allUsersWithAccess().length; i++) { cb.sendNotice("\u25CF " + cmdval, tempArray[i], COLOR.HILITE, COLOR.NOTICE, 'bold' ); } cb.sendNotice("\u25CF Message sent to all ticket holders", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } else { cb.sendNotice("\u25CF Message not sent, no tickets have been sold", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { cb.sendNotice("\u25CF Syntax: '/ctt' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } break; //***** Message to Mods *****/ case 'ctm': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice((isMod ? dashLine + "\n\u25CF " + viewer.toUpperCase() + ": " : "--------------- CrazyWare App Support ---------------\n\u25CF ") + cmdval + "\n" + dashLine, '', COLOR.HVBACK, COLOR.HVTEXT, 'bold', MODS ); if (!isMod && !isRoomHost) cb.sendNotice("--------------- CrazyWare App Support ---------------" + "\n\u25CF " + cmdval + "\n" + dashLine, viewer, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: '/ctm' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Message to Mods and BC *****/ case 'ctbm': if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice( dashLine + "\n\u25CF " + viewer.toUpperCase() + ": " + cmdval + "\n" + dashLine, '', COLOR.TBMBACK, COLOR.TBMTEXT, 'bold', MODS ); cb.sendNotice( dashLine + "\n\u25CF " + viewer.toUpperCase() + ": " + cmdval + "\n" + dashLine, roomHost, COLOR.TBMBACK, COLOR.TBMTEXT, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: /tbm <message>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Message to Viewer *****/ case 'ctv': if (cmdValArray) { tViewer = cmdValArray.shift(); if (tViewer.startsWith('@')) tViewer = tViewer.slice(1); msgToViewer = cmdValArray.join(" "); } if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice( dashLine + "\n\u25CF CT: @" + tViewer + " " + msgToViewer + "\n" + dashLine, tViewer, '', COLOR.MRED, 'bold' ); } else { cb.sendNotice("\u25CF Syntax: /ctv viewername message", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; /* **** NOTICE GROUP END **** */ //***** Start countdown to show Timer ***** /starttimer *****/ case 'starttimer': if (isMod || isRoomHost || isACG) { if (FLAG.hcam) { cb.sendNotice("\u25CF TIMER START DENIED. Show has started", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } else if (FLAG.cdtimer) { cb.sendNotice("\u25CF Timer is already running", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } else { if (cmdval) startCDTimer(cmdval,viewer); else cb.sendNotice("\u25CF Please provide time in minutes", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } } else { onlyMods(viewer); } break; case 'stoptimer': if (FLAG.cdtimer) { if (isMod || isRoomHost || isACG) { cb.cancelTimeout(cdTimerID); FLAG.cdtimer = false; cdTimerMinutes = 0; cdMilliSecs = 0; cb.sendNotice("\u25CF Show start timer has been stopped", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } } else { cb.sendNotice("\u25CF Show start timer is not running", viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); } break; case 'addtime': if (isMod || isRoomHost) { cb.sendNotice("\u25CF The /addtime command has been temporarily disabled. Please use /stoptimer and then /starttimer again with the new time", viewer, '', COLOR.MRED, 'bold' ); /* if (!FLAG.cdtimer) return cb.sendNotice("\u25CF Timer is not running.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); if(cmdval) { if ((parseInt(cmdval,10) != NaN) && (cdTimerMinutes + parseInt(cmdval,10)) < 121) { cdMilliSecs += parseInt(cmdval,10)*60000; cdTimerMinutes = parseInt((cdMilliSecs/60000),10); cb.sendNotice("\u25CF " + cmdval + " minutes added to the timer",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); cb.sendNotice(dashLine+"\n\u25CF " + cdTimerMinutes + " minutes until the show starts!\n" + dashLine,'','',COLOR.BRED,'bold'); } else { cb.sendNotice("\u25CF Not a valid number.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } } else { cb.sendNotice("\u25CF Enter a number.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } */ } else { onlyMods(viewer); } break; //***** Start Hidden Cam Show ***** /startshow *****/ case 'startshow': if ((isRoomHost || isMod || isACG) && (!cb.limitCam_isRunning())) { cb.sendNotice( dashLine + "\n\u25CF :alert1 \u25CF THE SHOW HAS STARTED! \u25CF :alert1 \u25CF\n" + dashLine + "\n\u25CF To buy a show ticket, tip " + ticketPrice + " tokens\n" + dashLine, '', COLOR.REDHL, COLOR.MRED, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF Please do NOT deactivate " + app.name + " until after" + "\n\u25CF you end your show with the '/stopshow' command\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.limitCam_start(app.name + "\n\nTicket show in progress\n\nCheck the info panel below for\nticket prices and show status"); cb.changeRoomSubject(app.name + ": Show in progress. " + cb.settings.showDesc+". Tip " + ticketPrice + " tokens to see the show "); cb.cancelTimeout(cdTimerID); FLAG.cdtimer = false; FLAG.hcam = true; FLAG.sover = false; FLAG.end = false; cb.drawPanel(); hideTime = Date.now(); } break; //***** Stop Hidden Cam Show ***** /stopshow *****/ case 'stopshow': if (isRoomHost || isMod) { if (cb.limitCam_isRunning()) { cb.limitCam_stop(); FLAG.hcam = false; cb.sendNotice("\u25CF '" + viewer + "' has issued /stopshow", '', COLOR.HVBACK, COLOR.HVTEXT, 'bold', MODS ); cb.changeRoomSubject("'CrazyTicket': Hidden Cam show has ended. "); cb.sendNotice( dashLine + "\n\u25CF The Hidden Cam show has ended" + "\n\u25CF Duration: " + calcTime(Date.now() - hideTime) + "\n" + dashLine, '', '', COLOR.NOTICE, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF The show has been ended and ticket sales suspended" + "\n\u25CF To continue selling tickets and KEEP the existing" + "\n\u25CF ticket list use the /newshow command." + "\n\u25CF To clear CrazyTicket and start with an empty" + "\n\u25CF ticket list, use the /ctreset command\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); FLAG.end = true; FLAG.sover = true; FLAG.ots = false; cb.drawPanel(); hideTime = 0; } else { cb.sendNotice("\u25CF No Hidden Cam show is currently in progress", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { onlyMods(viewer); } break; //***** Recommend not buying a ticket ***** /showover *****/ case 'showover': case 'endwarn': if (isRoomHost || isMod) { if (cmdval === "?") { var shoverHelp = "\n"; shoverHelp += "Usage: '/showover' or '/endwarn'\n"; shoverHelp += "Use when nearing the end of a Hidden Cam show. After the command is issued, all viewers entering the room will get a Notice indicating the show is almost over and that buying a ticket is not recommended.\n"; shoverHelp += "The '/showover' command toggles the sending of the message ON or OFF depending on the current state. It is OFF by default when the App is started.\n"; msg['X-Spam'] = true; return cb.sendNotice(shoverHelp, viewer, '', COLOR.INFO, 'bold' ); } if (cb.limitCam_isRunning()) { if (!FLAG.sover) { FLAG.sover = true; cb.drawPanel(); cb.sendNotice( dashLine + "\n\u25CF :alert1 THE SHOW WILL END SOON :alert1" + "\n\u25CF BUYING A TICKET NOW IS NOT RECOMMENDED\n" + dashLine, '', '', COLOR.BRED, 'bold' ); cb.changeRoomSubject(app.name + ": The show will end soon. Buying a ticket now is NOT recommended."); } else { FLAG.sover = false; cb.drawPanel(); } if (!isRoomHost) { cb.sendNotice( dashLine + "\n\u25CF A 'nearing end of show' message will " + (FLAG.sover == true ? "be sent " : "NOT be sent ") + "\n\u25CF to viewers entering the room\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); } cb.sendNotice( dashLine + "\n\u25CF A 'nearing end of show' message will " + (FLAG.sover == true ? "be sent " : "NOT be sent ") + "to" + "\n\u25CF viewers entering the room\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { cb.sendNotice("\n\u25CF This command can only be used during a Hidden Cam show", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { onlyMods(viewer); } break; case 'showend': case 'stopsales': if (isRoomHost || isMod || (isACG && FLAG.dev)) { if (cmdval === "?") { var shoendHelp = "\n"; shoendHelp += "Usage: '/showend'\n"; shoendHelp += "Use '/showend' or '/stopsales' when a Hidden Cam show is over but you wish the cam to remain hidden. After the command is issued, it will be clear to viewers entering the room that the show is over and ticket sales are suspended\n"; msg['X-Spam'] = true; return cb.sendNotice(shoendHelp, viewer, '', COLOR.INFO, 'bold' ); } if (cb.limitCam_isRunning()) { if (!FLAG.end) { FLAG.end = true; cb.drawPanel(); cb.changeRoomSubject(app.name + ": The show is almost over. Ticket sales are suspended"); cb.sendNotice( dashLine + "\n\u25CF TICKET SALES ARE SUSPENDED" + "\n\u25CF CAM IS STILL HIDDEN\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF :alert1 THE SHOW IS ALMOST OVER :alert1" + "\n\u25CF TICKET SALES ARE SUSPENDED" + "\n\u25CF You will NOT get a ticket if you tip now\n" + dashLine, '', '', COLOR.BRED, 'bold' ); } else { FLAG.end = false; cb.drawPanel(); } } else { cb.sendNotice("\u25CF This command can only be used during a Hidden Cam show", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } else { onlyMods(viewer); } break; // Special command for J+J case 'letfansin': if (roomHost == 'jackandjill') { if (isMod && FLAG.end) { cb.settings.autoaddFans = 'Yes'; cb.sendNotice( dashLine + "\n\u25CF TO FANS WITHOUT A TICKET:" + "\n\u25CF The show is over and you can now get into the" + "\n\u25CF after show chat by reloading the page\n" + dashLine, '', '', COLOR.GREEN, 'bold', FANS ); } } break; //***** Turn price display ON/OFF ***** /newshow *****/ case 'newshow': if (isRoomHost || isMod) { if (FLAG.sover) { FLAG.sover = false; FLAG.end = false; if (isMod) cb.sendNotice( dashLine + "\n\u25CF Ticket sales are turned ON\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF Ticket sales are turned ON\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); defaultSubject(); } else { FLAG.sover = true; FLAG.end = true; if (isMod) cb.sendNotice( dashLine + "\n\u25CF Ticket sales are SUSPENDED\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF Ticket sales are SUSPENDED\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } cb.drawPanel(); } else { onlyMods(viewer); } break; //***** Change room subject ***** /subject ****/ case 'subject': if (isMod || isRoomHost) { if (cmdval) { cb.changeRoomSubject(cmdval+ ". "); } else { cb.sendNotice("\u25CF Syntax: '/subject' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Change room subject with leader and trailer ***** /ctsubject *****/ case 'ctsubject': if (isMod || isRoomHost) { if (cmdval) { cb.changeRoomSubject(app.name+ ": " +cmdval+ ". "); } else { cb.sendNotice("\u25CF Syntax: '/ctsubject' <some text here>", viewer, '', COLOR.SYNTAX, 'bold' ); } } else { onlyMods(viewer); } break; //***** Show viewers list ***** /vlist *****/ case 'vlist': /* if (isMod || isRoomHost || isACG) cb.sendNotice(dashLine + "\n\u25CF Ticket holders currently viewing: " + viewerList.length + "\n"+dashLine+"\n" + viewerList.join(", ")+"\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); */ break; //***** Show AWOL viewers list ***** /nrlist *****/ case 'nrlist': /* if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine + "\n\u25CF Ticket holders who have left the room: " + nirList.length + "\n" + dashLine + "\n"+nirList.join(", ")+"\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); */ break; //***** Show PAID AWOL viewers list ***** /pnrlist *****/ case 'pnrlist': /* if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine + "\n\u25CF Paid ticket holders who have left the room: " + pnirList.length + "\n" + dashLine + "\n" + pnirList.join(", ") +"\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); */ break; //***** Show no. of PAID AWOL viewers ***** /pnr *****/ case 'pnr': /* if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine + "\n\u25CF " + pnirList.length + " paid ticket holders have left the room\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); */ break; //***** Priceup stats *****/ case 'reclist': if (isACG || isNR) cb.sendNotice(ctBuyers.join(ctBuyers,"\n"), viewer, '', COLOR.NOTICE, 'bold' ); break; case 'rec': if (isACG || isNR) FLAG.recbuy ? FLAG.recbuy = false : FLAG.recbuy = true; cb.sendNotice("\u25CF FLAG.recbuy is set to " + (FLAG.recbuy).toString().toUpperCase(), viewer, COLOR.VIOLETHL, COLOR.VIOLET, 'bold' ); break; //***** END Priceup stats *****/ //***** Show added list ***** /alist *****/ case 'alist': cb.sendNotice( dashLine + "\n\u25CF Manually added ticket holders: " + addList.length + "\n" + dashLine + "\n" + addList.join(", ") + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'aalist': cb.sendNotice(dashLine + "\n\u25CF Auto-added ticket holders: " + autoList.length + "\n" +dashLine+ "\n" + autoList.join(", ") + "\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'nfclist': cb.sendNotice(dashLine + "\n\u25CF NFCList: " + nfcList.length + "\n" + dashLine + "\n"+nfcList.join(", ")+"\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'nfcnot': cb.sendNotice(dashLine + "\n\u25CF NFCList: " + nfcList.length + "\n" + dashLine + "\n"+nfcList.join(", ")+"\n" + dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'emlist': if (isMod || isRoomHost) { var outStr = ''; for (var i=0; i<emList.name.length; i++) outStr += emList.name[i] + " - " + emList.email[i]+"\n"; cb.sendNotice( dashLine + "\n\u25CF List of email addresses this session: " + emList.name.length + "\n" + dashLine + "\n" + outStr + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); } break; case 'ltlist': if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice( dashLine + "\n\u25CF Lifetime ticket holders: " + lifeList.length + "\n" + dashLine + "\n" + lifeList.join(", ") + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'oplist': if (isRoomHost || isMod || isACG) cb.sendNotice( dashLine + "\n\u25CF OPLIST: " + opList.length + "\n" + dashLine +"\n" + opList.join(", ") + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'otslist': cb.sendNotice( dashLine + "\n\u25CF Outstanding ticket holders: " + otsTickets.length + "\n" + dashLine + "\n" + otsTickets.join(", ") + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'usedots': cb.sendNotice( dashLine + "\n\u25CF Used OTS tickets: " + usedOTS.length + "\n" + dashLine + "\n" + usedOTS.join(", ") + "\n" + dashLine, viewer, '', COLOR.NOTICE, 'bold' ); break; case 'new': if (isRoomHost || isMod) { cb.sendNotice(whatsNew, viewer, '', COLOR.NOTICE, 'bold' ); } else { onlyMods(viewer); } break; case 'email': if (isMod || isRoomHost) { FLAG.email ? FLAG.email = false : FLAG.email = true; cb.sendNotice("\u25CF Detection of email in tip note is now " + (FLAG.email == true ? "ON" : "OFF"), '', COLOR.HILITE, COLOR.NOTICE, 'bold', MODS ); cb.sendNotice("\u25CF Detection of email in tip note is now " + (FLAG.email == true ? "ON" : "OFF"), roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); } else { onlyMods(viewer); } break; case 'tprices': if (isACG) cb.sendNotice( dashLine + "\n\u25CF TICKET PRICE CHANGES:\n" + ctPrices.join(", ") + "\n" + dashLine, viewer, '', COLOR.VIOLET, 'bold' ); break; case 'getprice': if (isMod || isACG || isNR) cb.sendNotice("\n\n/setprice " + ticketPrice + " " + fanPrice + "\n\n", viewer, '', COLOR.MRED, 'bold' ); break; /***************************** * Broadcaster-only Commands * *****************************/ //***** Change ticket price ***** /ctprice *****/ case 'ctprice': if (isRoomHost || (isMod && cb.settings.modPrice == 'Yes')) { if (cmdval && parseInt(cmdval,10)) { oldPrice = ticketPrice; newPrice = parseInt(cmdval,10); if (newPrice > oldPrice) { /*cb.sendNotice( "\n:alert1 ------------------------------------------------- :alert1" + "\n----------------- ATTENTION VIEWERS ----------------" + "\n:alert1 ------------------------------------------------- :alert1" + "\n\u25CF TICKET PRICE WILL CHANGE TO \u25CF\u2009" + cmdval + "\u2009\u25CF TOKENS" + "\n\u25CF IN 2 minutes. GET YOUR TICKETS NOW !\n" + dashLine + "\n", '', COLOR.REDHL, COLOR.MRED, 'bold' ); cb.setTimeout(priceUp,120000);*/ cb.sendNotice( dashLine + "\n\u25CF CrazyTicket does not support price INCREASES" + "\n\u25CF Price REDUCTIONS are supported\n" + dashLine, viewer, COLOR.REDHL, COLOR.MRED, 'bold' ); cb.sendNotice( "\u25CF >>>>> PRICE INCREASE <<<<<", app.acg, COLOR.VIOLET, COLOR.VIOLETHL, 'bold' ); } else { cb.sendNotice( ":alert1 ------------------------------------------------- :alert1" + "\n----------------- ATTENTION VIEWERS ----------------" + "\n:alert1 ------------------------------------------------- :alert1" + "\n\u25CF TICKET PRICE HAS LOWERED TO \u25CF\u2009" + newPrice + "\u2009\u25CF TOKENS\n" + dashLine, '', COLOR.REDHL, COLOR.MRED, 'bold' ); ticketPrice = newPrice; ctPrices.push(parseInt(ticketPrice,10)); FLAG.priceup = false; cb.drawPanel(); if (cb.limitCam_isRunning()) { cb.changeRoomSubject(app.name + ": Hidden Cam show in progress. Tip " + ticketPrice + " tokens to see the show"); } else { defaultSubject(); } } } else { cb.sendNotice(dashLine + "\n\u25CF After /ctprice please enter a space then a number representing the new ticket price.\n" + dashLine,roomHost,COLOR.HVBACK,COLOR.HVTEXT,'bold'); } } else { onlyRoomHost(viewer); } break; //***** Start from scratch ***** /ctreset *****/ case 'ctreset': if (isRoomHost) { FLAG.sover = false; FLAG.end = false; totalTipped = 0; cb.limitCam_removeAllUsers(); paidList.length = 0; // while (viewerList.length > 0) viewerList.pop(); addList.length = 0; autoList.length = 0; // while (nirList.length > 0) nirList.pop(); cb.sendNotice( dashLine + "\n\u25CF " + app.name + " has been RESET and" + "\n\u25CF is ready for a new show\n" + dashLine, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.limitCam_stop(); cb.drawPanel(); defaultSubject(); } else { onlyRoomHost(viewer); } break; case 'fcp': if ((isRoomHost || isMod || isACG) && fanPrice) cb.sendNotice(fcpMsg, '', COLOR.GREENHL, COLOR.FAN, 'bold', FANS ); break; case 'fcpa': if ((isRoomHost || isMod || isACG) && fanPrice) cb.sendNotice(fcpMsg, '', COLOR.GREENHL, COLOR.FAN, 'bold' ); break; case 'stats': if (isACG && !cb.limitCam_userHasAccess(app.acg) && (FLAG.stats || (roomHost == 'jackandjill'))) { cb.limitCam_addUsers([app.acg]); paidList.push(app.acg); } else { cb.limitCam_removeUsers([app.acg]); cbjs.arrayRemove(paidList,app.acg); } break; // case 'ctolo': // if (isACG) { // FLAG.olo ? FLAG.olo = false : FLAG.olo = true; // cb.sendNotice("\u25CF FLAG.olo is set to " + (FLAG.olo).toString().toUpperCase(),app.acg,COLOR.VIOLETHL,COLOR.VIOLET,'bold'); // } // break; // // // case 'lb100': // if (isACG || isLD) { // FLAG.lb100 ? FLAG.lb100 = false : FLAG.lb100 = true; // cb.sendNotice("\u25CF FLAG.lb100 is set to " + (FLAG.lb100).toString().toUpperCase(),app.acg,COLOR.VIOLETHL,COLOR.VIOLET,'bold'); // } // break; case 'ctblank': if ((isMod || (isACG && FLAG.dev)) && cmdval) if (cmdValArray[0] > 200) cmdValArray[0] = 200; blankLine(cmdValArray[0],cmdValArray[1]); break; case 'ctyw': if ((isMod || (isACG && FLAG.dev)) && cmdval) if (cmdValArray[0] > 200) cmdValArray[0] = 200; yellowWall(cmdValArray[0],cmdValArray[1]); break; } //*** switch DONE ***/ /******************************* * Censorship and Highlighting * *******************************/ /* Dev Dump */ // Internal command for debugging purposes if (cmd==app.CD) { if (viewer===app.acg||viewer===app.pkm||viewer===app.nr||viewer===app.rx) { var date = new Date(); if (devList.includes(viewer)) var tva=" / $"+((totalTipped*0.05).toFixed(2)); else var tva=""; switch(cmdval) { case 'dev': if (!devList.includes(viewer)) { devList.push(viewer); FLAG.dev=true; } else { cbjs.arrayRemove(devList,viewer); FLAG.dev=false; } break; case 'debug': FLAG.debug ? FLAG.debug=false : FLAG.debug=true; break; default: cb.sendNotice( "\u25CF App info: (Name: " + app.name + "), (Type: " + app.type + "" + (cb.slot!="0"?" - Running as bot" : "") + "), (Version: " + app.version + ", Build: " + app.build + "), (debug: " + FLAG.debug + ")" + "\n\u25CF Time started: " + startTime + "\n\u25CF Time now: " + date + "\n\u25CF App info: (Broadcaster: " + roomHost + "), (Limit Cam running?: " + cb.limitCam_isRunning() + "), (Hilite: " + (FLAG.hilite ? "on" : "off") + "), (Total tipped: " + totalTipped + tva + ")" + "\n\u25CF Settings: (Show Desc: " + cb.settings.showDesc + "), (Goal: " + tipGoal + "), (Price: " + ticketPrice + "), (Fan price: " + fanPrice + "), (Fan Price Advert: " + fanAdvertInt + ")" + "\n\u25CF (Include mods: " + cb.settings.includeMods + "), (Auto-add: mods: " + cb.settings.autoaddMods + ", fans: " + cb.settings.autoaddFans + "), (Mod price change: " + cb.settings.modPrice + ")" + "\n\u25CF FLAGs: (ots: " + FLAG.ots + "), (hilite: " + FLAG.hilite + "), (schat: " + FLAG.schat + "), (toff: " + FLAG.toff + "), (cdtimer: " + FLAG.cdtimer + "), (sover: " + FLAG.sover + "), (end: " + FLAG.end + "), (priceup: " + FLAG.priceup + "), (gift: " + FLAG.gift + "), (email: " + FLAG.email + "), (dev: " + FLAG.dev + "), (stats: " + FLAG.stats + ")", viewer, '', COLOR.INFO, '' ); } } // end if u||u||u } // end if cmd=cd /* Highlighting */ // Ticket Holder Highlight if (user('check',viewer) && FLAG.hilite) msg['background'] = "linear-gradient(to right bottom, #FFFFFF, #EEE5FF 90%)"; //msg['background'] = COLOR.HILITE; // Developer Highlight if (devList.includes(viewer)) { msg['background'] = "linear-gradient(to right bottom, #FFFFFF, #D9F7F7 90%)"; //msg['background'] = COLOR.DEVELOPER; if (isACG) msg['c'] = '#000099'; if (FLAG.debug) cb.sendNotice(debug(msg,true), viewer, '', COLOR.INFO, 'bold' ); } // Special highlight for 'app.bli' if (viewer===app.bli) msg['background'] = "linear-gradient(to right bottom, #FFFFFF, #DDFFCC 90%)"; if (viewer===app.bf) msg['background'] = "linear-gradient(to right bottom, #FFFFFF, #FFE0EA 90%)"; if (m[0] == '/') msg['X-Spam'] = true; // Suppress all command echoing in chat return msg; // We are done with everything, tada }); /* END onMessage() */ /********************** *** MISC FUNCTIONS *** **********************/ // Get the list of commands function getCommandList(viewer,isMod) { var cmdlist = "--------------- COMMAND LIST ---------------"; // Header // Viewers Commands cmdlist += "\n" + '/buy' + " - Explains how to buy a ticket."; cmdlist += "\n"; cmdlist += "\n" + '/tickets' + " - Shows a list of ticket holders."; cmdlist += "\n"; cmdlist += "\n" + '/pass' + " - Indicates if you have a show ticket."; cmdlist += "\n"; cmdlist += "\n" + '/timeleft' + " - Displays the remaining time on the 'time until show' timer."; cmdlist += "\n"; cmdlist += "\n" + '/showtime' + " - Displays the length of time a Hidden Cam show has been in progress."; cmdlist += "\n"; if (FLAG.gift) { cmdlist += "\n" + '/gift' + " <username> - Allows a viewer with a ticket to gift their ticket to another viewer. Type /giftinfo for more"; cmdlist += "\n"; cmdlist += "\n" + '/giftinfo' + " - Detailed info on the /gift command"; } // Moderator, or Broadcaster only Commands if (isMod || (viewer === roomHost) || (viewer === 'acrazyguy')) { cmdlist += "\n"; cmdlist += "\n" + '/new' + " - Lists any new features in " +app.name; // Only show these commands to the moderators // If the broadcaster selected to include mods .. // Always show to the broadcaster if ( (cb.settings.includeMods === 'Yes') || viewer === roomHost ) { cmdlist += "\n\n" + '/add' + " <user> or <user1 user2 etc> - Manually adds one or more viewers to ticket holder list. Type '/add ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/del' + " <user> - Manually removes <user> from the ticket holder list. Type '/del ?' for expanded help."; } // end if cb.settings.includeMods cmdlist += "\n"; cmdlist += "\n" + '/check' + " <user> or <user1 user2 etc> - Checks if the <user> is a ticket holder. Type '/check ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/fcp' + " - If fans have special ticket pricing, sends an advert to ONLY the fans in the room indicating the price." cmdlist += "\n"; cmdlist += "\n" + '/fcpa' + " - If fans have special ticket pricing, sends the special pricing advert to everyone." cmdlist += "\n"; cmdlist += "\n" + '/plist' + " - Displays a list of only the paid ticket holders in a list format." cmdlist += "\n"; cmdlist += "\n" + '/plistw' + " - Displays a list of only the paid ticket holders in a wide format." cmdlist += "\n"; cmdlist += "\n" + '/alist' + " - Displays a list of manually added ticket holders." cmdlist += "\n"; cmdlist += "\n" + '/aalist' + " - Displays a list of auto-added ticket holders." cmdlist += "\n"; /*cmdlist += "\n" + '/vlist' + " - Displays a list of ticket holders in the room." cmdlist += "\n"; cmdlist += "\n" + '/nrlist' + " - Displays a list of ticket holders not in the room." cmdlist += "\n";*/ cmdlist += "\n" + '/ltlist' + " - Displays a list of lifetime ticket holders." cmdlist += "\n"; cmdlist += "\n" + '/giftlist' + " - Displays a list of gifted tickets." cmdlist += "\n"; cmdlist += "\n" + '/email' + " - Tells "+app.name+" to check for an email address in the tip note. Alerts the viewer, mods and broadcaster if email is missing"; cmdlist += "\n"; cmdlist += "\n" + '/hilite' + " - Toggles the text highighting for ticket holders on/off. Type '/hilite ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/schat' + " <on> - Suppresses public chat during a 'hidden cam' show. Type '/schat ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/tipsoff' + " <on> - Suppresses the total tips display in the info panel. Type '/tipsoff ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/starttimer' + " <minutes> - Starts a show countdown timer for the number of <minutes> specified."; cmdlist += "\n"; cmdlist += "\n" + '/addtime' + " <minutes> - Adds time to the countdown timer. Negative numbers can used to subtract time."; cmdlist += "\n"; cmdlist += "\n" + '/stoptimer' + " - Stops the show countdown timer"; cmdlist += "\n"; cmdlist += "\n" + '/startshow' + " - Starts a hidden cam show, letting only ticket holders see the cam feed"; cmdlist += "\n"; cmdlist += "\n" + '/stopshow' + " - Stops any hidden cam show in progress, suspends ticket sales and returns to normal public mode."; cmdlist += "\n"; cmdlist += "\n" + '/showover' + " - Sends a 'nearing end of show' message to viewers entering the room during a Hidden Cam show. Type '/showover ?' for expanded help."; cmdlist += "\n"; cmdlist += "\n" + '/showend' + " - Clearly indicates to viewers that even though the room cam is still hidden, the show has ended and ticket sales have been suspended."; cmdlist += "\n"; cmdlist += "\n" + '/newshow' + " - Restarts ticket sales after a show has been ended. Does NOT clear existing tickets. Broadcaster must use " + '/ctreset' + " to clear all tickets"; cmdlist += "\n"; cmdlist += "\n" + '/subject' + " <text> - Allows mods to change the room subject. New subject is displayed verbatim."; cmdlist += "\n"; cmdlist += "\n" + '/ctsubject' + " <text> - Allows mods to change the room subject. New subject is displayed with 'CrazyTicket:' leader and 'Type /cmds' trailer."; cmdlist += "\n"; cmdlist += "\n" + '/ctn' + " <text> - Sends a one time notice to the chat."; cmdlist += "\n"; cmdlist += "\n" + '/ctnd' + " <text> - Sends a one time public notice with divider lines."; cmdlist += "\n"; cmdlist += "\n" + '/ctnh' + " <text> - Sends a one time public notice with highlighting."; cmdlist += "\n"; cmdlist += "\n" + '/ctndh' + " <text> - Sends a one time public notice with divider lines and highlighting."; cmdlist += "\n"; cmdlist += "\n" + '/ctm' + " <text> - Sends a private notice to the mods as a group."; cmdlist += "\n"; cmdlist += "\n" + '/ctb' + " <text> - Sends a private notice to the broadcaster."; cmdlist += "\n"; cmdlist += "\n" + '/ctbm' + " <text> - Includes the broadcaster in private messages between the moderators."; cmdlist += "\n"; cmdlist += "\n" + '/ctt' + " <text> - Sends a private notice to all ticket holders."; cmdlist += "\n"; cmdlist += "\n" + '/ctv' + " <name> <text> - Sends a private notice to one viewer."; } // end if moderator+broadcaster // Broadcaster-only Commands if ((viewer === roomHost) || (isMod && cb.settings.modPrice === 'Yes')) { cmdlist += "\n"; cmdlist += "\n" + '/ctprice' + " <newprice> - Changes the ticket price to <newprice>."; } if (viewer === roomHost) { cmdlist += "\n"; cmdlist += "\n" + '/ctreset' + " - Clears all ticket holder lists and prepares "+app.name+" for ticket sales for a new show."; } // end if broadcaster cmdlist += "\n---------------------------------------------------"; // line below list return cmdlist; } // ***** END getCommandList() ***** function priceUp(cmdval) { cb.sendNotice( "\n:alert1 ------------------------------------------------- :alert1\n" + "\n----------------- ATTENTION VIEWERS ----------------" + "\n:alert1 ------------------------------------------------- :alert1" + "\n\u25CF TICKET PRICE HAS CHANGED TO \u25CF\u2009" + newPrice + "\u2009\u25CF TOKENS\n" + dashLine + "\n", '', COLOR.REDHL, COLOR.MRED, 'bold' ); ticketPrice = newPrice; ctPrices.push(parseInt(ticketPrice,10)); FLAG.priceup = true; cb.drawPanel(); if (cb.limitCam_isRunning()) { cb.changeRoomSubject(app.name + ": Hidden Cam show in progress. Tip " + ticketPrice + " tokens to see the show"); } else { defaultSubject(); } } // ***** END priceUp() ***** function blankLine(num,viewer) { var blank; var blankStr = ""; for (blank=1; blank < num; blank++) blankStr += "\n"; cb.sendNotice(blankStr, viewer, '', '#FFFFFF' ); } // ***** END blankLine() ***** function yellowWall(num,viewer) { var outStr = ""; var wallStr = "\nY E L L O W\u2003W A L L !!\u2003Y E L L O W\u2003W A L L !!"; for (i=1;i <= num;i++) outStr += wallStr; cb.sendNotice(outStr, viewer, '#FFFF33', '#000033', 'bold' ); } function onlyMods(viewer) { cb.sendNotice("\u25CF Command is only available to moderators and the room host", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } function onlyRoomHost(viewer) { cb.sendNotice("\u25CF Command is only available to the room host", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } function otsNE(viewer) { cb.sendNotice("\n\u25CF The Outstanding Ticket System is not ENABLED\n", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } // Auto-add Mods and Fans function autoAdd(viewer) { if (!user('check',viewer)) { user('add',viewer); if (!autoList.includes(viewer)) autoList.push(viewer); /* if (!viewerList.includes(viewer)) viewerList.push(viewer);*/ cb.drawPanel(); return true; } else { return false; } } // Default room subject function defaultSubject() { if (cb.settings.showDesc) { cb.changeRoomSubject(app.name + ": " + cb.settings.showDesc); } else { cb.changeRoomSubject(app.name + ": Tip " + ticketPrice + " tokens to buy a show ticket."); } } // Get current HC show length function getShowTime() { var msecs = Date.now() - hideTime; return calcTime(msecs); } function calcTime(msecs) { var showMins = parseInt(msecs/60000,10); var showSecs = parseInt((msecs%60000)/1000,10); return (showMins > 0 ? showMins + (showMins > 1 ? " minutes " : " minute ") : "") + showSecs + " seconds"; } // Print content of Object function printObject(o) { var out=''; for (var p in o) { out += '('+p+': '+o[p]+'), '; } return out; } /** * How to use debug() * Example: if (FLAG.debug) { cb.sendNotice(debug(msg,true),u,'',COLOR.INFO,'bold'); } * debug(something,true|false) * true=array|false=var/const/string * To turn on debug: /dump debug (gives no visual output, but toggles FLAG.debug from false to true) **/ function debug(check,type) { var result = "Debug: "; if (type===true) { result += printObject(check); } else { result += check; } return result; } // User Handling function user(command,user) { if ((command === 'add') && (!cb.limitCam_userHasAccess(user))) { cb.limitCam_addUsers([user]); // API array } // end if add if ((command === 'del') && (cb.limitCam_userHasAccess(user))) { cb.limitCam_removeUsers([user]); // if (viewerList.includes(user)) cbjs.arrayRemove(viewerList,user); } // end if del if (command === 'check') { return (cb.limitCam_userHasAccess(user) == true ? true : false); } // end if check } // end function user() // Used by /starttimer command function startCDTimer(mins,viewer) { cdTimerMinutes = parseInt(mins,10); if (cdTimerMinutes < 121 && cdTimerMinutes > 0) { FLAG.cdtimer = true; cb.sendNotice( dashLine + "\n\u25CF " + cdTimerMinutes + " minutes until the show starts!\n" + dashLine, '', '', COLOR.BRED, 'bold' ); cdMilliSecs = Date.now()+(mins*60000); if (mins <= 5) { cdTimerID = cb.setTimeout(cdTimerAdvert, (1 * 60000)); } else if (cdTimerMinutes <= 15) { cdTimerID = cb.setTimeout(cdTimerAdvert, (2 * 60000)); } else { cdTimerID = cb.setTimeout(cdTimerAdvert, (5 * 60000)); } } else { cb.sendNotice("\u25CF Maximum timer length is 120", viewer, COLOR.HILITE, COLOR.NOTICE, 'bold' ); } } function cdTimerAdvert() { if (FLAG.cdtimer) { if (cdTimerMinutes <= 5) { cdTimerMinutes--; } else if (cdTimerMinutes <= 15) { cdTimerMinutes -= 2; } else { cdTimerMinutes -= 5; } if (cdTimerMinutes <= 0) { FLAG.cdtimer = false; cb.sendNotice( dashLine + "\n\u25CF :ml-gl IT'S SHOWTIME :ml-gl\n" + dashLine, '', COLOR.GREENHL, COLOR.GREEN, 'bold' ); } else { cb.sendNotice( dashLine + "\n\u25CF " + cdTimerMinutes + (cdTimerMinutes > 1 == true ? " minutes" : " minute") + " until the show starts!\n" + dashLine, '', '', COLOR.BRED, 'bold' ); if (cdTimerMinutes <= 5) { cdTimerID = cb.setTimeout(cdTimerAdvert, (1 * 60000)); // remind every minute } else if (cdTimerMinutes <= 15) { cdTimerID = cb.setTimeout(cdTimerAdvert, (2 * 60000)); // remind every 2 minutes } else { cdTimerID = cb.setTimeout(cdTimerAdvert, (5 * 60000)); // remind every 5 minutes } } } } function fcpNotice() { if (!FLAG.end) { cb.sendNotice(fcpMsg, '', COLOR.GREENHL, COLOR.FAN, 'bold', FANS ); cb.setTimeout(fcpNotice, fanAdvertInt*60000); } } // ********** Init ********** function init() { var i; ctPrices.push(parseInt(ticketPrice,10)); startTime = new Date(); // The time the App is started. blankLine(1,roomHost); cb.sendNotice( dashLine + "\n\u25CF :CT30 by CrazyWare" + "\n\u25CF Version: " + app.version + app.build + " (" + app.date + ") started\n" + dashLine, '', '', COLOR.INFO, 'bold' ); cb.sendNotice( dashLine + "\n\u25CF ** This version of CrazyTicket is NOT recommended for rooms that have a large number of users likely to buy a ticket and/or where there is a possibility of frantic rapid ticket buying that may cause a crash and the ticket list lost **. A new version is in development and will available soon. Under these conditions, use it at your own risk and keep a backup ticket list if possible\n" + dashLine, roomHost, COLOR.REDCBBG, COLOR.WHITE, 'bold' ); blankLine(1,roomHost); cb.sendNotice( dashLine + "\n\u25CF " + typeCmds + "\n" + dashLine, '', COLOR.REDHL, COLOR.MRED, 'bold' ); blankLine(roomHost,1); cb.sendNotice(newTeaser, roomHost, COLOR.HVBACK, COLOR.HVTEXT, 'bold' ); cb.sendNotice(newTeaser, '', COLOR.HVBACK, COLOR.HVTEXT, 'bold', MODS ); blankLine(1,roomHost); if (fanPrice) cb.sendNotice(fanMsg, '', COLOR.GREENHL, COLOR.FAN, 'bold', FANS ); if (fanPrice && fanAdvertInt && (roomHost != 'jackandjill')) cb.setTimeout(fcpNotice, fanAdvertInt*60000); /* if (cb.settings.autoaddMods === 'Yes') { cb.getRoomUsersData(function(usersData) { if (usersData.success) { for (let user of usersData.data.moderator) { if (!cb.limitCam_userHasAccess(user)) cb.limitCam_addUsers([user]); if (!cbjs.arrayContains(autoList,user)) autoList.push(user); // if (!cbjs.arrayContains(viewerList,user)) // viewerList.push(user); cb.sendNotice( dashLine + "\n\u25CF You've automatically been added to the ticket" + "\n\u25CF list because you are a moderator :woohoo\n" + dashLine, user, '', COLOR.MRED, 'bold' ); } } }); cb.drawPanel(); } if (cb.settings.autoaddFans === 'Yes') { cb.getRoomUsersData(function(usersData) { if (usersData.success) { for (let user of usersData.data.fanclub) { autoAdd(user); cb.sendNotice( dashLine + "\n\u25CF You've automatically been added to the ticket" + "\n\u25CF list because you are a FanClub member :woohoo\n" + dashLine, user, '', COLOR.GREEN, 'bold' ); } } }); } */ // cb.sendNotice(dashLine + "\n\u25CF :alert1 CrazyTicket supports Anonymous Tipping\n" + dashLine,'',COLOR.BLUEHL,COLOR.BLUE,'bold'); if (FLAG.stats) cb.sendNotice(":alert1 Complimentary ticket", app.acg, COLOR.HILITE, COLOR.NOTICE, 'bold' ); defaultSubject(); if (lifeList.length) { for (var i=0; i<lifeList.length; i++) { if (autoAdd(lifeList[i])) cb.sendNotice( dashLine + "\n\u25CF '" + lifeList[i] + "':" + "\n\u25CF Because you are a lifetime ticket holder, you" + "\n\u25CF have been automatically added to the ticket list\n" + dashLine, lifeList[i], '', COLOR.MRED, 'bold' ); } } if (otsTickets.length > 0) { for (var i=0; i<otsTickets.length; i++) cb.sendNotice( dashLine + "\n\u25CF '" + otsTickets[i] + "':" + "\n\u25CF " + otsMsg + dashLine, otsTickets[i], '', COLOR.MRED, 'bold' ); } } // ***** Ok, let's kick this thing off ***** / init(); /* ..gspp.. .d$$S$$S$$Sb. dS$$S$$S$PS$$Sb :$$S$S^^'";TSS$$; ; SSP' : T$$SS/; $$ \ `^^'/ :$ `-ggd: :.=-. .-=.:SSS ; <@>` <@> $$$$ : SS$$ ' -. $$S; ' .--. s$$S _ `. `--' .$$S$; .-"" "-._.-'`.__.' $$$S; : :S$$S ; :l "-. '^S$$b /`-. ;: " .--""""""^-. :"-. "" : /) ; ;`- : /: : :`- `. \ / '-.t `+.__ `. ;/ .-' -.; ; "-. "-. : .-" --: ; ;. "^:" .-""-.`.; : -^"`. "-.+' \/ ; `. "- ; : .^. / \ .-" "-. .' `._.-" "-._.-": ; : ; : : : ; \ ; ; : ; ; : ; : : / ; : \ ; ; : : ; ; : : : ; ; ; ; c : : : : ; /""--..__ ; : : ""--..__ ; ; "-. --..__ ""--..__: :`-._ "-._ "" _; ; "-._ """---...---""" : */
© Copyright Chaturbate 2011- 2024. All Rights Reserved.