Bots Home
|
Create an App
Rumata notifier
Author:
rumataestor
Description
Source Code
Launch Bot
Current Users
Created by:
Rumataestor
/* Title: "Rotating Notifier" bot Author: badbadbubba Version: 1.1 (03/07/2015) A simple rotating notifier bot. Only options are to set color and display interval. Messages are rotated in sequence. Message 1 will also be displayed on room entry privately. V1.0.1 - Removed unnecessary check for valid first messages V1.0.2 - Increase messages to 5 V1.0.3 - Added option to display msg1 on room entry V1.1 - Optimized code, expanded to 10 lines */ // цвета 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'; var mycolor = ''; var i=0; var MAXITEMS=10; cb.settings_choices = [ {name: 'msgonentry', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: 'Display Message 1 and 2 privately on entry'}, {name:'msg1', type:'str', required: true, label:'Message 1',}, {name:'msg2', type:'str', required: false, label:'Message 2',}, {name:'msg3', type:'str', required: false, label:'Message 3',}, {name:'msg4', type:'str', required: false, label:'Message 4',}, {name:'msg5', type:'str', required: false, label:'Message 5',}, {name:'msg6', type:'str', required: false, label:'Message 6',}, {name:'msg7', type:'str', required: false, label:'Message 7',}, {name:'msg8', type:'str', required: false, label:'Message 8',}, {name:'msg9', type:'str', required: false, label:'Message 9',}, {name:'msg10', type:'str', required: false, label:'Message 10',}, {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: 'chat_ad', type:'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay in minutes between notices being displayed (minimum 1)'} ]; cb.onEnter(function(user) { if (cb.settings['msgonentry'] == 'yes') { cb.sendNotice(cb.settings['msg1'],user['user'],'',mycolor,''); cb.sendNotice(cb.settings['msg2'],user['user'],'',mycolor,''); } }); function chatAd() { var msg; while (cb.settings['msg' + (i + 1)] == 0) { //skip empty messages i++; i %= MAXITEMS; } msg = cb.settings['msg' + (i + 1)]; i++; i %= MAXITEMS; cb.sendNotice(msg,'','',mycolor,''); cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); function init() { 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'; } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.