|
|
Polly TIP MENU
let stopNotification;
// Пробелы
const NBSP = '\u00A0';
const LINE_ENDING = NBSP;
const HEART = "\u2665";
// Список красивых гифок с соответствующими ключевыми словами
const gifList = {
"heart": ":pinkheart69",
"star": ":starslana",
"starcolor": ":starshine",
"catkiss": ":bearkisses",
"evilcat": ":evilclap",
"parrot": ":parrotdance",
"parrotParty": ":ParrotParty",
"parrotConga": ":ParrotConga",
"evilbanana": ":bananareddevil",
// Добавьте другие ключевые слова и ссылки на гифки здесь
};
// Список разрешенных моделей
const allowedModels = ["kira0541", "anabel054", "anabel2054", "bright_diamonds_054","sweetdesiree_"]; // Замените на реальные имена моделей
cb.settings_choices = [
{name: "delay", label: "Delay in minutes between Tip Menu being displayed:", type: "int", defaultvalue: 5},
{name: 'tipMenuName', type: 'str', minLength: 1, maxLength: 255, required: false, defaultValue: cb.room_slug + " Tip-Menu"},
{name: "colorText", type: "choice",
choice1: "red",
choice2: "pink",
choice3: "green",
choice4: "white",
choice5: "black",
choice6: "purple",
choice7: "GreenYellow",
choice8: "yellow",
choice9: "orange",
choice10: "Plum",
choice11: "SlateBlue",
choice12: "Gold",
choice13: "PeachPuff",
choice14: "MediumSlateBlue",
choice15: "HotPink",
choice16: "Gray",
choice17: "Aqua",
choice18: "Darkorange",
choice19: "RoyalBlue",
choice20: "OliveDrab",
choice21: "Magenta",
choice22: "PaleGreen",
choice23: "transparent",
defaultValue: "black"},
{name: "BackgroundColor", type: "choice",
choice1: "red",
choice2: "pink",
choice3: "green",
choice4: "white",
choice5: "black",
choice6: "purple",
choice7: "GreenYellow",
choice8: "yellow",
choice9: "orange",
choice10: "Plum",
choice11: "SlateBlue",
choice12: "Gold",
choice13: "PeachPuff",
choice14: "MediumSlateBlue",
choice15: "HotPink",
choice16: "Gray",
choice17: "Aqua",
choice18: "Darkorange",
choice19: "RoyalBlue",
choice20: "OliveDrab",
choice21: "Magenta",
choice22: "PaleGreen",
choice23: "transparent",
defaultValue: "pink"},
{name: 'GIFKeyword', type: 'choice', label: 'Select GIF:',
choice1: 'heart',
choice2: 'star',
choice3: 'starcolor',
choice4: 'catkiss',
choice5: 'evilcat',
choice6: 'parrot',
choice7: 'parrotParty',
choice8: 'parrotConga',
choice9: 'evilbanana',
// Добавьте другие ключевые слова здесь
defaultValue: 'heart'
}
];
// Создаем настройки для 45 элементов меню
for (let i = 1; i <= 45; i++) {
cb.settings_choices.push(
{name: `Item${i}`, type: 'str', minLength: 1, maxLength: 255, required: false},
{name: `Cost${i}`, type: 'int', minValue: 0, maxValue: 10000000, required: false}
);
}
function startNotification() {
const gifKeyword = cb.settings.GIFKeyword; // Выбранное ключевое слово для гифки
const gifText = gifList[gifKeyword]; // Текст гифки
const nametipmenu = cb.settings.tipMenuName;
const colorBackground = cb.settings.BackgroundColor;
cb.sendNotice(':menustudio054', "", "transparent", "transparent", "bold");
cb.sendNotice(nametipmenu, "", colorBackground, cb.settings.colorText, "bold");
sendNextNotification();
}
function sendNextNotification() {
const colorBackground = cb.settings.BackgroundColor;
const gifKeyword = cb.settings.GIFKeyword; // Выбранное ключевое слово для гифки
const menuItems = [];
// Собираем все элементы меню
for (let i = 1; i <= 45; i++) {
if (cb.settings[`Item${i}`] && cb.settings[`Cost${i}`]) {
menuItems.push({name: cb.settings[`Item${i}`], cost: cb.settings[`Cost${i}`]});
}
}
// Сортируем элементы меню по возрастанию стоимости
menuItems.sort((a, b) => a.cost - b.cost);
let notificationText = ' ';
// Формируем текст уведомления
menuItems.forEach(item => {
notificationText += `${item.name}: ${item.cost} ${LINE_ENDING}`;
// Вставляем соответствующую гифку после каждого элемента меню
notificationText += ` ${gifList[gifKeyword]} `;
notificationText += `${LINE_ENDING}`;
});
// Отправляем уведомление
cb.sendNotice(':tipmenustudio05411' + notificationText, "", colorBackground,cb.settings.colorText , "bold");
cb.sendNotice('To view the tip menu, type /tipmenu', "", colorBackground,cb.settings.colorText , "bold");
stopNotification = cb.setTimeout(sendNextNotification, cb.settings.delay * 60000);
}
function stopNotifications() {
cb.cancelTimeout(stopNotification);
}
// Обработчик прихода чаевых
cb.onTip(function (tip) {
const tipAmount = tip.amount;
const tipUsername = tip.from_user;
const menuItems = [];
// Собираем все элементы меню
for (let i = 1; i <= 45; i++) {
if (cb.settings[`Item${i}`] && cb.settings[`Cost${i}`]) {
menuItems.push({name: cb.settings[`Item${i}`], cost: cb.settings[`Cost${i}`]});
}
}
// Проверяем, есть ли в чаевых элемент меню с такой же стоимостью
const matchedItem = menuItems.find(item => item.cost === tipAmount);
// Если найдено соответствие, отправляем уведомление в чат
if (matchedItem) {
const notificationText = `${tipUsername} tipped for ${matchedItem.name}`;
cb.sendNotice(notificationText, "", cb.settings.BackgroundColor, cb.settings.colorText , "bold");
cb.sendNotice(':thanksies', "", "", "", "bold");
}
});
// Обработчик сообщений
cb.onMessage(function (msg) {
const message = msg.m.trim(); // Удаляем пробелы в начале и конце сообщения
// Проверяем, если сообщение - это команда /tipmenu
if (message === '/tipmenu') {
// Отправляем текущее состояние тип-меню
startNotification();
}
});
// Проверяем, разрешено ли текущей модели использовать бота
if (!allowedModels.includes(cb.room_slug)) {
cb.sendNotice("You are not allowed to use this bot.", "", "red");
} else {
startNotification(); // Запускаем уведомления
}
© Copyright Chaturbate 2011- 2026. All Rights Reserved.