Apps Home
|
Create an App
shiftyonthisaccount
Author:
daisy_marz_test
Description
Source Code
Launch App
Current Users
Created by:
Daisy_Marz_Test
// // title: //shift// // author: @daisy_marz // all code, emoticons, and panels were made by me! i worked really hard on this so please do not duplicate! // if you have a suggestion for a new theme, send me a tweet and i'd be happy to include it! my twitter is @daisy_marz // // cb.settings_choices = [ { name: 'room_title', type: 'str', minlength: '1', maxlength: '255', label: "room subject (optional)", required: false }, { name: 'theme_toggle', type:'choice', choice1:'plantlife', choice2: 'lemonhead', choice3: 'catatonic', choice4:'growth', choice5: 'crystalize', choice6: 'mystic', choice7:'cloudyday', choice8:'turnmeon', label: "theme:"}, { name: 'goal_type_toggle', type: 'choice', choice1: 'traditional goal', choice2: 'countdown goal', choice3: 'multigoal', choice4: 'no goal', defaultValue: 'traditional goal', label: "what kind of goal would you like to have?"}, { name: 'token_goal', type: 'int', label: 'amount of tokens to reach goal:', defaultValue: '0', required: false}, { name: 'menu_item1', type: 'str', label: "mini menu item #1 (will appear in the chat menu and your panel.)"}, { name: 'item1_price', type: 'int', label: "cost of mini menu item #1"}, { name: 'menu_item2', type: 'str', label: "mini menu item #2 (will appear in the chat menu and your panel.)"}, { name: 'item2_price', type: 'int', label: "cost of mini menu item #2"}, { name: 'menu_item3', type: 'str', label: "mini menu item #3 (will appear in the chat menu and your panel.)"}, { name: 'item3_price', type: 'int', label: "cost of mini menu item #3"}, { name: 'additional_menu', type: 'choice', choice1: 'yes.', choice2: 'no.', defaultValue: 'no.', label: "would you like to use the additional tip menu space below?"}, { name: 'menu_item4', type: 'str', label: "menu item #4 (will appear in the chat menu.)", required: false}, { name: 'item4_price', type: 'int', label: "cost of menu item #4", required: false}, { name: 'menu_item5', type: 'str', label: "menu item #5 (will appear in the chat menu.)", required: false }, { name: 'item5_price', type: 'int', label: "cost of menu item #5", required: false }, { name: 'menu_item6', type: 'str', label: "menu item #6 (will appear in the chat menu.)",required: false}, { name: 'item6_price', type: 'int', label: "cost of menu item #6", required: false}, ] //universal variables var tokens_recieved = 0; var timer_number = 0; var remaining = cb.settings.token_goal; // multigoal vars var goalcount = 0; var current_goal_tokens = 0; //theme colors, icons, and dividers var text_color = null; var highlight_color = null; var panel_text_color = null; var icon1 = null; var icon2 = null; var icon3 = null; var bulleticon = null; var leftdivider = null; var rightdivider = null; function set_shift() { if (cb.settings.theme_toggle == 'plantlife') { text_color = '#61FFAF' highlight_color = '#BAFFDC' panel_text_color ='#12CC6E' icon1 = " :daisy_marz-plantlife1"; icon2 = " :daisy_marz-plantlife2"; icon3 = " :daisy_marz-plantlife3"; bulleticon = " :daisy_marz-plantlifebullet"; leftdivider = " :daisy_marz-plantlifeleftdiv"; rightdivider = " :daisy_marz-plantlifelrightdiv"; } else if (cb.settings.theme_toggle == 'lemonhead') { text_color = '#E3D722' highlight_color = '#FFFCCF' panel_text_color = '#E3D722' icon1 = " :daisy_marz-lemonhead1"; icon2 = " :daisy_marz-lemonhead2"; icon3 = " :daisy_marz-lemonhead3"; bulleticon = " :daisy_marz-lemonheadbullet"; leftdivider = " "; rightdivider = " "; } else if (cb.settings.theme_toggle == 'catatonic') { text_color = '#B0B0B0' highlight_color = '#E0DEDE' panel_text_color = '#B0B0B0' icon1 = " :daisy_marz-catatonic1"; icon2 = " :daisy_marz-catatonic2"; icon3 = " :daisy_marz-catatonic3"; bulleticon = " :daisy_marz-yarn" leftdivider = " "; rightdivider = " "; } else if (cb.settings.theme_toggle == 'growth') { text_color = '#FC9DCE' highlight_color = '#FCD4E9' panel_text_color = '#FC9DCE' icon1 = " :daisy_marz-growth_icon1"; icon2 = " :daisy_marz-growth_icon2"; icon3 = " :daisy_marz-growth_icon4"; bulleticon = " :daisy_marz-bumble" leftdivider = " "; rightdivider = " "; } else if (cb.settings.theme_toggle == 'crystalize') { text_color = '#5ED6C6' highlight_color = '#BBFCF4' panel_text_color = '#25B8A4' icon1 = " :daisy_marz-crystal1"; icon2 = " :daisy_marz-crystal2"; icon3 = " :daisy_marz-crystal3"; bulleticon = " :gembullet"; leftdivider = " "; rightdivider = " "; } else if (cb.settings.theme_toggle == 'mystic') { text_color = '#F7ADBD' highlight_color = '#FFD9E1' panel_text_color = '#FF52D4' icon1 = " :daisy_marz-mystic1"; icon2 = " :daisy_marz-mystic2"; icon3 = " :daisy_marz-mystic3"; bulleticon = " :pinkmoonbullet"; leftdivider = " "; rightdivider = " "; } else if (cb.settings.theme_toggle == 'cloudyday') { text_color = '#7FB5FA' highlight_color ='#C7E0FF' panel_text_color = '#2383FC' icon1 = " :daisy_marz-cloudy_dayicon1" icon2 = " :daisy_marz-cloudyday2"; icon3 = " :daisy_marz-cloudy_dayicon3" bulleticon = " :daisy_marz-cloudy_daybullet" leftdivider = " :daisy_marz-cloudydayleftdiv"; rightdivider = " :daisy_marz-cloudydaylrightdiv"; } else if (cb.settings.theme_toggle == 'turnmeon') { text_color = '#B0B0B0' highlight_color = '#E0DEDE' panel_text_color = '#B0B0B0' icon1 = " :daisy_marz-printt"; icon2 = " :daisy_marz-key"; icon3 = " :daisy_marz-turnmeonn3"; bulleticon = " :daisy_marz-turnmeonbullet"; leftdivider = " "; rightdivider = " "; } } set_shift(); cb.onEnter( function(user) { if (user['has_tokens']) { cb.sendNotice( "hey " + user['user'] + ", i hope you're having a lovely day.", user['user'], '', text_color, 'bold'); } }); cb.onTip( function ( tip ) { tokens_recieved += tip['amount'] if (cb.settings.goal_type_toggle == 'countdown goal') { remaining = cb.settings.token_goal - tokens_recieved; if (remaining <= 0) { remaining = 0; } } if (cb.settings.goal_type_toggle == 'multigoal') { current_goal_tokens += tip['amount'] remaining = cb.settings.token_goal - current_goal_tokens cb.sendNotice("current goal tokens = " + current_goal_tokens) if (current_goal_tokens >= cb.settings.token_goal) { goalcount = Math.floor(tokens_recieved / cb.settings.token_goal); var new_goalcount = Math.floor(current_goal_tokens / cb.settings.token_goal); for ( var counter=0; counter < new_goalcount; counter++ ) { current_goal_tokens -= cb.settings.token_goal; remaining = cb.settings.token_goal - current_goal_tokens } if (new_goalcount == 1) { cb.sendNotice('----------goal was reached ' + new_goalcount + ' more time!----------', '', '', text_color, 'bold'); } else { cb.sendNotice('----------goal was reached ' + new_goalcount + ' more times!----------', '', '', text_color, 'bold'); } } } cb.drawPanel(); update_subject(); if (cb.settings.goal_type_toggle == 'traditional goal' && tokens_recieved >= cb.settings.token_goal) { cb.sendNotice('----------goal reached!----------', '', '', text_color, 'bold'); } if (cb.settings.goal_type_toggle == 'countdown goal' && remaining <= 0) { cb.sendNotice('----------goal reached!----------', '', '', text_color, 'bold'); } item = null; if(parseInt(tip['amount']) == cb.settings.item1_price) { item = cb.settings.menu_item1 } else if (parseInt(tip['amount']) == cb.settings.item2_price) { item = cb.settings.menu_item2 } else if (parseInt(tip['amount']) == cb.settings.item3_price) { item = cb.settings.menu_item3 } if (cb.settings.additional_menu == 'yes.') { if (parseInt(tip['amount']) == cb.settings.item4_price) { item = cb.settings.menu_item4 } else if (parseInt(tip['amount']) == cb.settings.item5_price) { item = cb.settings.menu_item5 } else if (parseInt(tip['amount']) == cb.settings.item6_price) { item = cb.settings.menu_item6 } } if (item != null) { cb.sendNotice(tip['from_user'] + " tipped for " + item + ".", '', '', text_color, 'bold'); } }); cb.onDrawPanel( function( user ) { panel_id = null; if (cb.settings.theme_toggle == 'plantlife') { panel_id = '9be967f8-4151-47a5-ac51-8e813ea75046' } else if (cb.settings.theme_toggle == 'lemonhead') { panel_id = 'bd83d861-1fdf-4b8b-b74f-d357c1c13470' } else if (cb.settings.theme_toggle == 'catatonic') { panel_id = 'c4c26cfd-4a96-4559-8854-a18d4c5d024d' } else if (cb.settings.theme_toggle == 'growth') { panel_id = 'ea074ec9-7c13-44eb-94f8-c5d864568d8b' } else if (cb.settings.theme_toggle == 'crystalize') { panel_id = 'd9fead36-d461-45c2-be46-d6edd8db3266' } else if (cb.settings.theme_toggle == 'mystic') { panel_id = 'bf8c8159-acd3-4373-b0c5-03c19a563b72' } else if (cb.settings.theme_toggle == 'cloudyday') { panel_id = '41f1e75a-966c-4189-b9ea-3054f3e716b8' } else if (cb.settings.theme_toggle == 'turnmeon') { panel_id = '8364f0fe-cd6e-4233-8e8d-924121040f54' } minimenu = null; if (timer_number <= 1) { minimenu = cb.settings.menu_item1 + " - " + cb.settings.item1_price + "tk" } else if (timer_number <= 2) { minimenu = cb.settings.menu_item2 + " - " + cb.settings.item2_price + "tk" } else if (timer_number <= 3) { minimenu = cb.settings.menu_item3 + " - " + cb.settings.item3_price + "tk" } else if (timer_number <= 4) { minimenu = "check out my full tip menu in my bio!" } if ( cb.settings.goal_type_toggle == 'no goal' ) { return { "template": "image_template", "layers": [ { 'type': 'image', 'fileID': panel_id }, { 'type': 'text', 'text': 'tip jar: ' + tokens_recieved, 'top': 5, 'left': 5}, { 'type': 'text', 'text': minimenu , 'top': 52, 'left': 5, 'color': panel_text_color } ] }; } if ( cb.settings.goal_type_toggle == 'traditional goal' ) { return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': panel_id }, { 'type': 'text', 'text': 'goal: ' + tokens_recieved + '/' + cb.settings.token_goal, 'top': 5, 'left': 5}, { 'type': 'text', 'text': minimenu , 'top': 52, 'left': 5, 'color': panel_text_color } ] }; } if ( cb.settings.goal_type_toggle == 'countdown goal' ) { return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': panel_id }, { 'type': 'text', 'text': 'tokens remaining: ' + remaining , 'top': 5, 'left': 5}, { 'type': 'text', 'text': minimenu , 'top': 52, 'left': 5, 'color': panel_text_color } ] }; } if ( cb.settings.goal_type_toggle == 'multigoal' ) { return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': panel_id }, { 'type': 'text', 'text': 'goal: ' + current_goal_tokens + '/' + cb.settings.token_goal + ' [' + (tokens_recieved) + ']', 'top': 5, 'left': 5}, { 'type': 'text', 'text': 'we have hit goal ' + goalcount + ' times!' , 'top': 29, 'left': 5, 'color': panel_text_color }, { 'type': 'text', 'text': minimenu , 'top': 52, 'left': 5, 'color': panel_text_color } ] }; } }); cb.onMessage( function( msg ) { var message = msg['m'].split(' '); if( message[0].charAt(0) == '/' ) { msg['X-Spam'] = true; if( message[0] == "/menu" ) { showmenu( msg['user'] ); } else if(message[0] == "/about") { cb.sendNotice(" //shift // by @daisy_marz", '', '', text_color , 'bold') } else if(message[0] == "/help") { showhelp( msg['user'] ); } //checking if message is from broadcaster if (msg['user'] == cb.room_slug) { if(message[0] == "/shift") { showshift( msg['user'] ); } if(message[0] == "/plantlife") { cb.settings.theme_toggle = 'plantlife' set_shift() } if(message[0] == "/lemonhead") { cb.settings.theme_toggle = 'lemonhead' set_shift() } if(message[0] == "/catatonic") { cb.settings.theme_toggle = 'catatonic' set_shift() } if(message[0] == "/growth") { cb.settings.theme_toggle = 'growth' set_shift() } if(message[0] == "/crystalize") { cb.settings.theme_toggle = 'crystalize' set_shift() } if(message[0] == "/mystic") { cb.settings.theme_toggle = 'mystic' set_shift() } if(message[0] == "/cloudyday") { cb.settings.theme_toggle = 'cloudyday' set_shift() } if(message[0] == "/turnmeon") { cb.settings.theme_toggle = 'turnmeon' set_shift() } } } return msg; }); function update_subject() { var basic_subject = '// shift //' if ( cb.settings.goal_type_toggle == 'traditional goal' ) { basic_subject = 'goal: ' + tokens_recieved + '/' + cb.settings.token_goal if ( tokens_recieved >= cb.settings.token_goal ) { basic_subject = 'goal reached!' } } if ( cb.settings.goal_type_toggle == 'countdown goal' ) { basic_subject = '[tokens remaining: ' + remaining + ']' if ( remaining <= 0 ) { basic_subject = 'goal reached!' } } if ( cb.settings.goal_type_toggle == 'multigoal' ) { basic_subject = '[tokens remaining: ' + remaining + ']' } if ( cb.settings.goal_type_toggle == 'no goal' ) { basic_subject = 'come hang out!' } if ( cb.settings.room_title == '' ) { cb.changeRoomSubject( basic_subject); } else { cb.changeRoomSubject( cb.settings.room_title + ' || ' + basic_subject ); } } function minimenutimer() { timer_number = timer_number + 1 if (timer_number > 4) { timer_number = 1 } cb.drawPanel(); cb.setTimeout(minimenutimer, 15000) } function showmenu(user) { if (cb.settings.additional_menu == 'no.') { var notices = " " + icon1 + " " + icon2 + " " + icon3 + " ----------minimenu---------- " + icon3 + " " + icon2 + " " + icon1 + " \n"; notices += " " + bulleticon + " " + cb.settings.item1_price + " - " + cb.settings.menu_item1 + " \n"; notices += " " + bulleticon + " " + cb.settings.item2_price + " - " + cb.settings.menu_item2 + " \n"; notices += " " + bulleticon + " " + cb.settings.item3_price + " - " + cb.settings.menu_item3 + " \n"; notices += "check out my bio for my full tip menu! \n"; notices += "type /help for command info!"; cb.sendNotice( notices, user, highlight_color, panel_text_color, 'bold' ); cb.setTimeout(showmenu, 300000) } if (cb.settings.additional_menu == 'yes.') { var notices = " " + icon1 + " " + icon2 + " " + icon3 + " ----------tip menu---------- " + icon3 + " " + icon2 + " " + icon1 + " \n"; notices += " " + bulleticon + " " + cb.settings.item1_price + " - " + cb.settings.menu_item1 + " \n"; notices += " " + bulleticon + " " + cb.settings.item2_price + " - " + cb.settings.menu_item2 + " \n"; notices += " " + bulleticon + " " + cb.settings.item3_price + " - " + cb.settings.menu_item3 + " \n"; notices += " " + bulleticon + " " + cb.settings.item4_price + " - " + cb.settings.menu_item4 + " \n"; notices += " " + bulleticon + " " + cb.settings.item5_price + " - " + cb.settings.menu_item5 + " \n"; notices += " " + bulleticon + " " + cb.settings.item6_price + " - " + cb.settings.menu_item6 + " \n"; notices += "check out my bio for my full tip menu! \n"; notices += "type /help for command info!"; cb.sendNotice( notices, user, highlight_color, panel_text_color, 'bold' ); cb.setTimeout(showmenu, 300000) } } function showshift(user) { setTimeout(function() { cb.sendNotice( "----------// shift //----------", user, highlight_color, panel_text_color, 'bold' ); }, 100); setTimeout(function() { cb.sendNotice( "to //shift// your theme, type your desired theme name as a command in the chat. (ex. /crystalize)", user, highlight_color, panel_text_color, 'bold' ); }, 200); setTimeout(function() { cb.sendNotice( "[plantlife]", user, '#BAFFDC', '#12CC6E', 'bold' ); }, 400); setTimeout(function() { cb.sendNotice( "[lemonhead]", user, '#FFFCCF', '#E3D722', 'bold' ); }, 600); setTimeout(function() { cb.sendNotice( "[catatonic]", user, '#E0DEDE', '#B0B0B0', 'bold' ); }, 800); setTimeout(function() { cb.sendNotice( "[growth]", user, '#FCD4E9', '#FC9DCE', 'bold' ); }, 1000); setTimeout(function() { cb.sendNotice( "[crystalize]", user, '#BBFCF4', '#25B8A4', 'bold' ); }, 1200); setTimeout(function() { cb.sendNotice( "[mystic]", user, '#FFD9E1', '#FF52D4', 'bold' ); }, 1200); setTimeout(function() { cb.sendNotice( "[cloudyday]", user, '#C7E0FF', '#2383FC', 'bold' ); }, 1200); setTimeout(function() { cb.sendNotice( "[turnmeon]", user, '#E0DEDE', '#B0B0B0', 'bold' ); }, 1400); } function showhelp(user) { if (user == cb.room_slug) { var notices = " " + icon1 + " " + icon2 + " " + icon3 + " -----broadcaster commands----- " + icon3 + " " + icon2 + " " + icon1 + "\n"; notices += "type /menu to see the tip menu \n"; notices += "type /about for app info \n"; notices += "type /shift for info on how to to shift your current theme."; cb.sendNotice( notices, user, '', text_color, 'bold' ) } else { var notices = " " + icon1 + " " + icon2 + " " + icon3 + " \n"; notices += "type /menu to see the tip menu \n"; notices += " type /about for app info"; cb.sendNotice( notices, user, '', text_color, 'bold' ) } } minimenutimer(); showmenu(); cb.drawPanel(); update_subject();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.