Apps Home
|
Create an App
Tip Menu 2.0
Author:
aladin1616
Description
Source Code
Launch App
Current Users
Created by:
Aladin1616
/** * App: Tip to See * Version: 1.2 * Author: zingknaat * Date: 06.24.14 */ var lastTipper = '--'; var lastTipAmount = 0; var tipCounter = 0; var lastItem = '--'; cb.settings_choices = [ {name:'item_1', type:'str', label:'Item #1', defaultValue:'PM'}, {name:'item_1_price', type:'int', label:'Price for item #1', defaultValue:10}, {name:'item_2', type:'str', label:'Item #2 (optional)', defaultValue:'Tits', required:false}, {name:'item_2_price', type:'int', label:'Price for item #2', defaultValue:25}, {name:'item_3', type:'str', label:'Item #3 (optional)', defaultValue:'Ass', required:false}, {name:'item_3_price', type:'int', label:'Price for item #3', defaultValue:50}, {name:'item_4', type:'str', label:'Item #4 (optional)', defaultValue:'Pussy', required:false}, {name:'item_4_price', type:'int', label:'Price for item #4', defaultValue:75}, {name:'item_5', type:'str', label:'Item #5 (optional)', defaultValue:'Naked', required:false}, {name:'item_5_price', type:'int', label:'Price for item #5', defaultValue:100}, {name:'item_6', type:'str', label:'Item #6 (optional)', defaultValue:'', required:false}, {name:'item_6_price', type:'int', label:'Price for item #6', defaultValue:75}, {name:'item_7', type:'str', label:'Item #7 (optional)', defaultValue:'', required:false}, {name:'item_7_price', type:'int', label:'Price for item #7', defaultValue:85}, {name:'item_8', type:'str', label:'Item #8 (optional)', defaultValue:'', required:false}, {name:'item_8_price', type:'int', label:'Price for item #8', defaultValue:95}, {name:'item_9', type:'str', label:'Item #9 (optional)', defaultValue:'', required:false}, {name:'item_9_price', type:'int', label:'Price for item #9', defaultValue:100}, {name:'item_10', type:'str', label:'Item #10 (optional)', defaultValue:'', required:false}, {name:'item_10_price', type:'int', label:'Price for item #10', defaultValue:125}, {name:'notification_wait_time', type:'choice', label:'Time to notify viewers (in minutes)', choice1:1, choice2:2, choice3:3, choice4:4, choice5:5, choice6:10, choice7:15, choice8:20, choice9:25, choice10:30, defaultValue:5} ]; cb.onDrawPanel(function (user) { return { 'template': '3_rows_of_labels', 'row1_label': 'Last Item:', 'row1_value': lastItem, 'row2_label': 'Last Tipper:', 'row2_value': lastTipper + ' (' + lastTipAmount + ')', 'row3_label': 'Tip Jar:', 'row3_value': tipCounter + ' token(s)' }; }); cb.onTip(function (tip) { tipCounter += parseInt(tip['amount']); lastTipAmount = parseInt(tip['amount']); lastTipper = tip['from_user']; lastItem = getItem(tip['amount']); if (lastItem) { cb.sendNotice(tip['from_user'] + ' wants to see: ' + getItem(tip['amount']), '', '#ABFFFB', '#000000', 'bold'); } cb.drawPanel(); }); cb.onEnter(function (user) { var notices = 'Welcome ' + user['user'] + '. ' + cb.room_slug + ' is showing something for a tip.\n'; notices += 'Type /list to see a list of things ' + cb.room_slug + ' will be showing.'; cb.sendNotice(notices, user['user'], '', '', 'bold'); }); cb.onMessage(function(msg) { if(msg['m'].match(/\/list/i)) { msg['X-Spam'] = true; showList(msg['user']); } return msg; }); function getItem(tokens) { for(var i=1;i<=10;i++) { if(parseInt(cb.settings['item_' + i + '_price']) == parseInt(tokens)) { return cb.settings['item_' + i]; } } } function showList(user) { var notices = '*** Tip to See One of The Following: ***'; for(var i=1;i<=10;i++) { if(cb.settings.get('item_' + i) && (parseInt(cb.settings['item_' + i + '_price']) > 0)) { notices += '\nTip ' + cb.settings['item_' + i + '_price'] + ' for: ' + cb.settings['item_' + i]; } } cb.sendNotice(notices, user, '#FCFCD7', '', 'bold'); } function advertise() { var notices = ':tipsshow001 \n'; notices += 'Type /list to see a list of things ' + cb.room_slug + ' will be showing.'; cb.sendNotice(notices, '', '', '#AB001C'); cb.setTimeout(advertise, cb.settings.notification_wait_time * 60000); } function init() { advertise(); } init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.