Bots Home
|
Create an App
cherry's tipmenu
Author:
faceless1122
Description
Source Code
Launch Bot
Current Users
Created by:
Faceless1122
let pb_tip_amt = 0; let pb_separator_char = ":pinkheart69"; let pb_msg; let pb_MAXITEMS = 30; let pb_tipmenuprice = []; let pb_tipmenuitem = []; let pb_tippedNoticeColor = "#FF0000"; let pb_tippedNoticeBgColor = "#FFFF00"; let prefixes = ["prv", "pb"]; let prv_tip_amt = 0; let prv_separator_char = ":pinkheart69"; let prv_msg; let prv_MAXITEMS = 30; let prv_tipmenuprice = []; let prv_tipmenuitem = []; let prv_tippedNoticeColor = "#FF0000"; let prv_tippedNoticeBgColor = "#FFFF00"; let captcha_users = [cb.room_slug]; let captcha_pass = Math.floor((Math.random() * 9000) + 1001); let captcha_number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; let captcha_passp = captcha_pass.toString().split(""); let captcha_usernotice1 = "To prevent spambots, please enter the following number:\n"; let captcha_usernotice2 = captcha_number[captcha_passp[0]] + "" + captcha_number[captcha_passp[1]] + "" + captcha_number[captcha_passp[2]] + "" + captcha_number[captcha_passp[3]] + ""; let captcha_usernotice3 = captcha_usernotice1 + captcha_usernotice2; var goalSettings = []; cb.settings_choices = []; goalSettings.push({ name: 'pb_enabled', type: 'choice', label: '########################Enable/Disable First Tip Menu', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Enabled' }); goalSettings.push({ name: 'pb_isFanclub', type: 'choice', label: 'Is a FAN CLUB Menu', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Disabled' }); goalSettings.push({ name: 'pb_name', type: 'str', defaultValue: 'Tip Menu', required: true, label: "Name of the 1st Menu" }); goalSettings.push({ name: 'pb_sepchar', type: 'str', defaultValue: ':pinkheart69', required: true, label: "Separator character" }); goalSettings.push({ name: 'pb_showMenu', type: 'str', defaultValue: '/menu;', required: true, label: "Command to show first menu in chat" }); for (var gSetting = 1; gSetting <= pb_MAXITEMS; gSetting++) { goalSettings.push({ name: 'pb_item' + gSetting, type: 'str', required: (gSetting === 1), label: 'Item ' + gSetting + ' (eg 10--flash tits)', }); goalSettings.push({ name: 'pb_item' + gSetting + '_active', label: 'Menu Item ' + gSetting + ' Active', type: 'choice', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Enabled' }); } goalSettings.push( { name: 'pb_noticecolor', type: 'str', label: 'Notice color (html code)', defaultValue: '#0000FF' }, { name: 'pb_chat_ad', type: 'int', minValue: 1, maxValue: 999, defaultValue: 3, label: 'Delay in minutes between first Tip Menu being displayed' }, { name: 'prv_enabled', type: 'choice', label: '########################Enable/Disable Second Tip Menu', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Disabled' }, { name: 'prv_isFanclub', type: 'choice', label: 'Is a FAN CLUB Menu', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Disabled' }, { name: 'prv_name', type: 'str', defaultValue: 'Private Show Menu', required: true, label: "Name of the 2nd Menu" }, { name: 'prv_sepchar', type: 'str', defaultValue: ':pinkheart69', required: true, label: "Separator character" }, { name: 'prv_showMenu', type: 'str', defaultValue: '/menu2', required: true, label: "Command to show second menu in chat" }, ); for (var gSetting = 1; gSetting <= prv_MAXITEMS; gSetting++) { goalSettings.push({ name: 'prv_item' + gSetting, type: 'str', required: (gSetting === 1), label: 'Item ' + gSetting + ' (eg 10--flash tits)', }); goalSettings.push({ name: 'prv_item' + gSetting + '_active', label: 'Menu Item ' + gSetting + ' Active', type: 'choice', choice1: 'Enabled', choice2: 'Disabled', defaultValue: 'Enabled' }); } goalSettings.push( { name: 'prv_noticecolor', type: 'str', label: 'Notice color (html code)', defaultValue: '#FF0000' }, { name: 'prv_chat_ad', type: 'int', minValue: 1, maxValue: 999, defaultValue: 3, label: 'Delay in minutes between second Tip Menu being displayed' }, ); cb.settings_choices = cb.settings_choices.concat(goalSettings); cb.onTip(function (tip) { let skipFan = isFanclub_Tip(tip); const tip_amt = parseInt(tip['amount']); if(!skipFan) { check_Menu(tip); } if (!tip.is_anon_tip) { if (tip['from_user_gender'] === "m") { cb.sendNotice('Well thanks sir, ' + tip['from_user'], '', '', '', 'bold'); } else { cb.sendNotice('Well thank you, ' + tip['from_user'], '', '', '', 'bold'); } } else { cb.sendNotice('Well thank you!', '', '', '', 'bold'); } }); function mn_chatAd(enable, noticecolor, duration, cmpmsg, menuMsg, fontColor = '') { if (isEnabled(enable)) { if (pb_msg != cmpmsg) { cb.sendNotice(menuMsg, '', fontColor, cb.settings[noticecolor], 'bold'); } cb.setTimeout(mn_chatAd, (duration * 60000)); } } cb.onMessage(function (message) { if (message.m.trim().toLowerCase() === "/tipmenu".trim() || message.m.trim().toLowerCase() === "/menu".trim()) { if (isEnabled('pb_enabled')) { message['X-Spam'] = true; cb.sendNotice(pb_msg, message['user'], '', cb.settings['pb_noticecolor'], 'bold'); } if (isEnabled('prv_enabled')) { message['X-Spam'] = true; cb.sendNotice(prv_msg, message['user'], '', cb.settings['prv_noticecolor'], 'bold'); } return message; } if (isEnabled('pb_enabled')) { if (message.m.trim().toLowerCase() === cb.settings['pb_showMenu'].trim().toLowerCase()) { message['X-Spam'] = true; cb.sendNotice(pb_msg, message['user'], '', cb.settings['pb_noticecolor'], 'bold'); return message; } } if (isEnabled('prv_enabled')) { if (message.m.trim().toLowerCase() === cb.settings['prv_showMenu'].trim().toLowerCase()) { message['X-Spam'] = true; cb.sendNotice(prv_msg, message['user'], '', cb.settings['prv_noticecolor'], 'bold'); return message; } } return message; }); function isFanclub_Tip(tip) { const tip_amt = parseInt(tip['amount']); for (var pre of prefixes) { if (isEnabled(pre + '_isFanclub') && isEnabled(pre + '_enabled')) { maxitems = eval(pre + '_MAXITEMS'); tipmenuprice = eval(pre + "_tipmenuprice"); tipmenuitem = eval(pre + "_tipmenuitem"); tippedNoticeBgColor = eval(pre + "_tippedNoticeBgColor"); tippedNoticeColor = eval(pre + "_tippedNoticeColor"); for (let i = 0; i <= maxitems; i++) { if (tip_amt === tipmenuprice[i] && tip.from_user_in_fanclub) { if (!tip.is_anon_tip) { cb.sendNotice(tip['from_user'] + ' tipped for ' + tipmenuitem[i], '', tippedNoticeBgColor, tippedNoticeColor, 'bold'); } else { cb.sendNotice('Someone tipped for ' + tipmenuitem[i], '', tippedNoticeBgColor, tippedNoticeColor, 'bold'); } return true; } } } } return false; } function check_Menu(tip) { const tip_amt = parseInt(tip['amount']); for (var pre of prefixes) { if (isEnabled(pre + '_enabled') && !isEnabled(pre + '_isFanclub')) { maxitems = eval(pre + '_MAXITEMS'); tipmenuprice = eval(pre + "_tipmenuprice"); tipmenuitem = eval(pre + "_tipmenuitem"); tippedNoticeBgColor = eval(pre + "_tippedNoticeBgColor"); tippedNoticeColor = eval(pre + "_tippedNoticeColor"); for (let i = 0; i <= maxitems; i++) { if (tip_amt === tipmenuprice[i]) { if (!tip.is_anon_tip) { cb.sendNotice(tip['from_user'] + ' tipped for ' + tipmenuitem[i], '', tippedNoticeBgColor, tippedNoticeColor, 'bold'); } else { cb.sendNotice('Someone tipped for ' + tipmenuitem[i], '', tippedNoticeBgColor, tippedNoticeColor, 'bold'); } } } } } } function init() { if (isEnabled('pb_enabled')) { pb_separator_char = cb.settings['pb_sepchar'] + ' '; pb_msg = cb.room_slug + ' ' + cb.settings['pb_name'].toString() +':\n'; let pbArr = []; for (let i = 1; i <= pb_MAXITEMS; i++) { pbtmp = cb.settings['pb_item' + i].trim(); if (pbtmp) { pbArr.push(pbtmp); } } pbArr.sort(function (a, b) { let aArr = a.split('--'); let bArr = b.split('--'); let aNum = parseInt(aArr[0]); let bNum = parseInt(bArr[0]); if (aNum < bNum) { return -1; } if (aNum > bNum) { return 1; } return 0; }); for (i = 0; i <= pbArr.length - 1; i++) { const tmp = pbArr[i]; orgIndex = getOrgIndex(tmp, 'pb'); if (tmp) { const arr = tmp.split('--'); if (arr[1] === undefined) { cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no ' + i, cb.room_slug, '', cb.settings['noticecolor'], 'bold'); } else { let amt = parseInt(arr[0]); if (amt > 0) { pb_tipmenuprice[i] = amt; pb_tipmenuitem[i] = arr[1]; temp = pb_separator_char + ' ' + arr[1] + ': ' + amt + '\n'; let j = i + 1; if (i === pbArr.length - 1 || (i < pbArr.length - 1 && cb.settings['pb_item' + j].length === 0)) { temp = pb_separator_char + ' ' + arr[1] + ': ' + amt; } if (isMenuItemActive('pb_item', orgIndex)) { pb_msg += temp; } } } } } } if (isEnabled('prv_enabled')) { cb.sendNotice('bot created by devfs\nyou want your own bot?\ mail at devfs@wegbuxen.biz', cb.room_slug, '#000000', '#FFFF00', 'bold'); prv_separator_char = cb.settings['prv_sepchar'] + ' '; prv_msg = cb.settings['prv_name'] + '\n'; let prvArr = []; for (let i = 1; i <= prv_MAXITEMS; i++) { prvtmp = cb.settings['prv_item' + i]; if (prvtmp) { prvArr.push(prvtmp); } } prvArr.sort(function (a, b) { let aArr = a.split('--'); let bArr = b.split('--'); let aNum = parseInt(aArr[0]); let bNum = parseInt(bArr[0]); if (aNum < bNum) { return -1; } if (aNum > bNum) { return 1; } return 0; }); for (i = 0; i <= prvArr.length - 1; i++) { let tmp = prvArr[i]; orgIndex = getOrgIndex(tmp, 'prv'); if (tmp) { let arr = tmp.split('--'); if (arr[1] === undefined) { cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no ' + i, cb.room_slug, '', cb.settings['noticecolor'], 'bold'); } else { let amt = parseInt(arr[0]); if (amt > 0) { prv_tipmenuprice[i] = amt; prv_tipmenuitem[i] = arr[1]; temp = prv_separator_char + ' ' + arr[1] + ': ' + amt + '\n'; let j = i + 1; if (i === prvArr.length - 1 || (i < prvArr.length - 1 && cb.settings['prv_item' + j].length === 0)) { temp = prv_separator_char + ' ' + arr[1] + ': ' + amt; } if (isMenuItemActive('prv_item', orgIndex)) { prv_msg += temp; } } } } } } } function isEnabled(value) { if (cb.settings[value] === 'Enabled') { return true; } return false; } function randomIntFromInterval(min, max) { return Math.floor(Math.random() * (max - min + 1) + min) } function isModerator(message) { if (message.is_mod || message.user === cb.room_slug) { return true; } return false; } function getOrgIndex(item, prefix) { for (let i = 1; i <= prv_MAXITEMS; i++) { let tmp = cb.settings[prefix + '_item' + i]; if (tmp === item) { return i; } } } function isMenuItemActive(menu, num) { if (cb.settings[menu + num + '_active'] === 'Enabled') { return true; } return false; } function prv_chatAd() { if (isEnabled('prv_enabled')) { cb.sendNotice(prv_msg, '', '', cb.settings['prv_noticecolor'], 'bold'); cb.setTimeout(prv_chatAd, (cb.settings.prv_chat_ad * 60000)); } } function pb_chatAd() { if (isEnabled('pb_enabled')) { cb.sendNotice(pb_msg, '', '', cb.settings['pb_noticecolor'], 'bold'); cb.setTimeout(pb_chatAd, (cb.settings.pb_chat_ad * 60000)); } } cb.setTimeout(prv_chatAd, (cb.settings.prv_chat_ad * 60000)); cb.setTimeout(pb_chatAd, (cb.settings.pb_chat_ad * 60000)); init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.