Bots Home
|
Create an App
onentertest
Author:
tok124
Description
Source Code
Launch Bot
Current Users
Created by:
Tok124
/* #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# BOT INFORMATION & CREDITS #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# Bot Name: CBEpicClubBot Bot Version: v1.0 Beta Version Bot Creator: tok124 Bot Contributors: Currently there is no contributors. I have developed everything myself from scratch so i take full credit for this bot. Bot Description: In this bot you can create a club for members, Club members can have a discount on tipmenu, in the bot settings you choose by yourself how many % discount to give to club members. Tip Menu Example: Notice: ~~### TOK124'S TIPMENU ###~~ Notice: PM(10) | Developers Club Discount (7) Notice: Flash Pussy(20) | Developers Club Discount (14) Notice: Flash Ass(30) | Developers Club Discount (21) Notice: Flash Boobs(40) | Developers Club Discount (28) Bug Reports: Bug reports can be send to skillzorskillsson@gmail.com Known Issues: if you apply a gif next to name for club members they will not be able to run commands like "/starttimer 3" from All in One Bot or Ultra Bot. I am not really sure why it does not work. or if there is any solution to it. If you do know a way to fix that then please, Send an email to skillzorskillsson@gmail.com but this honestly seem to be more of an issue in the other bots. I have done a lot of testing with this. I tried to start my follower notice bot and run this bot on same time and i was able to run commands from follower notice bot even tho i had a gif next to the name. But if start All in One Bot and run this bot then i cannot run commands from all in one bot. So therefore it seems more like it's a problem with their bot and not with my bot. So until this has been fixed i would not recommend that you add moderators to the club. #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# */ let variables = { maxitems:30, items:[], prices:[], onTip: function(user, amount, discounts, clrbg, clrtxt) { let usertipamount = parseInt(amount); for(let i = 1; i <= this.maxitems; i++) { if(clubmembers(user) == true) { if(usertipamount == discount(this.prices[i], discounts)) { cb.sendNotice(user+' tipped for '+this.items[i]+'. Thank you very much !', '', clrbg, clrtxt, 'bold'); } }else{ if(usertipamount == this.prices[i]) { cb.sendNotice(user+' tipped for '+this.items[i]+'. Thank you very much !', '', clrbg, clrtxt, 'bold'); } } } } } let discountmsg; cb.settings_choices = [ {name:'clubname', type:'str', label:'Name of club', required:true}, {name:'bgclubmember', type:'str', label:'Background Text Color for Club Member (e.g. #000000)', defaultValue:'#F1F1F1'}, {name:'clubmember', type:'str', label:'Names of users in club (Separated by comma)'}, {name:'clubgif', type:'str', label:'Club Gif next to username in chat', defaultValue:':heart3'}, //{name:'enablemenu', type:'choice', label:'Enable Tip Menu', choice1:'Yes', choice2:'No', defaultValue:'Yes'}, //{name:'enablediscount', type:'choice', label:'Enable Discount for Fanclub Members', choice1:'Yes', choice2:'No', defaultValue:'Yes'}, {name:'noticebgclr', type:'str', label:'Tipmenu Notice Background Color (Hex Color: e.g. #000000)', defaultValue:'#000000'}, {name:'noticeclr', type:'str', label:'Tipmenu Notice Text Color (Hex Color: e.g. #000000)', defaultValue:'#FFFFFF'}, {name: 'discount', type: 'int', minValue:1,maxValue:99,label: 'Discount Percentage for Fan Club Members',defaultValue: 30}, {name: 'item1', type: 'str', label: '(Format: price--item, Example: 50--Flash Boobs) Item1',defaultValue: '10--PM', required:true}, ]; for(let i = 2; i <= variables.maxitems; i++) { cb.settings_choices.push({name:'item'+i, type:'str', label:'item '+i, required:false}); } cb.onTip(tip => { variables.onTip(tip.from_user, tip.amount, cb.settings.discount, cb.settings.noticebgclr, cb.settings.noticeclr); }); cb.onMessage(msg => { if(clubmembers(msg.user) == true) { msg.background = cb.settings.bgclubmember; msg.m = cb.settings.clubgif+' '+msg.m; } return msg; }); function clubmembers(user) { let members = cb.settings.clubmember.split(','); for(let i = 0; i < members.length; i++) { if(members[i].trim() == user) { return true; } } } function discount(price, discount) { return Math.round(price - (price * discount/100)); } function notifier() { if(discountmsg != '~~### '+cb.room_slug.toUpperCase()+'\'S TIPMENU ###~~ ') { cb.sendNotice(discountmsg.slice(0, -1),'',cb.settings.noticebgclr, cb.settings.noticeclr, 'bold'); } cb.setTimeout(notifier, 60000); } function init() { discountmsg = '~~### '+cb.room_slug.toUpperCase()+'\'S TIPMENU ###~~\n'; for (var i = 1; i <= variables.maxitems; i++) { let item; item = cb.settings['item'+i]; if(item) { let menuarray = item.split('--'); if (menuarray[1]===undefined) { cb.sendNotice('Unreocognized Format. Make sure to add x2 dashes to separate price from item. EXAMPLE: 50--Flash Boobs',cb.room_slug,cb.settings.noticebgclr, cb.settings.noticeclr,'bold') }else{ var tipamount = parseInt(menuarray[0]); if(tipamount > 0) { variables.prices[i] = tipamount; variables.items[i] = menuarray[1]; discountmsg += menuarray[1]+'('+tipamount+') | '+cb.settings.clubname+' Club Discount ('+discount(tipamount,cb.settings.discount)+')\n'; } } } } if(discountmsg != '~~### '+cb.room_slug.toUpperCase()+'\'S TIPMENU ###~~ ') { cb.sendNotice(discountmsg.slice(0, -1),'',cb.settings.noticebgclr, cb.settings.noticeclr, 'bold'); }else{ cb.sendNotice('Error-No menu items found','',cb.settings.noticebgclr, cb.settings.noticeclr, 'bold'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.