Apps Home
|
Create an App
rainbowpartytest
Author:
dmarz_test
Description
Source Code
Launch App
Current Users
Created by:
Dmarz_Test
// //title: r a i n b o w //author: @daisy_marz //with help from @indshadow because math is hard and i am too smol. // // //global variables var user_has_color = {}; var user_has_time = {}; var timer = 0; var tokens_recieved = 0; var timer_number =0; cb.settings_choices = [ {name: 'room_title', type: 'str', minlength: '1', maxlength: '255', label: "room subject (optional)", required: false }, {name:'goal', type: 'int', label: 'amount of tokens to reach goal.(optional, set to 0 to disable'}, {name: 'red_tokens', type: 'int', label: 'number of tokens to become red'}, {name: 'orange_tokens', type: 'int', label: 'number of tokens to become orange'}, {name: 'yellow_tokens', type: 'int', label: 'number of tokens to become yellow'}, {name: 'green_tokens', type: 'int', label: 'number of tokens to become green'}, {name: 'blue_tokens', type: 'int', label: 'number of tokens to become blue'}, {name: 'indigo_tokens', type: 'int', label: 'number of tokens to become indigo'}, {name: 'violet_tokens', type: 'int', label: 'number of tokens to become violet'}, {name: 'color_time', type: 'int', label: 'amount of time to keep a color (in seconds)'} ] cb.onEnter( function(user) { if (user['has_tokens']) { cb.sendNotice( "hey " + user['user'] + ", this is an experimental app called r a i n b o w!", user['user'], '#FF85A1', '', 'bold'); setTimeout(function() { cb.sendNotice("the object of the game is to work together and make a true ROYGBIV rainbow in the chat.", user['user'], '#F5FF85', '', 'bold' ); }, 100); setTimeout(function() { cb.sendNotice("choose your color from the /menu and you will have " + cb.settings.color_time + " seconds to do your part.", user['user'], '#85FFD2', '', 'bold' ); }, 150); setTimeout(function() { cb.sendNotice("you can change colors as many times as you like. dont worry, each time you change colors, your timer will reset.", user['user'], '#85D4FF', '', 'bold' ); }, 200); setTimeout(function() { cb.sendNotice("for a more detailed explaination, type /rules", user['user'], '#EB85FF', '', 'bold' ); }, 250); } } ); cb.onTip( function ( tip ) { var color = null; var color_code = null; tokens_recieved += tip['amount'] cb.drawPanel(); update_subject(); if (tokens_recieved >= cb.settings.spank_goal) { cb.chatNotice('----------goal reached!----------', '', '', '#A2A3A3', 'bold'); } if(parseInt(tip['amount']) == cb.settings.red_tokens) { color = 'red'; color_code = '#FF85A1'; } else if (parseInt(tip['amount']) == cb.settings.orange_tokens) { color = 'orange'; color_code = '#FFCA85'; } else if (parseInt(tip['amount']) == cb.settings.yellow_tokens) { color = 'yellow'; color_code = '#F5FF85'; } else if (parseInt(tip['amount']) == cb.settings.green_tokens) { color = 'green'; color_code = '#85FFD2'; } else if (parseInt(tip['amount']) == cb.settings.blue_tokens) { color = 'blue'; color_code = '#85D4FF' } else if (parseInt(tip['amount']) == cb.settings.indigo_tokens) { color = 'indigo'; color_code = '#858FFF'; } else if (parseInt(tip['amount']) == cb.settings.violet_tokens) { color = 'violet'; color_code = '#EB85FF'; } else { color = null; } if ( color != null ) { user_has_color[tip['from_user']] = color_code; cb.sendNotice(tip['from_user'] + " is now " + color + ".", '', '', color_code, 'bold'); if ( ! user_has_time[tip['from_user']] ) { user_has_time[tip['from_user']] = cb.settings.color_time; ticktock(tip['from_user']); } else { user_has_time[tip['from_user']] = cb.settings.color_time; } } }); function ticktock(user) { user_has_time[user]--; if ( user_has_time[user] > 0 ) { cb.setTimeout(ticktock.bind(null, user), 1000); } else { user_has_color[user] = '#FFFFFF'; user_has_time[user] = 0; cb.sendNotice(user + ' has returned to white.', '', '', '#A2A3A3', 'bold') } } cb.onMessage(function(msg) { if ( typeof user_has_color[msg['user']] !== 'undefined') { msg['background'] = user_has_color[msg['user']]; } var message = msg['m'].split(' '); if( message[0].charAt(0) == '/' ) { msg['X-Spam'] = true; if( message[0] == "/rules" ) { showrules( msg['user'] ); } else if(message[0] == "/menu") { showmenu( msg['user'] ); } else if(message[0] == "/about") { showabout( msg['user'] ); } } }); function showrules(user) { var notices = "------ :daisy_marz-rainbowicon ------rules of the r a i n b o w------ :daisy_marz-rainbowicon ------\n"; notices += "the object of the game is to work together and make a true ROYGBIV rainbow in the chat.\n"; notices += "each person may choose one color at a time and will act as that color in the rainbow.\n"; notices += "the proper order of a rainbow is red, orange, yellow, green, blue, indigo, and violet.\n"; notices += "once you choose your color, every message you type will be highlighted in your color for " + cb.settings.color_time + " seconds.\n"; notices += "if the chat can manage to make a rainbow, everyone wins and a cumshow will happen!\n"; notices += "if the rainbow is interrupted by the wrong color, a repeating color, OR a person without a color, the game starts over.\n"; notices += "to choose a color, type /menu\n"; notices += "for app info, type /about"; cb.sendNotice(notices, user, '', '#A2A3A3', 'bold'); } function showmenu(user) { cb.sendNotice( "------------choose your color by tipping it's number!------------", user, '', '#A2A3A3', 'bold'); setTimeout(function() { cb.sendNotice("red - " + cb.settings.red_tokens + " tokens", user, '#FF85A1', '', 'bold' ); }, 100); setTimeout(function() { cb.sendNotice("orange - " + cb.settings.orange_tokens + " tokens", user, '#FFCA85', '', 'bold' ); }, 200); setTimeout(function() { cb.sendNotice("yellow - " + cb.settings.yellow_tokens + " tokens", user, '#F5FF85', '', 'bold' ); }, 300); setTimeout(function() { cb.sendNotice("green - " + cb.settings.green_tokens + " tokens", user, '#85FFD2', '', 'bold' ); }, 400); setTimeout(function() { cb.sendNotice("blue - " + cb.settings.blue_tokens + " tokens", user, '#85D4FF', '', 'bold' ); }, 500); setTimeout(function() { cb.sendNotice("indigo - " + cb.settings.indigo_tokens + " tokens", user, '#858FFF', '','bold' ); }, 600); setTimeout(function() { cb.sendNotice("violet - " + cb.settings.violet_tokens + " tokens", user, '#EB85FF', '', 'bold' ) }, 700); } function showabout(user) { setTimeout(function() { cb.sendNotice("r", user, '', '#FF85A1', 'bold' ); }, 200); setTimeout(function() { cb.sendNotice("a", user, '', '#FFCA85', 'bold' ); }, 400); setTimeout(function() { cb.sendNotice("i", user, '', '#F5FF85', 'bold' ); }, 600); setTimeout(function() { cb.sendNotice("n", user, '', '#85FFD2', 'bold' ); }, 800); setTimeout(function() { cb.sendNotice("b", user, '', '#85D4FF', 'bold' ); }, 1000); setTimeout(function() { cb.sendNotice("o", user, '', '#858FFF', 'bold' ); }, 1200); setTimeout(function() { cb.sendNotice("w", user, '', '#EB85FF', 'bold' ); }, 1400); setTimeout(function() { cb.sendNotice("by @daisy_marz [version 1.0.1]", user, '', '#A2A3A3', 'bold' ); }, 1600); } cb.onDrawPanel( function( user ) { color_menu = null; color =null; if (timer_number <= 1) { color_menu = "tip " + cb.settings.red_tokens+ "tk to become red!" color = '#FF85A1' } else if (timer_number <= 2) { color_menu = "tip " + cb.settings.orange_tokens + "tk to become orange!" color = '#FFCA85' } else if (timer_number <= 3) { color_menu = "tip " + cb.settings.yellow_tokens + "tk to become yellow!" color = '#F5FF85' } else if (timer_number <= 4) { color_menu = "tip " + cb.settings.green_tokens + "tk to become green!" color = '#85FFD2' } else if (timer_number <= 5) { color_menu = "tip " + cb.settings.blue_tokens + "tk to become blue!" color = '#85D4FF' } else if (timer_number <= 6) { color_menu = "tip " + cb.settings.indigo_tokens + "tk to become indigo!" color = '#858FFF' } else if (timer_number <= 7) { color_menu = "tip " + cb.settings.violet_tokens + "tk to become violet!" color = '#EB85FF' } if ( cb.settings.goal == 0 ) { return { "template": "image_template", "layers": [ { 'type': 'image', 'fileID': '829cd52b-b9ab-4c32-973c-0bb670dc103c'}, { 'type': 'text', 'text': 'lets make a rainbow!', 'top': 5, 'left': 5 }, { 'type': 'text', 'text': color_menu, 'top': 52, 'left': 5, 'color': + color,} ] }; } else { return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': '829cd52b-b9ab-4c32-973c-0bb670dc103c'}, { 'type': 'text', 'text': 'lets make a rainbow!', 'top': 5, 'left': 5 }, { 'type': 'text', 'text': 'goal: ' + tokens_recieved + '/' + cb.settings.goal , 'top': 29, 'left': 5 }, { 'type': 'text', 'text': color_menu, 'top': 52, 'left': 5 } ] }; } }); function update_subject() { var rainbow_subject = 'lets make a r a i n b o w' if ( cb.settings.goal > 0 ) { rainbow_subject = 'goal: ' + tokens_recieved + '/' + cb.settings.goal if ( tokens_recieved >= cb.settings.goal ) { rainbow_subject = 'goal reached!' } } if ( cb.settings.room_title == '' ) { cb.changeRoomSubject( rainbow_subject ); } else { cb.changeRoomSubject( cb.settings.room_title + ' || ' + rainbow_subject ); } } function credit() { cb.sendNotice(" :daisy_marz-rainbowicon :daisy_marz-rainbowicon :daisy_marz-rainbowicon r a i n b o w by @daisy_marz :daisy_marz-rainbowicon :daisy_marz-rainbowicon",'', '#A2A3A3', '', 'bold') cb.sendNotice("type /menu in the chat to choose your color!", '', '', '#A2A3A3', 'bold') cb.setTimeout(credit, 300000) } function menutimer() { timer_number = timer_number + 1 if (timer_number > 7) { timer_number = 1 } cb.drawPanel(); cb.setTimeout(menutimer, 10000) } update_subject(); menutimer();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.