Bots Home
|
Create an App
Momotestbot
Author:
mynamewasused
Description
Source Code
Launch Bot
Current Users
Created by:
Mynamewasused
/* Title: "CutieMomo's Bot" bot Author: mynamewasused Version: 1.0.2 (09/10/2016) App to handle cutiemomo's room. Will be expanded over time. V1.0 - Release with rotating notifier and NekoKnights V1.0.1 - Birthday show features added V1.0.2 - Fixes for Birthday show features V1.0.3 - Removed Birthday features */ var i=0; var MAXITEMS=15; cb.settings_choices = [ {name: 'msgonentry', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Display Message 1 privately on entry - set to no for busy rooms"}, {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:'msg11', type:'str', required: false, label:'Message 11',}, {name:'msg12', type:'str', required: false, label:'Message 12',}, {name:'msg13', type:'str', required: false, label:'Message 13',}, {name:'msg14', type:'str', required: false, label:'Message 14',}, {name:'msg15', type:'str', required: false, label:'Message 15',}, {name:'msgcolor', type:'str', label:'Notice color (html code default dark red #9F000F)', defaultValue: '#9F000F'}, {name: 'chat_ad', type:'int', minValue: 1, maxValue: 999, defaultValue: 2, label: 'Delay in minutes between notices being displayed (minimum 1)'}, {name:'fanclubicon', type:'str', label:'Icon for regular fanclub members', defaultValue: ':momosenpai1png'}, {name:'club1Icon', type:'str', label:'Icon for Club 1 members', defaultValue: '', required:false}, {name:'club2Icon', type:'str', label:'Icon for Club 2 members', defaultValue: '', required:false}, {name:'club3Icon', type:'str', label:'Icon for Club 3 members', defaultValue: '', required:false}, {name:'club4Icon', type:'str', label:'Icon for Club 4 members', defaultValue: '', required:false}, {name:'club5Icon', type:'str', label:'Icon for Club 5 members', defaultValue: '', required:false}, {name:'club6Icon', type:'str', label:'Icon for Club 6 members', defaultValue: '', required:false}, {name:'club7Icon', type:'str', label:'Icon for Club 7 members', defaultValue: '', required:false}, {name:'club8Icon', type:'str', label:'Icon for Club 8 members', defaultValue: '', required:false}, {name:'club9Icon', type:'str', label:'Icon for Club 9 members', defaultValue: '', required:false}, {name:'club10Icon', type:'str', label:'Icon for Club 10 members', defaultValue: '', required:false}, {name:'club1', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 1 members seperated by commas', required:false}, {name:'club2', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 2 members seperated by commas', required:false}, {name:'club3', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 3 members seperated by commas', required:false}, {name:'club4', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 4 members seperated by commas', required:false}, {name:'club5', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 5 members seperated by commas', required:false}, {name:'club6', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 6 members seperated by commas', required:false}, {name:'club7', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 7 members seperated by commas', required:false}, {name:'club8', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 8 members seperated by commas', required:false}, {name:'club9', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 9 members seperated by commas', required:false}, {name:'club10', type:'str', minLength: 1, maxLength: 1000, defaultValue: '', label:'Club 10 members seperated by commas', required:false}, {name:'club10EntryMessage', type:'str', minLength: 1, maxLength: 1000, defaultValue:'', label:'Club 10 entry message (type (user) where user name should go)', required:false}, {name:'club1TipAmount', type:'int', label:'Tip amount to join club 1 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club2TipAmount', type:'int', label:'Tip amount to join club 2 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club3TipAmount', type:'int', label:'Tip amount to join club 3 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club4TipAmount', type:'int', label:'Tip amount to join club 4 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club5TipAmount', type:'int', label:'Tip amount to join club 5 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club6TipAmount', type:'int', label:'Tip amount to join club 6 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club7TipAmount', type:'int', label:'Tip amount to join club 7 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club8TipAmount', type:'int', label:'Tip amount to join club 8 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club9TipAmount', type:'int', label:'Tip amount to join club 9 (0 = manual adding only)', defaultValue: 0, required:false}, {name:'club10TipAmount', type:'int', label:'Tip amount to join club 10 (0 = manual adding only)', defaultValue: 0, required:false} ]; var clubArray1 = new Array; var clubArray2 = new Array; var clubArray3 = new Array; var clubArray4 = new Array; var clubArray5 = new Array; var clubArray6 = new Array; var clubArray7 = new Array; var clubArray8 = new Array; var clubArray9 = new Array; var clubArray10 = new Array; var numMembersClub1 = 0; var numMembersClub2 = 0; var numMembersClub3 = 0; var numMembersClub4 = 0; var numMembersClub5 = 0; var numMembersClub6 = 0; var numMembersClub7 = 0; var numMembersClub8 = 0; var numMembersClub9 = 0; var numMembersClub10 = 0; function initClubs(){ if(cb.settings.club1 != '' && cb.settings.club1 != null){ var clublist = cb.settings.club1; clubArray1 = clublist.split(', '); numMembersClub1 = clubArray1.length; } if(cb.settings.club2 != '' && cb.settings.club2 != null){ var clublist = cb.settings.club2; clubArray2 = clublist.split(', '); numMembersClub2 = clubArray2.length; } if(cb.settings.club3 != '' && cb.settings.club3 != null){ var clublist = cb.settings.club3; clubArray3 = clublist.split(', '); numMembersClub3 = clubArray3.length; } if(cb.settings.club4 != '' && cb.settings.club4 != null){ var clublist = cb.settings.club4; clubArray4 = clublist.split(', '); numMembersClub4 = clubArray4.length; } if(cb.settings.club5 != '' && cb.settings.club5 != null){ var clublist = cb.settings.club5; clubArray5 = clublist.split(', '); numMembersClub5 = clubArray5.length; } if(cb.settings.club6 != '' && cb.settings.club6 != null){ var clublist = cb.settings.club6; clubArray6 = clublist.split(', '); numMembersClub6 = clubArray6.length; } if(cb.settings.club7 != '' && cb.settings.club7 != null){ var clublist = cb.settings.club7; clubArray7 = clublist.split(', '); numMembersClub7 = clubArray7.length; } if(cb.settings.club8 != '' && cb.settings.club8 != null){ var clublist = cb.settings.club8; clubArray8 = clublist.split(', '); numMembersClub8 = clubArray8.length; } if(cb.settings.club9 != '' && cb.settings.club9 != null){ var clublist = cb.settings.club9; clubArray9 = clublist.split(', '); numMembersClub9 = clubArray9.length; } if(cb.settings.club10 != '' && cb.settings.club10 != null){ var clublist = cb.settings.club10; clubArray10 = clublist.split(', '); numMembersClub10 = clubArray10.length; } } /*----------------------------BEGIN-----------------------------------*/ //NekoKnights icon cb.onMessage(function(message){ var cmd = 0; var msg = message['m'].split(' '); if(msg[0].charAt(0) =='/'){ message['X-Spam'] = true; if(msg[0] == '/addclubmember' && (message['is_mod'] || message['user'] == 'cutiemomo')){ if(msg[1] == '1'){ clubArray1[numMembersClub1] = msg[2]; numMembersClub1++; } else if(msg[1] == '2'){ clubArray2[numMembersClub2] = msg[2]; numMembersClub2++; } else if(msg[1] == '3'){ clubArray3[numMembersClub3] = msg[2]; numMembersClub3++; } else if(msg[1] == '4'){ clubArray4[numMembersClub4] = msg[2]; numMembersClub4++; } else if(msg[1] == '5'){ clubArray5[numMembersClub5] = msg[2]; numMembersClub5++; } else if(msg[1] == '6'){ clubArray6[numMembersClub6] = msg[2]; numMembersClub6++; } else if(msg[1] == '7'){ clubArray7[numMembersClub7] = msg[2]; numMembersClub7++; } else if(msg[1] == '8'){ clubArray8[numMembersClub8] = msg[2]; numMembersClub8++; } else if(msg[1] == '9'){ clubArray9[numMembersClub9] = msg[2]; numMembersClub9++; } else if(msg[1] == '10'){ clubArray10[numMembersClub10] = msg[2]; numMembersClub10++; } } } if(cbjs.arrayContains(clubArray10, message['user'])){ message['m'] = cb.settings['club10Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray9, message['user'])){ message['m'] = cb.settings['club9Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray8, message['user'])){ message['m'] = cb.settings['club8Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray7, message['user'])){ message['m'] = cb.settings['club7Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray6, message['user'])){ message['m'] = cb.settings['club6Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray5, message['user'])){ message['m'] = cb.settings['club5Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray4, message['user'])){ message['m'] = cb.settings['club4Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray3, message['user'])){ message['m'] = cb.settings['club3Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray2, message['user'])){ message['m'] = cb.settings['club2Icon'] + ' ' + message['m']; } if(cbjs.arrayContains(clubArray1, message['user'])){ message['m'] = cb.settings['club1Icon'] + ' ' + message['m']; } if(message['in_fanclub']){ message['m'] = cb.settings['fanclubicon'] + ' ' + message['m']; } return message; }); /*------------------------------END-----------------------------------*/ /*----------------------------BEGIN-----------------------------------*/ //Entry message cb.onEnter(function(user) { if (cb.settings['msgonentry'] == 'yes') { cb.sendNotice('Welcome ' + user['user'] + '! ' + cb.settings['msg1'],user['user'],'',cb.settings['msgcolor'],'bold'); } if (cbjs.arrayContains(clubArray10, user['user'])) { var tempmessage = cb.settings['club10EntryMessage']; tempmessage = tempmessage.replace('(user)', user['user']); cb.sendNotice(tempmessage,'','',cb.settings['msgcolor'],'bold'); } }); /*------------------------------END-----------------------------------*/ /*----------------------------BEGIN-----------------------------------*/ cb.onTip(function(tip){ switch(parseInt(tip['amount'])){ case cb.settings['club1TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray1[numMembersClub1] = tip['from_user']; numMembersClub1++; break; case cb.settings['club2TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray2[numMembersClub2] = tip['from_user']; numMembersClub2++; break; case cb.settings['club3TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray3[numMembersClub3] = tip['from_user']; numMembersClub3++; break; case cb.settings['club4TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray4[numMembersClub4] = tip['from_user']; numMembersClub4++; break; case cb.settings['club5TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray5[numMembersClub5] = tip['from_user']; numMembersClub5++; break; case cb.settings['club6TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray6[numMembersClub6] = tip['from_user']; numMembersClub6++; break; case cb.settings['club7TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray7[numMembersClub7] = tip['from_user']; numMembersClub7++; break; case cb.settings['club8TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray8[numMembersClub8] = tip['from_user']; numMembersClub8++; break; case cb.settings['club9TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray9[numMembersClub9] = tip['from_user']; numMembersClub9++; break; case cb.settings['club10TipAmount']: cb.chatNotice("Thank you " + tip['from_user'] + "! Welcome to my fan club!",'','',cb.settings['msgcolor'],'bold'); clubArray10[numMembersClub10] = tip['from_user']; numMembersClub10++; break; default: break; } }); /*------------------------------END-----------------------------------*/ /*----------------------------BEGIN-----------------------------------*/ //Rotating notifier 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,'','',cb.settings['msgcolor'],'bold'); cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); /*------------------------------END-----------------------------------*/ /*INIT*/ function init() { initClubs(); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.