Bots Home
|
Create an App
verosendmenu
Author:
tok124
Description
Source Code
Launch Bot
Current Users
Created by:
Tok124
var maxitems = 3; // Change this number here to add more items in the bot settings for a bigger menu var sendmsg; // Do not touch this variable. This variable stores the tipmenu var tipmenuprice = []; var tipmenuitem = []; /* var priceinputs = true - this will add both item inputs and price inputs in the bot settings var priceinputs = false - This will add item inputs only and instead you separate item and price with x2 dashes (like this: 50--Flash Boobs) */ var priceinputs = false; cb.settings_choices = [ {name:'txtclr', type:'str', label:'Notification Text Color (hexcolor Example: #FFFFFF)'}, {name:'bgclr', type:'str', label:'Notification Backgroundd Color (hexcolor Example: #000000)'}, {name:'delay', type:'int', label:'Delay in minutes to send menu in chat', defaultValue:1}, {name:'alignmenu', type:'choice', label:'Align Menu',choice1:'Vertically', choice2:'Horizontally', defaultValue:'Vertically'}, ]; if(priceinputs == true) { for(var i = 1; i <= maxitems; i++) { cb.settings_choices.push({name:'item'+i, type:'str', label:'item '+i, required:false}); cb.settings_choices.push({name:'price'+i, type:'str', label:'price '+i, required:false}); } }else{ for(var i = 1; i <= maxitems; i++) { cb.settings_choices.push({name:'item'+i, type:'str', label:'item '+i, required:false}); } } cb.onTip(function (tip) { var amount = parseInt(tip.amount); for(var i = 1; i <= maxitems; i++) { if(priceinputs == true) { if(amount == cb.settings['price'+i]) { cb.sendNotice(tip.from_user+' Has tipped for '+cb.settings['item'+i], '', cb.settings.txtclr, cb.settings.bgclr, 'bold'); } }else{ if(amount == tipmenuprice[i]) { cb.sendNotice(tip.from_user+' Has tipped for '+cb.settings['item'+i], '', cb.settings.txtclr, cb.settings.bgclr, 'bold'); } } } }); cb.onEnter(function(user) { cb.sendNotice(sendmsg, user.user, cb.settings.txtclr, cb.settings.bgclr, 'bold'); }); cb.onMessage(function (msg) { if (msg['m'].match(/\/showmenu/i)) { msg['X-Spam'] = true; cb.sendNotice(sendmsg, msg.user, cb.settings.txtclr, cb.settings.bgclr, 'bold'); } }); function sendmenu() { if(sendmsg!="Tip Menu: ") { cb.sendNotice(sendmsg, '', cb.settings.txtclr, cb.settings.bgclr, 'bold'); } cb.setTimeout(sendmenu, (cb.settings.delay*60000)); } cb.setTimeout(sendmenu, (cb.settings.delay*60000)); function sendcommands() { var msg = "ROOM COMMANDS\n"; msg += "/showmenu - Show the tipmenu"; cb.sendNotice(msg, '', cb.settings.txtclr, cb.settings.bgclr, 'bold'); cb.setTimeout(sendcommands, 180000); } cb.setTimeout(sendcommands, 180000); function init() { if(cb.settings.alignmenu == "Vertically") { sendmsg = "Tip Menu:\n"; }else{ sendmsg = "Tip Menu: "; } for(var i = 1; i <= maxitems; i++) { var item = cb.settings['item'+i]; if(item) { if(priceinputs == true) { var price = parseInt(cb.settings['price'+i]); if(price > 0) { if(cb.settings.alignmenu == "Vertically") { sendmsg += cb.settings['item'+i]+"("+cb.settings['price'+i]+")\n"; }else{ sendmsg += cb.settings['item'+i]+"("+cb.settings['price'+i]+") :heart2"; } } }else{ var menu = item.split('--'); if(menu[1] === undefined) { cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no '+ i,'',cb.settings.noticebg,cb.settings.noticecolor,'bold'); }else{ var price = parseInt(menu[0]); if(price > 0) { tipmenuprice[i]=price; tipmenuitem[i]=menu[1]; if(cb.settings.alignmenu == "Vertically") { sendmsg += menu[1]+"("+price+")\n"; }else{ sendmsg += menu[1]+"("+price+") :heart2 "; } } } } } } if(sendmsg!="Tip Menu: ") { cb.sendNotice(sendmsg, '', cb.settings.txtclr, cb.settings.bgclr, 'bold'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.