Bots Home
|
Create an App
Rumata roll
Author:
rumataestor3
Description
Source Code
Launch Bot
Current Users
Created by:
Rumataestor3
/** * App: * Version: * Author: * Date: */ // цвета var danger = '#cc0000'; var warning = '#ff8800'; var success = '#007e33'; var info = '#0099cc'; var defcolor = '#2bbbad'; var primary = '#4285f4'; var secondary = '#aa66cc'; var white = '#ffffff'; var black = '#000000'; cb.settings_choices = [ {name: 'tokens', type: 'int', required: true, minValue: 1, maxValue: 1000, label: 'How much tokens for spin the wheels', defaultValue: 24}, {name: 'counter', type: 'int', required: true, minValue: 0, maxValue: 100, label: 'A rare prize will be played after ... games (0 - never)', defaultValue: 0}, {name:'notice_period', type:'int', minValue:1, maxValue:20, defaultValue:10, label: 'Send a message to the chat every ... (1-20 min.)'}, {name:'msgcolor', type: 'choice', choice1: 'info', choice2: 'danger', choice3: 'warning', choice4: 'success', choice5: 'defcolor', choice6: 'primary', choice7: 'secondary', choice8: 'black', defaultValue: 'info', label: 'Notice color (default "info")'}, {name: 'prize_1', type: 'str', required: true, label: 'Prize #1', defaultValue: 'Flash feet'}, {name: 'prize_2', type: 'str', required: true, label: 'Prize #2', defaultValue: 'Play with nipples'}, {name: 'prize_3', type: 'str', required: true, label: 'Prize #3', defaultValue: 'Flex muscles'}, {name: 'prize_4', type: 'str', required: true, label: 'Prize #4', defaultValue: 'Flash butt'}, {name: 'prize_5', type: 'str', required: true, label: 'Prize #5', defaultValue: 'Flash armpits'}, {name: 'prize_6', type: 'str', required: true, label: 'Prize #6', defaultValue: 'Spank ass'}, {name: 'prize_7', type: 'str', required: true, label: 'Prize #7', defaultValue: '5 naked push ups'}, {name: 'prize_8', type: 'str', required: true, label: 'Prize #8', defaultValue: '5 naked squats'}, {name: 'prize_9', type: 'str', required: true, label: 'Prize #9', defaultValue: 'Flash balls'}, {name: 'prize_10', type: 'str', required: true, label: 'Prize #10', defaultValue: 'Flash cock'}, {name: 'prize_11', type: 'str', required: true, label: 'Prize #11', defaultValue: 'Flash cockhead'}, {name: 'prize_12', type: 'str', required: true, label: 'Prize #12 (rare)', defaultValue: '💦 Cumshow right now'}, ]; cb.onEnter(function(user) { //cb.setTimeout(function() { ads(user['user']); }, 30000); setTimeout(() => { cb.sendNotice('@' + user['user'] + ', let\'s play Wheel of Fortune with me. Tip ' + cb.settings.tokens + ' tokens to win one of 12 prizes. The number of bets in a row is unlimited.', user['user'], '', mycolor, 'bold'); cb.sendNotice('You can win a Super prize. "' + cb.settings['prize_12'] + '" for just ' + cb.settings.tokens + ' tokens!', user['user'], mycolor, white, 'bold'); cb.sendNotice('Please spin the Wheel, luck is kind to you!', user['user'], '', mycolor, 'bold'); cb.sendNotice(prizes_list, user['user'], '', '', 'bold'); }, 10000); }); cb.onTip(function (tip) { if (parseInt(tip['amount']) == cb.settings.tokens) { var q = getRandom(counter, flag); counter++; // если должен выпасть сразу if (now == 1) { q = 12; } //cb.sendNotice('flag ' + flag + ' count ' + counter, '', '', '', ''); cb.sendNotice(':mediumwheel-ad2\n@' + tip['from_user'] + ' has rolled #' + q + '! Prize is...', '', '', mycolor, 'bold'); cb.setTimeout(function() { callme(q, tip['from_user']); }, 6000); cb.setTimeout(function() { again(tip['from_user']); }, 60000); // отключаем режим "выпасть сразу" if (now == 1) { now = 0; } } }); // сообщение о призе function callme(q, user) { // если редкий - другой цвет сообщения if (q == 12) { cb.sendNotice('Wow! We have a winner! Congratulations! Well done!', '', '', danger, 'bold'); cb.sendNotice('@' + user + ' won a Super prize "' + cb.settings['prize_' + q] + '".', '', '', danger, 'bold'); } else { cb.sendNotice('Prize is "' + cb.settings['prize_' + q] + '". Congratulations!', '', '', mycolor, 'bold'); } } // function ads(user) { // cb.sendNotice(':wheel2\nLet\'s play Wheel of Fortune with me. Tip ' + cb.settings.tokens + ' tokens to win one of 12 prizes. The number of bets in a row is unlimited.', user, '', mycolor, 'bold'); // cb.sendNotice('You can win a super prize. "' + cb.settings['prize_12'] + '" for ' + cb.settings.tokens + ' tokens only!', user, mycolor, white, 'bold'); // cb.sendNotice('Plaese spin the Wheel, luck is kind to you!', user, '', mycolor, 'bold'); // cb.sendNotice(prizes_list, user, '', '', 'bold'); // } // приглашение играть еще раз function again(user) { //cb.sendNotice('@' + user + ', would you like to spin the Wheel again? It\'s gambling!', user, '', mycolor, 'bold'); } // периодическое сообщение в чате function chatAd() { printMessage (prizes_list); cb.setTimeout(chatAd, (cb.settings.notice_period * 60000)); } cb.setTimeout(chatAd, (cb.settings.notice_period * 60000)); // получение случайного числа function getRandom(counter, flag) { // если количество игр больше установленного и редкий разрешен, играет 12 if (counter >= cb.settings.counter && flag == 1) { //cb.sendNotice('Rare prize mod is on!', cb.room_slug, mycolor, white, 'bold'); return Math.floor(Math.random() * 12) + 1; //Максимум и минимум включаются } else { return Math.floor(Math.random() * 11) + 1; //Максимум и минимум включаются } } // сообщение в чат об игре function printMessage (prizes_list) { cb.sendNotice(':wheel2\nLet\'s play Wheel of Fortune with me. Tip ' + cb.settings.tokens + ' tokens to win one of 12 prizes. The number of bets in a row is unlimited.', '', '', mycolor, 'bold'); cb.sendNotice('You can win a Super prize. "' + cb.settings['prize_12'] + '" for just ' + cb.settings.tokens + ' tokens!', '', mycolor, white, 'bold'); cb.sendNotice('Please spin the Wheel, luck is kind to you!', '', '', mycolor, 'bold'); cb.sendNotice(prizes_list, '', '', '', 'bold'); } // команды cb.onMessage(function (msg) { // если модератор или бродкастер if (msg['is_mod'] == true || msg['user'] == cb.room_slug) { // информация if (msg['m'] == '/winfo') { msg['X-Spam'] = true; msg['m'] = ''; cb.sendNotice('Games have played ' + counter + ' times\nYou have collected ' + counter*cb.settings.tokens + ' tokens',msg['user'],'',warning,''); if (flag == 1) { cb.sendNotice('A Rare prize is on',msg['user'],'',warning,''); } else { cb.sendNotice('A Rare prize is off',msg['user'],'',warning,''); } } // включить редкий приз if (msg['m'] == '/rareon') { msg['X-Spam'] = true; flag = 1; msg['m'] = ''; cb.sendNotice('You have enabled a Rare prize',msg['user'],'',warning,''); } // выключить редкий приз if (msg['m'] == '/rareoff') { msg['X-Spam'] = true; flag = 0; msg['m'] = ''; cb.sendNotice('You have disabled a Rare prize',msg['user'],'',warning,''); } // редкий приз выпадет сразу при первом же броске if (msg['m'] == '/now') { msg['X-Spam'] = true; now = 1; msg['m'] = ''; cb.sendNotice('Rare prize will roll at the first spin',msg['user'],'',warning,''); } if (msg['m'] == '/help') { msg['X-Spam'] = true; msg['m'] = ''; cb.sendNotice('/help - Show this text (only for broadcaster and moderator)',msg['user'],'',warning,''); cb.sendNotice('/winfo - Shows statistics: the number of games played, the number of tokens earned on the game, the Rare Prize mode is enabled or disabled.',msg['user'],'',warning,''); cb.sendNotice('/rareon - Enables Rare Prize mode. Rare Prize is participating in the game and can roll randomly.',msg['user'],'',warning,''); cb.sendNotice('/rareoff - Disables the Rare Prize mode. A Rare Prize will never roll.',msg['user'],'',warning,''); cb.sendNotice('/now - Enables forced Rare Prize mode. A Rare Prize will roll in the first game. It will roll, even if it\'s disabled.',msg['user'],'',warning,''); } if (msg['m'] == '/test') { msg['X-Spam'] = true; //msg['m'] = ''; } return msg; } else { if (msg['m'] == '/help') { msg['X-Spam'] = true; cb.sendNotice('It\'s a simple game. There are 12 prizes, including one Super Prize. Today my super prize is a "' + cb.settings['prize_12'] + '". You send ' + cb.settings.tokens + ' tokens. The bot randomly selects one from the list of prizes and shows it in the chat. Please play, I hope you\'re lucky!',msg['user'],'',info,''); } return msg; } }); function init() { // счетчик counter = 0; // flag 0 - редкий при не выпадет, 1 - выпадет flag = 0; if (cb.settings.counter != 0) { flag = 1; } // now = 0 - редкий при выпадет при первом броске сразу после команды now = 0; // собираем список призов prizes_list = 'Here is the list of prizes\n'; for (i=1; i<= 12; i++) { prizes_list += i + '. ' + cb.settings['prize_' + i] + '\n' } // выбор цвета по умолчению switch (cb.settings['msgcolor']) { case 'danger': mycolor = '#cc0000'; break; case 'warning': mycolor = '#ff8800'; break; case 'success': mycolor = '#007e33'; break; case 'defcolor': mycolor = '#2bbbad'; break; case 'primary': mycolor = '#4285f4'; break; case 'secondary': mycolor = '#aa66cc'; break; case 'white': mycolor = '#ffffff'; break; case 'black': mycolor = '#000000'; break; default: mycolor = '#0099cc'; } printMessage (prizes_list); cb.sendNotice('Use the command /help and you will be happy!',cb.room_slug,'',info,''); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.