Bots Home
|
Create an App
TIP
Author:
zazaza111
Description
Source Code
Launch Bot
Current Users
Created by:
Zazaza111
/* bot Tip Menu Plus */ var tip_amt = 0; var separator_char = "| "; var msg; var MAXITM=11; var tipsmenuprices = []; var tipsmenuitems= []; var SEPMAX = 9; var HRT = '\u2665'; // ♥ RHOMB = '\u2666'; // ♦ TEXTSTAR = '\u2605'; // ★ separators = [ {label:'Hearts',shortcut:':heart3'}, {label:'Glitter',shortcut:':pixelglitter'}, {label:'Flowers',shortcut:':tinyflower2'}, {label:'Bow',shortcut:':bluebow'}, {label:'Hearts2',shortcut:':pixelheart'}, {label:'Smiley',shortcut:':smile'}, {label:'Text Heart',shortcut:HRT}, {label:'Text Diamond',shortcut:RHOMB}, {label:'Text Star',shortcut:TEXTSTAR}, ] cb.settings_choices = [ {name: 'sepchar', type: 'choice', choice1: 'Vertical Bar', choice2: 'Hearts', choice3:'Glitter',choice4:'Flowers',choice5:'Bow',choice6:'Hearts2',choice7:'Smiley',choice8:'Text Heart', choice9:'Text Diamond', choice10:'Text Star', defaultValue: 'Vertical Bar', label: "Separator character"}, {name:'item1', type:'str', label:'Price 1 (eg 10--flash tits)',}, {name:'item2', type:'str', required: false, label:'Price 2',}, {name:'item3', type:'str', required: false, label:'Price 3',}, {name:'item4', type:'str', required: false, label:'Price 4',}, {name:'item5', type:'str', required: false, label:'Price 5',}, {name:'item6', type:'str', required: false, label:'Price 6',}, {name:'item7', type:'str', required: false, label:'Price 7',}, {name:'item8', type:'str', required: false, label:'Price 8',}, {name:'item9', type:'str', required: false, label:'Price 9',}, {name:'item10', type:'str', required: false, label:'Price 10',}, {name:'noticecolor', type:'str', label:'Color', defaultValue: '#FF0000'}, {name: 'chat_ad', type:'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay notice (minimum 1)'} ]; cb.onTip(function (tip) { tip_amt=parseInt(tip['amount']); for (var i = 1; i <= MAXITM; i++) { if (tip_amt == tipsmenuprices[i]) { cb.sendNotice(tip['from_user'] + ' tipped for ' + tipsmenuitems[i],'','',cb.settings['noticecolor'],'bold'); } } }); function chatAd() { if (msg!='Tip Menu: ') { cb.sendNotice(msg,'','',cb.settings['noticecolor'],'bold'); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); function init() { for (i=0;i<=SEPMAX-1;i++) { if (cb.settings['sepchar'] == separators[i].label) { separator_char = separators[i].shortcut + ' '; } } msg = 'Tip Menu: '; for (i=1;i<=MAXITM;i++) { var temp; temp=cb.settings['item' + i]; if (temp) { var arr= temp.split('--'); if (arr[1]===undefined) { cb.sendNotice('Err-You need two dashes to separate the tip amount and menu item for item no '+ i,'','',cb.settings['noticecolor'],'bold'); } else { var amt=parseInt(arr[0]); if (amt>0) { tipsmenuprices[i]=amt; tipsmenuitems[i]=arr[1]; if (i>=2) { msg += separator_char; } msg += arr[1] + '(' + amt + ') '; } } } } if (msg!= 'Tip Menu: ') { cb.sendNotice(msg,'','',cb.settings['noticecolor'],'bold'); } else { cb.sendNotice('Err-No menu items ','','',cb.settings['noticecolor'],'bold'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.