Bots Home
|
Create an App
BobRoss
Author:
fatkarl
Description
Source Code
Launch Bot
Current Users
Created by:
Fatkarl
cb.settings_choices = [{ name: 'show_tutorial', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Send private notice on how to use Bob Ross to users entering the room" },{ name: 'start_setting', type: 'choice', choice1: 'Randomly generated font, color', choice2: 'Default black, arial', defaultValue: 'Randomly generated font, color', label: "Users start with" },{ name: 'allow_color', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Allow color changes" },{ name: 'allow_font', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Allow font changes" },{ name: 'allow_decoration', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Allow decoration changes" },{ name: 'max_color_brightness', type: 'int', minValue: '1', maxValue: '765', defaultValue: '400', label: "Max color brightness" }]; var named_colors = { 'gray' : '#808080', 'black' : '#000000', 'red' : '#FF0000', 'maroon' : '#800000', 'yellow' : '#FFFF00', 'olive' : '#808000', 'lime' : '#00FF00', 'green' : '#008000', 'aqua' : '#00ffff', 'teal' : '#008080', 'blue' : '#0000FF', 'navy' : '#000080', 'fuchsia' : '#ff00ff', 'purple' : '#800080' } var users = {}; function to_hex(c) { var hex = c.toString(16); return hex.length == 1 ? "0" + hex : hex; } function set_user_color(user, val) { if (users[user] === undefined) users[user] = {}; if (named_colors[val] !== undefined) { users[user].color = named_colors[val]; return; } if (/^#[0-9A-F]{6}$/i.test(val)) { users[user].color = val; return; } for (var i = 0; i < 100; i++) { var r = Math.round(Math.random() * 255); var g = Math.round(Math.random() * 255); var b = Math.round(Math.random() * 255); if (r + g + b < parseInt(cb.settings.max_color_brightness)) { users[user].color = "#" + to_hex(r) + to_hex(g) + to_hex(b); return; } } } function set_user_decoration(user, val) { if (users[user] === undefined) users[user] = {}; users[user].decoration = val; } function set_user_font(user, val) { if (users[user] === undefined) users[user] = {}; if (val !== undefined) { users[user].font = val; return; } var random_fonts = ['Arial', 'Helvetica', 'Courier', 'Verdana', 'Tahoma', 'Comic Sans MS', 'Avant Garde', 'Georgia', 'Times New Roman']; users[user].font = random_fonts[Math.round(Math.random() * random_fonts.length)]; } function default_notice(msg, user) { if (user == undefined) user = ""; cb.chatNotice(msg, user, '#ffffff', '#FF1493'); } function broadcaster_notice(msg) { cb.chatNotice(msg, cb.room_slug, '#ffffff', '#CD5C5C'); } function send_guide(user) { var msg = 'This room is accidentally made happy by Bob Ross.'; if (cb.settings.allow_color == 'Yes') msg += ' You can type "/color X" where X is either empty for random, known color (such as red or blue) or a hexadecimal comonent string.'; if (cb.settings.allow_font == 'Yes') msg += ' You can type "/font X" where X is either empty for random or a known font (such as arial or comic sans ms).'; if (cb.settings.allow_font == 'Yes') msg += ' You can type "/decoration X" where X is the decoration in front of everything you say, like :lolZ, for example.'; default_notice(msg, user); } cb.onMessage(function (msg) { // auto decorator if (cb.settings.start_setting == 'Randomly generated font, color' && users[msg.user] === undefined) { set_user_color(msg.user); set_user_font(msg.user); } // commands if (msg.m.charAt(0) == '/') { var components = msg.m.split(' '); var is_broadcaster = msg.user == cb.room_slug; switch (components[0]) { case '/color': msg['X-Spam'] = true; if (cb.settings.allow_color == 'No') break; set_user_color(msg['user'], components[1]); break; case '/font': msg['X-Spam'] = true; if (cb.settings.allow_font == 'No') break; var len = components[0].length + 1; var arg = msg.m.length > len ? msg.m.substring(len) : undefined; set_user_font(msg['user'], arg); break; case '/decoration': msg['X-Spam'] = true; if (cb.settings.allow_decoration == 'No') break; var len = components[0].length + 1; var arg = msg.m.length > len ? msg.m.substring(len) : ''; set_user_decoration(msg['user'], arg); break; case '/decorate': msg['X-Spam'] = true; if (!is_broadcaster) break; if (components.length < 3) break; var len = components[0].length + components[1].length + 2; var arg = msg.m.length > len ? msg.m.substring(len) : ''; set_user_decoration(components[1], arg); break; case '/nice': msg['X-Spam'] = true; if (!is_broadcaster) break; if (components.length < 2) break; if (nice[components[1]] === undefined) { nice[components[1]] = true; } else { delete nice[components[1]]; } break; } } // nice if (nice[msg.user] !== undefined) { msg.m = nice_words[Math.round(Math.random() * nice_words.length)]; } // decorating var user = users[msg.user]; if (user !== undefined) { if (user.color !== undefined) msg.c = user.color; if (user.font !== undefined) msg.f = user.font; if (user.decoration !== undefined && msg.m.charAt(0) != ':' && msg.m.charAt(0) != '/' && msg.m.charAt(0) != '!') msg.m = user.decoration + " " + msg.m; } return msg; }); cb.onEnter(function(user) { if (cb.settings.show_tutorial == 'Yes') send_guide(user.user); }); // haha var nice = {}; var nice_words = ['Your smile is contagious.','You look great today.','You\'re a smart cookie.','I bet you make babies smile.','You have impeccable manners.','I like your style.','You have the best laugh.','I appreciate you.','You are the most perfect you there is.','You are enough.','You\'re strong.','Your perspective is refreshing.','You\'re an awesome friend.','You light up the room.','You deserve a hug right now.','You should be proud of yourself.','You\'re more helpful than you realize.','You have a great sense of humor.','You\'ve got all the right moves!','Is that your picture next to "charming" in the dictionary?','Your kindness is a balm to all who encounter it.','You\'re all that and a super-size bag of chips.','On a scale from 1 to 10, you\'re an 11.','You are brave.','You\'re even more beautiful on the inside than you are on the outside.','You have the courage of your convictions.','Your eyes are breathtaking.','If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.','You are making a difference.','You\'re like sunshine on a rainy day.','You bring out the best in other people.','Your ability to recall random factoids at just the right time is impressive.','You\'re a great listener.','How is it that you always look great, even in sweatpants?','Everything would be better if more people were like you!','I bet you sweat glitter.','You were cool way before hipsters were cool.','That color is perfect on you.','Hanging out with you is always a blast.','You always know -- and say -- exactly what I need to hear when I need to hear it.','You smell really good.','You may dance like no one\'s watching, but everyone\'s watching because you\'re an amazing dancer!','Being around you makes everything better!','When you say, "I meant to do that," I totally believe you.','When you\'re not afraid to be yourself is when you\'re most incredible.','Colors seem brighter when you\'re around.','You\'re more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)','That thing you don\'t like about yourself is what makes you so interesting.','You\'re wonderful.','You have cute elbows. For reals! (You\'re halfway through the list. Don\'t stop now! You should be giving at least one awesome compliment every day!)','Jokes are funnier when you tell them.','You\'re better than a triple-scoop ice cream cone. With sprinkles.','Your bellybutton is kind of adorable.','Your hair looks stunning.','You\'re one of a kind!','You\'re inspiring.','If you were a box of crayons, you\'d be the giant name-brand one with the built-in sharpener.','You should be thanked more often. So thank you!!','Our community is better because you\'re in it.','Someone is getting through something hard right now because you\'ve got their back. ','You have the best ideas.','You always know how to find that silver lining.','Everyone gets knocked down sometimes, but you always get back up and keep going.','You\'re a candle in the darkness.','You\'re a great example to others.','Being around you is like being on a happy little vacation.','You always know just what to say.','You\'re always learning new things and trying to better yourself, which is awesome.','If someone based an Internet meme on you, it would have impeccable grammar.','You could survive a Zombie apocalypse.','You\'re more fun than bubble wrap.','When you make a mistake, you fix it.','Who raised you? They deserve a medal for a job well done.','You\'re great at figuring stuff out.','Your voice is magnificent.','The people you love are lucky to have you in their lives.','You\'re like a breath of fresh air.','You\'re gorgeous -- and that\'s the least interesting thing about you, too.','You\'re so thoughtful.','Your creative potential seems limitless.','Your name suits you to a T.','You\'re irresistible when you blush.','Actions speak louder than words, and yours tell an incredible story.','Somehow you make time stop and fly at the same time.','When you make up your mind about something, nothing stands in your way.','You seem to really know who you are.','Any team would be lucky to have you on it.','In high school I bet you were voted "most likely to keep being awesome."','I bet you do the crossword puzzle in ink.','Babies and small animals probably love you.','If you were a scented candle they\'d call it Perfectly Imperfect (and it would smell like summer).','There\'s ordinary, and then there\'s you.','You\'re someone\'s reason to smile.','You\'re even better than a unicorn, because you\'re real.','How do you keep being so funny and making everyone laugh?','You have a good head on your shoulders.','Has anyone ever told you that you have great posture?','The way you treasure your loved ones is incredible.','You\'re really something special.','You\'re a gift to those around you.'];
© Copyright Chaturbate 2011- 2024. All Rights Reserved.