Apps Home
|
Create an App
RinseNRepeat Redux
Author:
_rust_
Description
Source Code
Launch App
Current Users
Created by:
_Rust_
/************************************************************* This application allows a Tip Sequence From 1 To 10, which generates 55 tokens (Mini-Goal). This Tip sequence can be repeated 2000 times (110,000 tokens). Once the Repeat Sequence has been reached the Main Goal is performed. Example Repeating Sequence and Tokens generated: Every Sequence (1 to 10) = 55 Tokens Sequence Sequence Sequence Repeat Tokens Repeat Tokens Repeat Tokens --------------------------------------------------------- 1 55 11 605 21 1155 2 110 12 660 22 1210 3 165 13 715 23 1265 4 220 14 770 24 1320 5 275 15 825 25 1375 6 330 16 880 26 1430 7 385 17 935 27 1485 8 440 18 990 28 1540 9 495 19 1045 29 1595 10 550 20 1100 30 1650 --------------------------------------------------------- 31 1705 41 2255 100 5500 32 1760 42 2310 200 11000 33 1815 43 2365 300 16500 34 1870 44 2420 400 22000 35 1925 45 2475 500 27500 36 1980 46 2530 600 33000 37 2035 47 2585 700 38500 38 2090 48 2640 800 44000 39 2145 49 2695 900 49500 40 2200 50 2750 1000 55000 -------------------------------------------------------- **************************************************************/ var next_tip_amount = null; var last_username = null; var max_tip_sequence = null; var goal_reached = false; var mini_goal_count = null; var total_goal_tokens = null; var show_goal_reached_msg = null; var minigoaldescr = null; var maingoaldescr = null; // Limit goal description as we add some text cb.settings_choices = [ { name: 'goal_descr', type: 'str', minLength: 1, maxLength: 190, label:"Main Goal/Show Description" }, { name: 'mini_goal_descr', type: 'str', minLength: 1, maxLength: 190, label:"Flash Goal Description" }, { name: 'goal_sequence', type:'choice', choice1: '55', choice2: '110', choice3: '165', choice4: '220', choice5: '275', choice6: '330', choice7: '385', choice8: '440', choice9: '495', choice10: '550', choice11: '605', choice12: '660', choice13: '715', choice14: '770', choice15: '825', choice16: '880', choice17: '935', choice18: '990', choice19: '1045', choice20: '1100', choice21: '1155', choice22: '1210', choice23: '1265', choice24: '1320', choice25: '1375', choice26: '1430', choice27: '1485', choice28: '1540', choice29: '1595', choice30: '1650', choice31: '1925', choice32: '2200', choice33: '2750', choice34: '3300', choice35: '3850', choice36: '4400', choice37: '4950', choice38: '5500', choice39: '8250', choice40: '11000', choice41: '13750', choice42: '16500', choice43: '19250', choice44: '22000', choice45: '27500', choice46: '33000', choice47: '38500', choice48: '44000', choice49: '49500', choice50: '55000', choice51: '68750', choice52: '82500', choice53: ' 96250', choice54: '110000', defaultValue:'880', label: "Total Goal Tokens" } ]; cb.onTip( function (tip) { // don't spam room with notice after goal has been reached. if (!goal_reached) { // show last tipper var tipAmt = tip['amount']; last_username = tip['from_user']; total_goal_tokens -= tipAmt; if (total_goal_tokens <= 0) { total_goal_tokens = 0; goal_reached = true; } while (tipAmt > 0 && !goal_reached) { if (tipAmt >= next_tip_amount) { next_tip_amount++; } // subtract last tip amount from TipAmt tipAmt -= (next_tip_amount - 1); if (next_tip_amount > 10) { mini_goal_count++; // broadcast to room and performer mini goal cb.chatNotice("Mini Goal was reached for " + minigoaldescr + ". Full Screen Mode Suggested, No Typing Required, Enjoy the Show!!"); cb.chatNotice("Mini Goal was reached " + mini_goal_count + " times out of " + max_tip_sequence + " times.", cb.room_slug); // Goal Reached? if ((mini_goal_count >= max_tip_sequence) || (total_goal_tokens <= 0)) { goal_reached = true; break; } // reset the sequence next_tip_amount = 1; } } } change_room_subject(); cb.drawPanel(); } ); cb.onDrawPanel( function (user) { if (goal_reached) { show_goal_reached_msg = false; return { 'template': '3_rows_11_21_31', 'row1_value': '*** GOAL ***', 'row2_value': 'THANK YOU TIPPERS', 'row3_value': 'FULL Screen Mode Suggested' }; } return { 'template': '3_rows_of_labels', 'row1_label': 'Next Tip Needed:', 'row1_value': next_tip_amount, 'row2_label': 'Last Tip From:', 'row2_value': last_username, 'row3_label': 'Tip In Order:', 'row3_value': 'From 1 to 10' }; } ); function change_room_subject() { var subject = ""; if (goal_reached) { subject = maingoaldescr + " [Goal reached! Thank you all Tippers.]"; // broadcast to room and performer goal! if (show_goal_reached_msg == true) cb.chatNotice("Goal was reached for " + maingoaldescr); } else { // subject = minigoaldescr + " [Tip In Order From 1 to 10]. [Next Tip Amount: " + next_tip_amount + "]" + " Goal: " + maingoaldescr + " Tokens To Goal:[" + total_goal_tokens + "]"; subject = minigoaldescr + " Next Tip Amount:[" + next_tip_amount + "] Show Goal: [" + maingoaldescr + "] Tokens Remaining:[" + total_goal_tokens + "]"; cb.chatNotice("Next Tip Amount:[" + next_tip_amount + "]\nTokens To Goal:[" + total_goal_tokens + "]"); } cb.changeRoomSubject(subject); } cb.onMessage(function (msg) { // only parse cb.room_slug or is_mod messages if ((msg['user'] == cb.room_slug) || (msg['is_mod'] == true) || (msg['user'] == 'kellynumberfan')) { if (msg['m'] == '/help') { msg['X-Spam'] = true; cb.chatNotice('***** Commands ******\n** Broadcastors **\n** /restart - used to restart the application.\n** /setmain - used to change the main goal.\n** Broadcastor and Moderators **\n** /setmini - used to change the mini goal.', msg['user']); return msg; } // only slug can restart application if ((msg['m'] == '/restart') && (msg['user'] == cb.room_slug)) { msg['X-Spam'] = true; cb.chatNotice("-----------------------\nRestarting Application\n-----------------------"); init(); cb.drawPanel(); return msg; } // change the mini goal if (msg['m'].indexOf("/setmini") >= 0) { msg['X-Spam'] = true; minigoaldescr = msg['m'].replace("/setmini",""); change_room_subject(); return msg; } // change the main goal if (msg['m'].indexOf("/setmain") >= 0) { msg['X-Spam'] = true; maingoaldescr = msg['m'].replace("/setmain",""); change_room_subject(); return msg; } // Get the totals if (msg['m'].indexOf("/max") >= 0) { msg['X-Spam'] = true; cb.chatNotice("Total Sequences: " + max_tip_sequence, msg['user']); return msg; } } return msg; }); // Initialize Application function init() { cb.chatNotice("sup"); next_tip_amount = 1; // Calculate the Tip Sequence and set Ascending Order total_goal_tokens = parseInt(cb.settings.goal_sequence); max_tip_sequence = total_goal_tokens / 55; minigoaldescr = cb.settings.mini_goal_descr; maingoaldescr = cb.settings.goal_descr; goal_reached = false; mini_goal_count = 0; last_username = "--"; show_goal_reached_msg = true; // Update the Subject with tip and goal cb.setTimeout(change_room_subject, 3600); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.