Bots Home
|
Create an App
PeppersTheCat
Author:
jaydesanon
Description
Source Code
Launch Bot
Current Users
Created by:
Jaydesanon
/* Peppers App v1.0 This app will let Peppers say something random every 10 minutes. Commands: !peppers - This will trigger Peppers to say something immediately !peppers start - If Peppers was stopped, this will renable him !peppers stop - This will stop Peppers from talking until you start him again !peppers set-time <minutes> - This will change the interval at which Peppers talks */ // vars var peppers_imgs = [':peppers-bowtie', ':peppers-car', ':peppers-food', ':peppers-coffee', ':peppers-sink']; var jayde_cats_imgs = [':caesar-sink']; var controllers = ['jaydesanon', 'famousjayde', cb.room_slug]; var enabled = true; var peppers_timer = 0; var time_interval = 10; var phrases = ['meow', 'nyaa!', 'mrrow', 'Good aftermeown', 'prrrr']; function random(array){ return array[Math.floor(Math.random() * array.length)]; } function peppers_talk(){ if(enabled){ cb.cancelTimeout(peppers_timer); cb.chatNotice(random(peppers_imgs) + ' ' + random(phrases)); peppers_timer = cb.setTimeout(peppers_talk, time_interval*60*1000); } } cb.onEnter(function(user) { if(user['user'] in controllers){ cb.chatNotice(':peppers-car Nyaa!'); } }); cb.onMessage(function (msg) { if (msg.m.substring(0, 1) == "!"){ msg['X-Spam'] = true; if (controllers.indexOf(msg.user) > -1){ var commands = msg.m.split(" "); if(commands[0] == '!peppers'){ if(commands.length == 1){ peppers_talk(); } else { switch(commands[1]){ case 'stop': enabled = false; break; case 'start': enabled = true; peppers_talk(); break; case 'set-time': if(commands.length > 2){ cb.cancelTimeout(peppers_timer); time_interval = parseInt(commands[2]); if(time_interval < 1 || time_interval > 30){ time_interval = 10; } peppers_timer = cb.setTimeout(peppers_talk, time_interval*60*1000); } break; } } } if(commands[0] == '!caesar'){ cb.chatNotice(random(jayde_cats_imgs) + ' ' + random(phrases)); } } } return msg; }); function init() { if(enabled){ cb.chatNotice(random(peppers_imgs) + ' ' + random(phrases)); peppers_timer = cb.setTimeout(peppers_talk, time_interval*60*1000); } } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.