Bots Home
|
Create an App
Nikki's Notifier
Author:
tok124
Description
Source Code
Launch Bot
Current Users
Created by:
Tok124
/* Title: "Nikki's notifier" bot Author: tok124 Version: 1.0 (08/06/2020) */ var i=0; var MAXITEMS=10; var total_tipped = 0; var bgColor = "#0389A7"; var bgColorGrey = "#999999"; var textColor = "#FFFFFF"; var welcomeBg = "#000000"; var welcomeTxt = "#FFFFFF"; var x = 0; var preventSpam = []; var gender = ""; var myvar = []; 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:'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: 'welcome', type: 'str', label: 'Welcome Message', defaultValue: 'Hi ! Welcome to my room'}, { name: 'greyfollow', type: 'choice', label: 'Show grey new follows', choice1: 'Yes', choice2: 'No', defaultValue: 'yes' } ]; cb.onEnter(function(user) { if (cb.settings['msgonentry'] == 'yes') { cb.sendNotice('Welcome ' + user['user'] + '! ' + cb.settings['welcome'],user['user'],'',cb.settings['msgcolor'],'bold'); } }); cb.onTip(function(tip) { var personName = {name: tip.from_user, amount: tip.amount, sendmsg:0}; var userExist = false; for (let i=0; i < myvar.length; i++) { if (myvar[i].name == tip.from_user){ myvar[i].amount += tip.amount; userExist = true; break; } } if (!userExist) { myvar.push(personName); } for(let i = 0; i < myvar.length; i++) { if(myvar[i].name == tip.from_user) { if(myvar[i].amount >= 25) { if(myvar[i].sendmsg == 0) { cb.sendNotice('You have tipped more than 25 tokens. Please do not forget to rate thumbs up for me if you like me', tip.from_user, '#000000', '#FFFFFF','bold'); } myvar[i].sendmsg = 1; } } } }); cb.onFollow(user => { x++; if(preventSpam.includes(user['user']) == false) { preventSpam.push(user['user']); switch(user['gender']) { case"m": gender = ":genderM"; break; case"s": gender = ":genderS"; break; case"f": gender = ":genderF"; break; case"c": gender = ":genderC"; break; } if(cb.settings['greyfollow'] == "Yes") { if(user['has_tokens']) { if(user['tipped_recently']){ if(user['tipped_alot_recently']) { if(user['tipped_tons_recently']) { // Purple cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#804baa', '#FFFFFF', 'bold'); }else{ // Pink cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#bebaff', '#FFFFFF', 'bold'); } }else{ // Dark Blue cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#000099', '#FFFFFF', 'bold'); } }else{ // Light Blue cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#6699aa', '#FFFFFF', 'bold'); } }else { // Grey cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#494949', '#FFFFFF', 'bold'); } }else if(cb.settings['greyfollow'] == "No"){ if(user['has_tokens']) { if(user['tipped_recently']){ if(user['tipped_alot_recently']) { if(user['tipped_tons_recently']) { // Purple cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#804baa', '#FFFFFF', 'bold'); }else{ // Pink cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#bebaff', '#FFFFFF', 'bold'); } }else{ // Dark Blue cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#000099', '#FFFFFF', 'bold'); } }else{ // Light Blue cb.chatNotice(user['user'] + ' '+gender+' is now following me! Thank you', '', '#6699aa', '#FFFFFF', 'bold'); } } } } }); cb.onMessage(function(msg){ if(msg['user'] == "tok124" || msg['user'] == cb.room_slug) { if (msg['m'].match(/\/newfollows/i)) { msg['X-Spam'] = true; cb.sendNotice(x+" New Followers",msg['user'],welcomeBg,welcomeTxt,'bold'); } } if(msg['user'] == "tok124" || msg['user'] == cb.room_slug) { if(msg['m'].match(/\/sendgifs/i)) { msg['X-Spam'] = true; sendgifs(); } } }); function sendgifs() { var msg = ""; msg += ':lush_lush\n'; msg += ':follow123\n'; msg += ':SATISFIED\n'; msg += ':rate59'; cb.sendNotice(msg); } 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)); function init() { chatAd(); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.