Bots Home
|
Create an App
TipMenu-Bot
Author:
m4g3d_pl0xx
Description
Source Code
Launch Bot
Current Users
Created by:
M4g3d_Pl0xx
/** * 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:'show ass'}, {name:'item_1_price', type:'int', label:'Price for item #1', defaultValue:25}, {name:'item_2', type:'str', label:'Item #2 (optional)', defaultValue:'all fours'}, {name:'item_2_price', type:'int', label:'Price for item #2', defaultValue:35}, {name:'item_3', type:'str', label:'Item #3 (optional)', defaultValue:'show feet'}, {name:'item_3_price', type:'int', label:'Price for item #3', defaultValue:45}, {name:'item_4', type:'str', label:'Item #4 (optional)', defaultValue:'spread cheeks'}, {name:'item_4_price', type:'int', label:'Price for item #4', defaultValue:50}, {name:'item_5', type:'str', label:'Item #5 (optional)', defaultValue:'finger hole'}, {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:15} ]; 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 = 'Tip to See v1.2 by zingknaat\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 Chaturbate 2011- 2024. All Rights Reserved.