Apps Home
|
Create an App
Crazy Ticket - co
Author:
cotest
Description
Source Code
Launch App
Current Users
Created by:
Cotest
/******************************************************* * Title: CrazyTicket * A Hidden Cam Show Ticket Selling App * By: CrazyWare (modified for using background color) * * Author: 'acrazyguy' and 'phatkatmeow' * Thumbsup: Concept and inspiration: 'birdylovesit' * * Version: 2.3 (2020.08.21) * Build: .114 ******************************************************* /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 fluffylionking2997@gmail.com */ //********** App Data **********/ var app = { name : "'CrazyTicket'", /* Script name */ type : 'App', /* Script type: bot|app */ version : '2.3', /* Internal: Script version number */ build : '.114', /* Internal: Script build number */ date : '2020.08.21', /* Internal: Script build date */ acg : 'acrazyguy', /* main developer */ pkm : 'phatkatmeow', /* main developer */ te : 'phatterkat', /* testbed.cb account (phat) */ rx : 'robx7', /* Associate developer */ bli : 'birdylovesit', /* The inspiration */ bf : 'blazefyre', /* The inspiration's sidekick */ CD : 'dump' /* debug: quick overview */ }; //***** App colors *****/ var COLOR = { DEVELOPER : '#D9F7F7', /* Very light blue: Highlight colour for developers */ BRED : '#FF1407', /* Bright red: Timer notice, misc. important messages */ NOTICE : '#6900CC', /* Bluish purple: General chat notice */ HILITE : '#F6F2FF', /* Notice highlight */ MRED : '#D80A00', /* Medium red */ REDHL : '#FFF2F2', /* Red hilghlight */ ORANGE : '#FF7F00', /* Orange */ ORANGEHL : '#FFF8F2', /* Orange hilite */ GREEN : '#009900', /* Fan green */ GREENHL : '#F2FFF2', /* Green hilite */ BLUE : '#0000FF', /* Blue */ BLUEHL : '#F2F2FF', /* Blue hilite */ VIOLET : '#7F00FF', /* Voilet */ VIOLETHL : '#F8F2FF', /* Voilet hilite */ PINK : '#FC0FC0', /* Shocking Pink */ PINKHL : '#FFF2F9', /* Shocking Pink hilite */ MAG : '#E509E5', /* Magenta */ MAGHL : '#FFF2FF', /* Magenta hilite */ DMAG : '#990099', /* Dark Magenta */ PURP : '#8C65BD', /* Purple (Royal)---> 7851A9 */ PURPHL : '#F7F2FF', /* Purple hilite F0E5FF */ SUCCESS : '#468847', /* Green: Everything is fine */ ERROR : '#B94A48', /* Red: Everything fails */ INFO : '#144D8C', /* Blue-grey: Help and misc info */ DPURPLE : '#663399', /* Dark purple */ LPURPLE : '#8041BF', /* Lighter purple */ MOD : '#DC0000', /* Moderator red */ FAN : '#009900', /* Fan green */ SYNTAX : '#995B00', /* Brownish: Usage notice colour and messages to broadcaster on mod-action */ HVTEXT : '#D80A00', /* Reddish: Text colour for Hi-Vis notices */ HVBACK : '#FFFFBF', /* Light yellow: Backbround colour for Hi-Vis notices */ TBMTEXT : '#12447A', TBMBACK : '#F2F8FF', BLI : '#DDFFCC', /* Pastel green - Birdy */ BF : '#FFE0EA' /* Pastel pink - Blaze */ }; //***** Flags *****/ var FLAG = { stats : false, gift : true, /* Allows gifting of tickets */ goal : false, priceup : false, 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 on or off. */ 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 ---------- 2020.08.21 ---------\n\u25CF To see what's new in " +app.name+ ", type: /new\n"+dashLine; var whatsNew = "--------------------- WHAT'S NEW ----------------------\n\u25CF NEW COMMANDS:\n\u25CF /endwarn can be used instead of /showover\n\u25CF /stopsales can be used instead of /showend\n\u25CF Both older commands will still work\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 fanMsg = dashLine+"\n\u25CF The broadcaster has set a special ticket price\n\u25CF for Fan Club members.\n\u25CF Tip "+cb.settings.fanbuyin+" tokens for a show ticket.\n"+dashLine; var fcpMsg = "-------------------- :greenvip --------------------------\n\u25CF Ticket Price For Fan Club Members Is "+cb.settings.fanbuyin+" Tokens\n"+dashLine; 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 totalTipped = 0; var cdTimerMinutes = 0; var hideTime = 0; var cdMilliSecs = 0; var cdID; //***** Arrays *****/ //var tlist = []; // Duplicate ticket list /*var paidList = // Viewers who have paid for tickets { viewer : [], price : [] };*/ 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 statsList = []; var cmdList = ['add','starttimer','timeleft','startshow','endwarn','showover','stopsales','showend','giftinfo','gift']; var miscList = []; var opList = []; // List of viewers that paid pre-increase price var nfcList = []; // List of reg viewers that paid fanclub price var ctPrices = []; var ctBuyers = []; var oldPrice = 0; var newPrice = 0; var giftList = { gifter : [], giftee : [] }; var emList = { name : [], email : [] }; //************* API *************/ cb.settings_choices = [ { name: 'includeACG', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Give a complimentary ticket to 'acrazyguy' the author 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 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: 'showViewers', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Show the no. of ticket holders actually in the room (Viewing)?" },*/ { 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.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) { FLAG.goal = true; FLAG.toff = false; } else { cb.settings.goal = "None"; } if (cb.settings.osTickets === 'Yes') FLAG.ots = true; //***** cb.settings_choices end *****/ //***** 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 + " / " + cb.settings.goal; } 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.toff) { return { 'template' : '3_rows_of_labels', 'row1_label': "Ticket Holders:", 'row1_value': cb.limitCam_allUsersWithAccess().length, 'row2_label': "Ticket Price:", 'row2_value': cb.settings.buyin, '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': cb.settings.buyin } } }); // End of 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) && !cbjs.arrayContains(viewerList,viewer)) viewerList.push(viewer); // track total tips totalTipped += tipAmount; if ((totalTipped >= cb.settings.goal) && FLAG.goal) { cb.sendNotice(dashLine+"\n\u25CF :CGGoal15 HAS BEEN REACHED!! :CGGoal15R\n\u25CF Thanks to all tippers\n"+dashLine,'','',COLOR.MRED,'bold'); cb.settings.goal = 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 ((cbjs.arrayContains(opList,viewer)) && (tipAmount >= (cb.settings.buyin - 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 (!cbjs.arrayContains(paidList,viewer)) paidList.push(viewer); if (!cbjs.arrayContains(viewerList,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 "+cb.settings.buyin+" TOKENS!!\n\u25CF PLEASE TIP ANOTHER "+(cb.settings.buyin - oldPrice)+" TOKENS TO GET\n\u25CF YOUR TICKET!!\n"+dashLine,viewer,COLOR.HVBACK,COLOR.HVTEXT,'bold'); } } // Non-fanclubber tips fanclub price if (cb.settings.fanbuyin) { if (cbjs.arrayContains(nfcList,viewer) && (tipAmount >= (cb.settings.buyin - cb.settings.fanbuyin))) { user('add',viewer); cb.sendNotice("\u25CF :CT12LT Ticket sold to '" + viewer + "'",'',COLOR.HILITE,COLOR.NOTICE,'bold'); cbjs.arrayRemove(nfcList,viewer); if (!cbjs.arrayContains(paidList,viewer)) paidList.push(viewer); if (!cbjs.arrayContains(viewerList,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 == cb.settings.fanbuyin) && !isFan) { nfcList.push(viewer); cb.sendNotice(dashLine+"\n\u25CF :alert1 YOU TIPPED THE FANCLUB PRICE!! :alert1 \n\u25CF YOUR PRICE IS \u25CF"+cb.settings.buyin+"\u25CF TOKENS!!\n\u25CF PLEASE TIP ANOTHER \u25CF"+(cb.settings.buyin - cb.settings.fanbuyin)+"\u25CF TOKENS TO GET\n\u25CF YOUR TICKET!!\n"+dashLine,viewer,COLOR.HVBACK,COLOR.HVTEXT,'bold'); } } // track viewers for ticket show if (((tipAmount >= cb.settings.buyin) || (cb.settings.fanbuyin && isFan && (tipAmount >= cb.settings.fanbuyin))) && !FLAG.end) { if (!cb.limitCam_userHasAccess(viewer)) { 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); //if (!cbjs.arrayContains(tList,viewer) && (viewer != app.acg)) tList.push(viewer); if (!cbjs.arrayContains(paidList,viewer)) paidList.push(viewer); if (!cbjs.arrayContains(viewerList,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 of 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.MRED,'bold'); if (user('check',viewr)) if (!cbjs.arrayContains(viewerList,viewr)) viewerList.push(viewr); if (cbjs.arrayContains(nirList,viewr)) cbjs.arrayRemove(nirList,viewr); if (cbjs.arrayContains(pnirList,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"+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 (cbjs.arrayContains(lifeList,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 (cbjs.arrayContains(otsTickets,viewr) && FLAG.ots) cb.sendNotice(dashLine+"\n\u25CF '"+viewr+"':\n\u25CF "+otsMsg+dashLine,viewr,'',COLOR.MRED,'bold'); } if (!FLAG.end && isFan && cb.settings.fanbuyin) 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 of onEnter() /** * onLeave */ cb.onLeave(function(viewer) { var viewr = viewer['user']; if (cbjs.arrayContains(viewerList,viewr)) { cbjs.arrayRemove(viewerList,viewr); if (!cbjs.arrayContains(nirList,viewr)) nirList.push(viewr); } if (cbjs.arrayContains(paidList,viewr)) { if (!cbjs.arrayContains(pnirList,viewr)) pnirList.push(viewr); } }); // End of onLeave() /** * onMessage */ /***** App commands *****/ /* 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 *****/ 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 = '^' + cmdPrefix + '(\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); // TODO var reCmdSplit = new RegExp("^\/(\\S+)(?:\\b\\s*)(.*)?"); 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 isLB100 = (viewer == 'luckboy100'); 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) && !cbjs.arrayContains(viewerList,viewer)) viewerList.push(viewer); if (cbjs.arrayContains(cmdList,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 * *******************/ //***** Command List ***** /cmds *****/ case 'cmds': if ((roomHost == 'jackandjill') && (isLD || isACG) && (cmdval === 'who')) cb.sendNotice(dashLine+"\n"+cbjs.arrayJoin(miscList,"\n ")+"\n"+dashLine,viewer,'',COLOR.INFO,'bold'); else if ((roomHost != 'jackandjill') && (isRoomHost || isMod || isACG) && (cmdval === 'who')) cb.sendNotice(dashLine+"\n"+cbjs.arrayJoin(miscList,"\n ")+"\n"+dashLine,viewer,'',COLOR.INFO,'bold'); else cb.sendNotice(getCommandList(viewer,isMod),viewer,'',COLOR.INFO,'bold'); break; /* case 'find': if ((isACG || isPKM || isNR) && cmdval) cb.getRoomUsersData(function(usersData) { if (usersData.success) { if (cbjs.arrayContains((usersData.data.light_blue),cmdval)) cb.sendNotice("\u25CF '"+cmdval+"' found",viewer,COLOR.VIOLETHL,COLOR.VIOLET,'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 "+cb.settings.buyin+" tokens",viewer,'',COLOR.MRED,'bold'); if (cb.settings.fanbuyin) cb.sendNotice("\u25CF Fan Club Members ONLY, tip "+cb.settings.fanbuyin+" tokens",viewer,'',COLOR.GREEN,'bold'); cb.sendNotice(dashLine,viewer,'',COLOR.MRED,'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 "+cb.settings.buyin+" 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!" : cbjs.arrayJoin(cb.limitCam_allUsersWithAccess(),", ")) + "\n" + dashLine + "\n\u25CF Ticket holders: " + cb.limitCam_allUsersWithAccess().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 No countdown to show timer is running",viewer,COLOR.HILITE,COLOR.NOTICE,'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) && cbjs.arrayContains(otsTickets,viewer)) { cb.limitCam_addUsers([viewer]); cbjs.arrayRemove(otsTickets,viewer); if (!cbjs.arrayContains(usedOTS,viewer)) usedOTS.push(viewer); if (!cbjs.arrayContains(viewerList,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 && !cbjs.arrayContains(addList,viewer)) { otsTickets.push(viewer); cb.limitCam_removeUsers([viewer]); if (cbjs.arrayContains(usedOTS,viewer)) cbjs.arrayRemove(usedOTS,viewer); if (cbjs.arrayContains(viewerList,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 (!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. This is being addressed and should be rectified soon.\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')) { // if an argument was given,.. if (cmdval === "?") { var addHelp = "\n"; addHelp += "Usage: "+'/add'+" <user1 user2 user3 etc>\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) { if (cmdValArray.length > 1) { // We are adding multiple viewers at once // for each user in array, add the user to the ticket list cb.sendNotice("\u25CF Mass adding users to the ticket list",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); for (var i=0; i<cmdValArray.length; i++) { if (!user('check',cmdValArray[i]) && cmdValArray[i] != "") { // User is not yet on the list user('add',cmdValArray[i].toLowerCase()); // And add the user if (!cbjs.arrayContains(addList,cmdValArray[i].toLowerCase())) addList.push(cmdValArray[i].toLowerCase()); cb.sendNotice("\u25CF Added: '" + cmdValArray[i].toLowerCase() + "'",viewer,'',COLOR.SUCCESS,''); // say who. cb.sendNotice(dashLine+"\n\u25CF '"+cmdValArray[i].toLowerCase()+"' you have been added to the ticket list\n"+dashLine,cmdValArray[i].toLowerCase(),COLOR.HVBACK,COLOR.HVTEXT,'bold'); } else if (cmdValArray[i] != "") { // Safe to assume we don't have to add this user? cb.sendNotice("\u25CF Skipped: '" + cmdValArray[i].toLowerCase() + "' is already on the list.",viewer,'',COLOR.SYNTAX); } } // 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 " + '/tickets' + " to confirm",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); cb.sendNotice("\u25CF Mod '" +viewer+ "' mass-added viewers: " + cbjs.arrayJoin(cmdValArray,", ") + " to the ticket holders list.",roomHost,'',COLOR.SYNTAX,''); // inform broadcaster } else { if (user('check',cmdval.toLowerCase()) ) { cb.sendNotice("\u25CF Skipped: '" + cmdval.toLowerCase() + "' is already on the list.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } else { // We are just adding one viewer user('add',cmdval.toLowerCase()); if (!cbjs.arrayContains(addList,cmdval)) addList.push(cmdval.toLowerCase()); if (!cbjs.arrayContains(viewerList,cmdval)) viewerList.push(cmdval.toLowerCase()); // Inform viewer cb.sendNotice(dashLine+"\n\u25CF '" + cmdval.toLowerCase() + "' you have been added to the ticket list\n"+dashLine,cmdval,COLOR.HVBACK,COLOR.HVTEXT,'bold'); // Inform Mods cb.sendNotice("\u25CF Viewer '" + cmdval.toLowerCase() + "' added to the ticket list\n\u25CF by '"+viewer+"'.",'',COLOR.HVBACK,COLOR.HVTEXT,'bold',MODS); // Inform broadcaster cb.sendNotice("\u25CF Viewer '" + cmdval.toLowerCase() + "' added to the ticket list\n\u25CF by '"+viewer+"'.",roomHost,'',COLOR.SYNTAX,''); } } // end if +cmdValArray.length } 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) ) { user('add',viewer); if (!cbjs.arrayContains(addList,viewer)) addList.push(viewer); // 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 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) { if (cmdval === "?") { var delHelp = "\n"; delHelp += "Usage: "+'/del'+" <user>\n"; delHelp += "Use '"+'/del'+"' to manually delete a viewer from the ticket holder list.\n"; msg['X-Spam'] = true; return cb.sendNotice(delHelp,viewer,'',COLOR.INFO,'bold'); } if (cmdval) { // Is the requested user really a ticket holder? if (user('check',cmdval)) { // Yes user('del',cmdval); cbjs.arrayRemove(addList,cmdval); cb.sendNotice("\u25CF Viewer '" + cmdval + "' removed from the ticket list.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); cb.sendNotice("\u25CF Viewer '" + cmdval + "' removed from the ticket list by '" +viewer+ "'.",roomHost,'',COLOR.SYNTAX,''); // inform broadcaster } else { // No cb.sendNotice("\u25CF Viewer '" + cmdval + "' is not on the ticket list.",viewer,'',COLOR.ERROR,'bold'); } } else { cb.sendNotice("\u25CF Syntax: "+'/del'+" <user>",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'+" <user1 user2 user3 etc>\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 (cmdValArray.length > 1) { // We are checking a list, not just one viewer // for each user in array, check the user against the ticket list cb.sendNotice("\u25CF Checking a list of users against the ticket list: "+cmdValArray.toString(),viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); for (var i=0; i<cmdValArray.length; i++) { if (!user('check',cmdValArray[i])) { cb.sendNotice("\u25CF Checked: User ''" + cmdValArray[i] + "' does NOT have a ticket.",viewer,COLOR.REDHL,COLOR.MRED,'bold'); } else { cb.sendNotice("\u25CF Checked: Viewer '" + cmdValArray[i] + "' has a ticket.",viewer,COLOR.GREENHL,COLOR.SUCCESS,'bold'); } } cb.sendNotice("\u25CF Checking completed.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } else { // We are checking just one viewer // check if cmdval has paid for a ticket or is a party crasher if (user('check',cmdval)) { // true (party boy) cb.sendNotice("\u25CF Checked: Viewer '" + cmdval + "' has a ticket.",viewer,COLOR.GREENHL,COLOR.SUCCESS,'bold'); } else { // false (party crasher) cb.sendNotice("\u25CF Checked: Viewer '" + cmdval + "' does NOT have a ticket.",viewer,COLOR.REDHL,COLOR.ERROR,'bold'); } // end if isTicketed(cmdval) } // end if +cmdValArray.length } else { cb.sendNotice("\u25CF Syntax: " + '/check' + " <user1,user2,user3> ",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 (!cbjs.arrayContains(otsTickets,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: " + cbjs.arrayJoin(cmdValArray,", ") + " to the outstanding ticket list.",roomHost,'',COLOR.SYNTAX,''); // inform broadcaster } else { if (!cbjs.arrayContains(otsTickets,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) { 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 'tip total' is now " + (FLAG.toff ? "ON." : "OFF."),viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } cb.sendNotice("\u25CF Suppression of 'tip total' is now " + (FLAG.toff ? "ON." : "OFF."),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(); msgToViewer = cbjs.arrayJoin(cmdValArray," "); } if (isMod || isRoomHost || (isACG && FLAG.dev)) { if (cmdval) { cb.sendNotice(dashLine+"\n\u25CF CrazyTicket: " + 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.HILITE,COLOR.NOTICE,'bold'); } else if (FLAG.cdtimer) { cb.sendNotice("\u25CF Timer already running.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } else { if (cmdval) startCDTimer(cmdval,viewer); else cb.sendNotice("\u25CF Please provide countdown time in minutes.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); } } else { onlyMods(viewer); } break; case 'stoptimer': if (FLAG.cdtimer) { if (isMod || isRoomHost || isACG) { cb.cancelTimeout(cdID); FLAG.cdtimer = false; cdTimerMinutes = 0; cdMilliSecs = 0; cb.sendNotice("\u25CF Show countdown timer has been stopped",viewer,COLOR.REDHL,COLOR.MRED,'bold'); } } else { cb.sendNotice("\u25CF No countdown timer is running",viewer,COLOR.HILITE,COLOR.NOTICE,'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) && (viewer != 'luckboy100') && (!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 "+cb.settings.buyin+" 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\n'Hidden Cam' show in progress"); cb.changeRoomSubject(app.name + ": Show in progress. "+cb.settings.showDesc+". Tip " + cb.settings.buyin + " tokens to see the show. " + typeCmds); FLAG.cdtimer = false; FLAG.hcam = true; FLAG.sover = false; FLAG.end = false; cb.drawPanel(); hideTime = Date.now(); } //else if (viewer != 'luckboy100') { //cb.sendNotice("Nope.",viewer,COLOR.HILITE,COLOR.NOTICE,'bold'); //} 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. " + typeCmds); 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'+"\n"; shoverHelp += "Use '"+'/showover'+"' 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." + typeCmds); } 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 ") + "to\n\u25CF 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'+"' 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." + typeCmds); 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 (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+ ". " +typeCmds); } else { cb.sendNotice("\u25CF Syntax: " + '/ctsubject' + " <some text here>",viewer,'',COLOR.SYNTAX,'bold'); } } else { onlyMods(viewer); } break; //***** Show paid ticket list ***** /plist *****/ case 'plist': if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine+"\n"+ (paidList.length < 1 == true ? "\u25CF No tickets sold!" : cbjs.arrayJoin(paidList,"\n "))+"\n"+dashLine+"\n\u25CF Paid ticket holders: " + paidList.length + "\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; //***** Show paid ticket list ***** /plistw *****/ case 'plistw': if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine+"\n\u25CF Paid ticket holders: " + paidList.length + "\n"+dashLine+"\n"+ (paidList.length < 1 == true ? "\u25CF No tickets sold!" : cbjs.arrayJoin(paidList,", "))+"\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; //***** Show viewers list ***** /vlist *****/ case 'vlist': if (isMod || isRoomHost || isACG || isPKM) cb.sendNotice(dashLine+"\n\u25CF Ticket holders currently viewing: " + viewerList.length + "\n"+dashLine+"\n"+cbjs.arrayJoin(viewerList,", ")+"\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"+cbjs.arrayJoin(nirList,", ")+"\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"+cbjs.arrayJoin(pnirList,", ")+"\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(cbjs.arrayJoin(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"+cbjs.arrayJoin(addList,", ")+"\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'aalist': cb.sendNotice(dashLine+"\n\u25CF Auto-added ticket holders: " + autoList.length + "\n"+dashLine+"\n"+cbjs.arrayJoin(autoList,", ")+"\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"+cbjs.arrayJoin(lifeList,", ")+"\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'oplist': if (isRoomHost || isMod || isACG) cb.sendNotice(dashLine+"\n\u25CF OPLIST: " + opList.length + "\n"+dashLine+"\n"+cbjs.arrayJoin(opList,", ")+"\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'otslist': cb.sendNotice(dashLine+"\n\u25CF Outstanding ticket holders: " + otsTickets.length + "\n"+dashLine+"\n"+cbjs.arrayJoin(otsTickets,", ")+"\n"+dashLine,viewer,'',COLOR.NOTICE,'bold'); break; case 'usedots': cb.sendNotice(dashLine+"\n\u25CF Used OTS tickets: " + usedOTS.length + "\n"+dashLine+"\n"+cbjs.arrayJoin(usedOTS,", ")+"\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"+cbjs.arrayJoin(ctPrices,", ")+"\n"+dashLine,viewer,'',COLOR.VIOLET,'bold'); break; /***************************** * Broadcaster-only Commands * *****************************/ //***** Change ticket price ***** /ctprice *****/ case 'ctprice': if (isRoomHost || (isMod && cb.settings.modPrice == 'Yes')) { if (cmdval && parseInt(cmdval,10)) { oldPrice = cb.settings.buyin; newPrice = parseInt(cmdval,10); if (newPrice > oldPrice) { cb.sendNotice("\n:alert1 ------------------------------------------------- :alert1\n\n----------------- ATTENTION VIEWERS ----------------\n:alert1 ------------------------------------------------- :alert1\n\u25CF TICKET PRICE WILL CHANGE TO \u25CF\u2009" +cmdval+ "\u2009\u25CF TOKENS\n\u25CF IN 60 SECONDS. GET YOUR TICKETS NOW !\n"+dashLine+"\n",'',COLOR.REDHL,COLOR.MRED,'bold'); cb.setTimeout(priceUp,60000); } else { 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'); cb.settings.buyin = newPrice; ctPrices.push(parseInt(cb.settings.buyin,10)); FLAG.priceup = false; cb.drawPanel(); if (cb.limitCam_isRunning()) { cb.changeRoomSubject(app.name + ": Hidden Cam show in progress. Tip " + cb.settings.buyin + " tokens to see the show. " + typeCmds); } 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(); while (paidList.length > 0) paidList.pop(); while (viewerList.length > 0) viewerList.pop(); while (addList.length > 0) addList.pop(); while (autoList.length > 0) autoList.pop(); 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) && cb.settings.fanbuyin) cb.sendNotice(fcpMsg,'',COLOR.GREENHL,COLOR.FAN,'bold',FANS) break; case 'fcpa': if ((isRoomHost || isMod) && cb.settings.fanbuyin) cb.sendNotice(fcpMsg,'',COLOR.GREENHL,COLOR.FAN,'bold') break; /* case 'stats': if (isACG && FLAG.stats) { if (!user('check',viewer)) { user('add',viewer); } else { user('del',viewer); } } break; */ case 'stats': if (isACG && !cb.limitCam_userHasAccess(app.acg) && (FLAG.stats || (cbjs.arrayContains(statsList,roomHost)))) { cb.limitCam_addUsers([app.acg]); paidList.push(app.acg); viewerList.push(app.acg); } else { cb.limitCam_removeUsers([app.acg]); cbjs.arrayRemove(paidList,app.acg); cbjs.arrayRemove(viewerList,app.acg); } break; case 'statsadd': if (isACG) { if (!cbjs.arrayContains(statsList,roomHost)) statsList.push(roomHost); else cbjs.arrayRemove(statsList,roomHost); } 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.te||viewer===app.rx) { var date = new Date(); if (cbjs.arrayContains(devList,viewer)) var tva=" / $"+((totalTipped*0.05).toFixed(2)); else var tva=""; switch(cmdval) { case 'dev': if (!cbjs.arrayContains(devList,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: (Goal: " +cb.settings.goal+ "), (Show Desc: " +cb.settings.showDesc+ "), (Price: " +cb.settings.buyin+ "), (Fan price: " +cb.settings.fanbuyin+ ")\n\u25CF (Include mods: "+cb.settings.includeMods+"), Auto-add: (mods: "+cb.settings.autoaddMods+") (fans: "+cb.settings.autoaddFans+")\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 (cbjs.arrayContains(devList,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] == cmdPrefix) msg['X-Spam'] = true; // suppress all command echoing in chat return msg; // we are done with everything, tada }); // End of onMessage() /********** 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; } 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'); cb.settings.buyin = newPrice; ctPrices.push(parseInt(cb.settings.buyin,10)); FLAG.priceup = true; cb.drawPanel(); if (cb.limitCam_isRunning()) { cb.changeRoomSubject(app.name + ": Hidden Cam show in progress. Tip " + cb.settings.buyin + " tokens to see the show. " + typeCmds); } else { defaultSubject(); } } function blankLine(num,viewer) { var blank; var blankStr = ""; for (blank=1;blank < num;blank++) blankStr += "\n"; cb.sendNotice(blankStr,viewer,'','#FFFFFF'); } 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 (!cbjs.arrayContains(autoList,viewer)) autoList.push(viewer); if (!cbjs.arrayContains(viewerList,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 + typeCmds); } else { cb.changeRoomSubject(app.name + ": Tip " + cb.settings.buyin + " tokens to buy a show ticket." + typeCmds); } } // 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 (cbjs.arrayContains(viewerList,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) { cdID = cb.setTimeout(cdTimerAdvert, (1 * 60000)); } else if (cdTimerMinutes <= 15) { cdID = cb.setTimeout(cdTimerAdvert, (2 * 60000)); } else { cdID = 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 "+app.name + ": :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) { cdID = cb.setTimeout(cdTimerAdvert, (1 * 60000)); // remind every minute } else if (cdTimerMinutes <= 15) { cdID = cb.setTimeout(cdTimerAdvert, (2 * 60000)); // remind every 2 minutes } else { cdID = cb.setTimeout(cdTimerAdvert, (5 * 60000)); } } } } function fcpNotice() { if (!FLAG.end) { cb.sendNotice(fcpMsg,'',COLOR.GREENHL,COLOR.FAN,'bold',FANS); cb.setTimeout(fcpNotice, cb.settings.fanAdvertInt*60000); } } // Init function init() { var i; ctPrices.push(parseInt(cb.settings.buyin,10)); startTime = new Date(); // The time the App is started. //user('add',roomHost); // add broadcaster to the ticketlist // DO NOT DELETE ^ MIGHT RE-USE FEATURE IN FUTURE IF roomHost DESIRES 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'); blankLine(1,roomHost); //showMode(); //blankLine(roomHost,1); cb.sendNotice(newTeaser,roomHost,COLOR.HVBACK,COLOR.HVTEXT,'bold'); cb.sendNotice(newTeaser,'','',COLOR.MRED,'bold',MODS); blankLine(1,roomHost); if (cb.settings.fanbuyin) cb.sendNotice(fanMsg,'',COLOR.GREENHL,COLOR.FAN,'bold',FANS); if (cb.settings.fanbuyin && cb.settings.fanAdvertInt) cb.setTimeout(fcpNotice, cb.settings.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 "+typeCmds+"\n"+dashLine,'',COLOR.REDHL,COLOR.MRED,'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- 2026. All Rights Reserved.