Bots Home
|
Create an App
Honey Fingers
Author:
0_____dash_____
Description
Source Code
Launch Bot
Current Users
Created by:
0_____Dash_____
// HoneyFingers // Version: 1.0.1 // Feb 25, 2017 // // Modified From: // NF4HH by Ransyd // Version: 1.0.5 // November 29, 2016 // (Excellent job on this) // // Modified from: // Tip Cam by Scrambler // Version: Beta // www.chaturbate.com/thescrambler // July 26th, 2014 // // With parts from: // Ticket Show Version: 1.0.3 Author: zingknaat // CrazyTicket Lite by CrazyWare // Bomb Bot Ultra 1.6.3 by adambomb01 // Cam_slutt Timer Bot by cam_slutt // // v1.0.0 // Added: // Slightly Modified from v1.05 of nf4hh. // // ----------------------------------------------------------------------------- // Commands: // --- Broadcaster only --- // //start (start hidden cam session) // //stop (stop hidden cam session) // --- Broadcaster or Moderator --- // //time, //t <min>|stop (timer control, input number of mins or stop) // //add, //a (add user to list of approved hidden cam viewers) // //rem, //r (remove user from list of approved hidden cam viewers) // //fin, //f (send session is finished notice every 30 seconds) // --- Anyone --- // //chk, //c (check for a name in list of approved hidden cam viewers) // //list, //l (show list of approved hidden cam viewers, only mods // and host can see who tipped.) // //help, //h (list commands) // ----------------------------------------------------------------------------- // Setup ----------------------------------------------------------------------- const botName = 'HoneyFingers'; const botVersion = '1.0.1'; const botAuthor = 'THE Pizza'; const COLOR_BLACK = '#000000' const COLOR_GOLD = '#F9E60A' const COLOR_DEVELOPER = '#D9F7F7'; // Very light blue: Highlight colour for developers const COLOR_RED = '#FF1407'; // Bright red: Important notice const COLOR_HIGHLIGHT = '#EEE5FF'; // Pastel purple: Highlight colour for ticket holders const COLOR_SUCCESS = '#468847'; // Green: Everything is fine const COLOR_ERROR = '#B94A48'; // Red: Everything fails const COLOR_INFO = '#144D8C'; // Blue-grey: Help and misc info const COLOR_NOTICE = '#6900CC'; // Bluish purple: General chat notice const COLOR_DPURPLE = '#663399'; // Dark purple const COLOR_LPURPLE = '#8041BF'; // Lighter purple const COLOR_MOD = '#DC0000'; // Moderator red const COLOR_FAN = '#009900'; // Fan green const COLOR_SYNTAX = '#995B00'; // Brownish: Usage notice colour and messages // to broadcaster on mod-action const COLOR_HVTEXT = '#D80A00'; // Redish: Text colour for Hi-Vis notices const COLOR_HVBACK = '#FFFFBF'; // Light yellow: Highlight colour for Hi-Vis notices const TimeTextColor = '#00FFFF'; // Cyan: Color for timer notices const TimeBGColor = '#0000BB'; // Dark Blue: Background for timer notices const ONLY_BROADCASTER = '* Command is only available to the broadcaster.'; const ONLY_MODERATORS = '* Command is only available to moderators and the broadcaster.'; // Global Variables ------------------------------------------------------------ var tipperList = []; var tippers = []; var addMods = (cb.settings.add_mods == 'Yes') var addFans = (cb.settings.add_fans == 'Yes') var viewArray = new Array; // [i] = user's name, list of users who have been added to the view list var cmdNote = (cb.settings.cmd_notify == 'Yes') var tipAmount = parseInt(cb.settings.cam_amount); var langTokens = (cb.settings.cam_amount > 1) ? 'tokens' : 'token'; var showStarted = false; var timeRemaining; var timerRunning = false; var timerCancel = false; var hiddenFinished = false; // CB Settings ----------------------------------------------------------------- cb.settings_choices = [{ name: 'cam_message', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'Tip required to view Hidden Cam:', label: 'Message displayed to user\'s who can\'t view your cam, the amount of tokens to tip will be appended', required: true }, { name: 'cam_amount', type: 'choice', choice1: '100', choice2: '200', choice3: '300', choice4: '400', choice5: '500', choice6: '600', choice7: '700', choice8: '800', choice9: '900', choice10: '1000', defaultValue: '200', label: 'How many tokens it costs in order to view your cam', required: true }, { name: 'cmd_notify', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Be notified when a Moderator adds/removes a user', required: true }, { name: 'add_mods', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Automatically add moderators', required: true }, { name: 'add_fans', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Automatically add fan club members', required: true }, { name: 'viewList', type: 'str', minLength: 1, maxLength: 256, defaultValue: '', label: '[Optional] List of users allowed to view when Hidden Cam starts (SEPARATE NAMES WITH COMMA)', required: false }, { name: 'timeMsg', type: 'str', minLength: 1, maxLength: 256, label: '[Optional] Notice to display during timer countdown, minutes remaining will be appended (eg. Hidden Cam time remaining:)', defaultValue: 'Hidden Cam time remaining:', required: false }]; // onEnter --------------------------------------------------------------------- cb.onEnter(function(viewer) { u = viewer['user']; var isHost = (cb.room_slug == u); var isMod = viewer['is_mod']; var isFan = viewer['in_fanclub']; if ((addMods && isMod) || (addFans && isFan)) { addUser(cb.room_slug, u); cb.sendNotice('Welcome ' + u + ', you have been auto-added to the viewing list.', u, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); } advertise(u, isHost, isMod); }); // onMessage ------------------------------------------------------------------- cb.onMessage(function(msg) { //onMessage Variables var user = msg['user']; var msgString = msg['m']; var isHost = (cb.room_slug == user); var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isViewer = !(isHost || isMod || isFan); var isCommand = (msgString.search('//') != -1); if (isCommand) { msg['X-Spam'] = true; //Don't send message to chat msg['background'] = COLOR_HVBACK; msg['c'] = COLOR_SYNTAX; var validCmd = 0; var command; // Double slash + first word is the command var param; // Anything after the command is the parameter var cmd_index; // Position of // command identifier var split_index; // Position of the first space character // Split cmd_index = msgString.indexOf('//'); // Find command identifier split_index = msgString.indexOf(' ', cmd_index); // Find first space after command identifier if (split_index > -1) { // Message might have a parameter (could just be padding) command = msgString.substr(cmd_index, (split_index - cmd_index)).toLowerCase(); // substr (start index, length) param = msgString.substring(split_index + 1).trim(); // Could be empty } else { // Message is a command only command = msgString.toLowerCase(); param = null; } //Commands ----------------------------------------------------------------- if (validCmd == 0) { validCmd = 1; switch (command) { case '//chk': case '//c': { if (cb.limitCam_userHasAccess(param)) { cb.sendNotice(param + ' is on the view list!', user, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); } else { cb.sendNotice(param + ' is not on the view list!', user, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } break; } case '//list': case '//l': { showGuestList(user, (isHost || isMod)); break; } case '//help': case '//h': { showHelp(user, isHost, isMod); break; } case '//fin': case '//f': { if (isMod || isHost) { if (param == 'stop') { hiddenFinished = false; } else { if (!hiddenFinished) { hiddenFinished = true; timer(); } } } else { cb.sendNotice(ONLY_MODERATORS, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } case '//add': case '//a': { if (isMod || isHost) { if (user != param) { addUser(user, param); } else { notice = 'You can not add yourself! Please ask the\n'; notice += 'Broadcaster or another Moderator to add you.'; cb.sendNotice(notice, user, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } } else { cb.sendNotice(ONLY_MODERATORS, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } case '//rem': case '//r': { if (isMod || isHost) { remUser(user, param); } else { cb.sendNotice(ONLY_MODERATORS, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } case '//time': case '//t': { if (isMod || isHost) { if (isNaN(param)) { if (param == 'stop') { if (timerRunning) { timerCancel = true; timeRemaining = 0; cb.sendNotice('Timer cancelled!', '', TimeBGColor, COLOR_DEVELOPER, 'bold'); } else { cb.sendNotice('Timer not running.', user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } } } else { if (Number(param) > 0) { timeRemaining = Number(param); cb.sendNotice('Timer set for ' + param + ' minutes.', user, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); timerRunning = true; timerCancel = false; timer(); } } } else { cb.sendNotice(ONLY_MODERATORS, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } case '//start': { if (isHost) { startHidden(user); } else { cb.sendNotice(ONLY_BROADCASTER, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } case '//stop': { if (isHost) { stopHidden(user); } else { cb.sendNotice(ONLY_BROADCASTER, user, COLOR_HVBACK, COLOR_HVTEXT, 'bold', ''); } break; } default: { validCmd = 0; break; } } } } }); // onTip ----------------------------------------------------------------------- cb.onTip(function(tip) { user = tip['from_user']; amount = tip['amount']; // If the tip is meets minimum amount required then user is added to the access list // and tipper list. if (amount >= tipAmount) { addTipperList(user); } }); // Time Command ---------------------------------------------------------------- function timer() { if ((timeRemaining < 1) || hiddenFinished) { timerRunning = false; if (hiddenFinished) { cb.sendNotice('Hidden Cam session is FINISHED!!\n--> DO NOT tip to join!! <--', '', TimeBGColor, TimeTextColor, 'bold', ''); cb.setTimeout(timer, 30 * 1000); } else { if (!timerCancel) { timerMessage(); } else { timerCancel = false; } } } if (timerRunning) { cb.setTimeout(timer, 60 * 1000); timerMessage(); timeRemaining -= 1 } } function timerMessage() { if (timerRunning) { var timeGrammar = (timeRemaining > 0) ? timeRemaining + ' minute' + ((timeRemaining > 1) ? 's' : '') : ''; if (!isBlank(cb.settings.timeMsg)) { cb.sendNotice(cb.settings.timeMsg + ' ' + timeGrammar, '', TimeBGColor, TimeTextColor, 'bold'); } else { cb.sendNotice(timeGrammar + ' remaining.', '', TimeBGColor, TimeTextColor, 'bold'); } } else { if (!isBlank(cb.settings.timeMsg)) { cb.sendNotice(cb.settings.timeMsg + ' FINISHED!!', '', TimeBGColor, TimeTextColor, 'bold'); } else { cb.sendNotice('Timer has finished!', '', TimeBGColor, TimeTextColor, 'bold'); } } } // Start Command --------------------------------------------------------------- function startHidden(u) { var camMsg = cb.settings.cam_message.trim() + ' ' + tipAmount + ' ' + langTokens if (!cb.limitCam_isRunning()) { cb.limitCam_start(camMsg); cb.sendNotice('Hidden Cam [started]', '', COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); cb.sendNotice(camMsg, '', COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); var notices = cb.room_slug; if (addMods) { notices += ' has set Hidden Cam to auto-add\n'; notices += 'Moderators, please REFRESH if you\n'; notices += 'can not view cam.' cb.sendNotice(notices, '', '', COLOR_SYNTAX, 'bold', 'red'); } else if (addFans) { notices += ' has set Hidden Cam to auto-add\n'; notices += 'Fans, please REFRESH if you\n'; notices += 'can not view cam.' cb.sendNotice(notices, '', '', COLOR_SYNTAX, 'bold', 'green'); } // Add any names that were in the viewer list when bot was started. if (viewArray.length > 0) { for (i = 0; i < viewArray.length; i++) { addUser(cb.room_slug, viewArray[i]); } } showStarted = true; } else { cb.sendNotice('Hidden Cam session already running!', u, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } } // Stop Command ---------------------------------------------------------------- function stopHidden(u) { if (cb.limitCam_isRunning()) { cb.limitCam_stop(); cb.sendNotice('Hidden Cam [stopped]', '', COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); cb.sendNotice('Total number of viewers who tipped to view: ' + tipperList.length, u, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); // Clear out the Hidden Cam access list - this does NOT clear out names that were // added to the viewer list when the bot was initially run. Those names will be // added again when the //start command is given. var guestList = cb.limitCam_allUsersWithAccess(); if (guestList.length > 0) cb.limitCam_removeAllUsers(); showStarted = false; timerCancel = true; timeRemaining = 0; hiddenFinished = false; tipperList = []; } else { cb.sendNotice('Hidden Cam session is not running.', u, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } } // Called when user enters room ------------------------------------------------ function advertise(username, h, m) { var notices = 'Hidden Cam ' if (!showStarted) { notices += 'will be starting soon.\n'; } else { notices += 'is running.\n'; } if (!cb.limitCam_userHasAccess(username)) { notices += 'Tip ' + tipAmount + ' ' + langTokens + ' to view cam.\n'; } cb.sendNotice(notices, username, '', COLOR_SYNTAX, 'bold'); showHelp(username, h, m); } // List Command ---------------------------------------------------------------- function showGuestList(u, extra) { var guestList = cb.limitCam_allUsersWithAccess(); var rowNum = 1; var msg = '--- Hidden Cam Viewer List ---\n'; msg += 'Number of viewers: ' + guestList.length + '\n'; if (extra) { msg += 'Tipped to view: ' + tipperList.length + '\n'; } if (guestList.length > 0) { msg += '----------------------------------------'; } for (var i = 0; i < guestList.length; i++) { msg += '\n' + rowNum + ') ' + guestList[i]; if (extra) { msg += (tipperList.indexOf(guestList[i]) == -1) ? '' : ' *'; } rowNum++; } msg += '\n----------------------------------------' cb.sendNotice(msg, u); } // Add Command ----------------------------------------------------------------- // Only called on Start command if there's any viewers to add and if host/mod // uses //add command. // Viewers added this way are NOT added to the list of viewers who tipped to join // UNLESS they tip the join amount during the Hidden Cam session. function addUser(u, name) { name = name.toLowerCase(); if (cb.limitCam_userHasAccess(name)) { cb.sendNotice(name + ' is already on the list!', u, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } else { cb.limitCam_addUsers([name]); cb.sendNotice('\'' + name + '\' has been added to the list', u, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); cb.sendNotice(u + ' has added you to view list, refresh if unable to view cam.', name, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); if (cmdNote && !(u == cb.room_slug)) { cb.sendNotice('Moderator \'' + u + '\' has added \'' + name + '\'', cb.room_slug, COLOR_HVBACK, COLOR_NOTICE, 'bold', ''); } } } // Remove Command -------------------------------------------------------------- // User is not removed from the tipper list because if they tipped to join they cannot // recover tokens during the cam session, so number of viewers who tipped to view // remains the same. *** Names are case-sensitive. *** function remUser(u, name) { if (!cb.limitCam_userHasAccess(name)) { cb.sendNotice('\'' + name + '\' is not on the list!', u, COLOR_HVBACK, COLOR_ERROR, 'bold', ''); } else { cb.limitCam_removeUsers([name]); cb.sendNotice('\'' + name + '\' has been removed from the list', u, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); if (tipperList.indexOf(name) != -1) { cb.sendNotice('WARNING: The only way \'' + name + '\' can join again is through the //add command!!', u, COLOR_GOLD, COLOR_BLACK, 'bold', ''); } if (cmdNote && !(u == cb.room_slug)) { cb.sendNotice('Moderator \'' + u + '\' has removed \'' + name + '\'', cb.room_slug, COLOR_HVBACK, COLOR_NOTICE, 'bold', ''); } } } // addTipperList --------------------------------------------------------------- // Called from the onTip function if a viewer has tipped minimum amount to unhide // cam, also adding them to the tipperList array if not already in it. function addTipperList(u) { //search for user in lists; assign return value u = u.toLowerCase(); var tipped = tipperList.indexOf(u); if (tipped == -1) { tipperList.push(u); cb.limitCam_addUsers([u]); cb.sendNotice('\'' + u + '\', you now have access to ' + cb.room_slug + '\'s Hidden Cam session\n :keyhole2', u, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); cb.sendNotice('\'' + u + '\' now has access to your Hidden Cam session', cb.room_slug, COLOR_HVBACK, COLOR_SUCCESS, 'bold', ''); } } // showHelp -------------------------------------------------------------------- function showHelp(u, h, m) { var notices = 'Commands available:\n'; if (h) { notices += '//start - Start Hidden Cam session.\n'; notices += '//stop - Stop Hidden Cam session.\n'; } if (h || m) { notices += "//time mins|stop - Start/stop countdown timer.\n"; notices += 'eg. //time 8 - will start an 8 minute countdown.\n'; notices += 'eg. //time stop - will stop a running countdown.\n'; notices += '//add user - Add user to the viewing list.\n'; notices += '//rem user - Remove user from the viewing list.\n'; notices += '//fin [stop] - Start/stop session finished notice (30s timeout).\n'; notices += '//chk user - Checks if user is on the viewing list.\n' } notices += '//list - List users on the viewing list.\n'; notices += '//help - This notice.\n'; if (h || m) { notices += 'Commands can be abbreviated to the first character.\n'; notices += 'eg. //a someuser\n'; if (h) { notices += '\nExcept for //start and //stop.\n'; notices += '\n :touchhoney \n'; } if (m) { notices += '\n :PowerRangerDance \n'; } } cb.sendNotice(notices, u, '', COLOR_SYNTAX, 'bold'); } function isBlank(cbsetting) { var s; if (cbsetting) { s = cbsetting.trim(); } if (s == null || s == '' || s.substr(0, 9) == '[Optional') { return true; } else { return false; } } // Startup --------------------------------------------------------------------- function init() { cb.sendNotice(botName + ' [loaded]', '', TimeBGColor, COLOR_DEVELOPER, 'bold', ''); cb.sendNotice(botVersion + ' - ' + botAuthor, '', TimeBGColor, COLOR_DEVELOPER, 'bold', ''); var guestList = cb.limitCam_allUsersWithAccess(); if (guestList.length > 0) cb.limitCam_removeAllUsers(); showStarted = false; showHelp(cb.room_slug, 'True', 'False'); if (!isBlank(cb.settings.viewList)) { var n = cb.settings.viewList.replace(/\s+/g, ''); viewArray = n.replace(/^,+|,+$/g, '').split(','); } } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.