Apps Home
|
Create an App
TipMenu + onEnter
Author:
mexolius
Description
Source Code
Launch App
Current Users
Created by:
Mexolius
var tips = new Map() var entryNotice = ''; var tipThanks; var sep = ' -+- '; cb.settings_choices = [ {name:'sep', type:'str', label:'Separator character (It goes between your items)'}, {name:'item1', type:'str', label:'Item 1 (eg 10--flash tits)'}, {name:'item2', type:'str', required: false, label:'Item 2'}, {name:'item3', type:'str', required: false, label:'Item 3'}, {name:'item4', type:'str', required: false, label:'Item 4'}, {name:'item5', type:'str', required: false, label:'Item 5'}, {name:'item6', type:'str', required: false, label:'Item 6'}, {name:'item7', type:'str', required: false, label:'Item 7'}, {name:'item8', type:'str', required: false, label:'Item 8'}, {name:'item9', type:'str', required: false, label:'Item 9'}, {name:'item10', type:'str', required: false, label:'Item 10'} ]; cb.onTip(tip=>{ var prize= tips.get(tip.amount).value; if(prize) cb.chatNotice(tip.from_user + " tipped for " + prize + "! Thank You <3"); else cb.chatNotice("Thank you for your tip " +tip.from_user+" <3" ); }); cb.onEnter(user=>{ if(entryNotice!==undefined)cb.sendNotice(entryNotice,user.user); }); function addToMap(rawTipData) { var name = rawTipData.substring(0,rawTipData.indexOf('/')); var amt = rawTipData.slice(rawTipData.indexOf('/')-rawTipData.length+1); tips.set(amt ,name ); entryNotice+=name + '=' + amt + ' '+sep+' '; } function initTips() { for(var i=1;i<11;i++){ var currit=cb.settings['item'+i.toString()]; if(currit) { addToMap(currit); } } } function init() { initTips(); sep = cb.settings.sep; } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.