Bots Home
|
My Uploads
|
Create an App
DEV_TEST_01
Author:
natacha_doll
Description
Source Code
Launch Bot
Current Users
Created by:
Natacha_Doll
App Images
cb.settings_choices = []; var Com = { ///////////////////////////////////////////////// TOOLS CleanFromUser : function(tip){ Tip.amount = tip.amount; Tip.message = tip.message; Tip.to_user = tip.to_user; Tip.user = tip.from_user; Tip.in_fanclub = tip.from_user_in_fanclub; Tip.has_tokens = tip.from_user_has_tokens; Tip.is_mod = tip.from_user_is_mod; Tip.tipped_recently = tip.from_user_tipped_recently; Tip.tipped_alot_recently = tip.from_user_tipped_alot_recently; Tip.tipped_tons_recently = tip.from_user_tipped_tons_recently; Tip.gender = tip.from_user_gender; return Tip; }, GetDate : function(timestamp = false){ if(!timestamp){ d = new Date(); return d.getTime(); } else{ d = new Date(timestamp); return d.getHours()+'H'+d.getMinutes(); } }, start : 0, GetTimeSpent : function(timestamp = false){ if(timestamp){dif = Math.floor((this.GetDate() - timestamp) / 1000 );} else{dif = Math.floor((this.GetDate() - this.start) / 1000 );} if(dif >= 0 && dif < 60){ ts = dif+'s'; } else if(dif >= 60 && dif < 3600){ min = Math.floor(dif/60); sec = Math.floor(dif%60); ts = min+'m'+sec+'s'; } else{ hour = Math.round(dif/3600); min = Math.floor((dif%3600)/60); sec = Math.floor((dif%3600)%60); ts = hour+'h'+min+'m'+sec+'s'; } return ts; }, indexOf : function(s, a, b){ var i; if (typeof b === 'undefined'){b = '';} for(i = 0; i < a.length; i += 1){ if((b ? a[i][b] : a[i]) === s){return i;} } return -1; }, ///////////////////////////////////////////////// BROADCASTER'S SETTINGS sk_state : '', tm_state : '', pl_state : '', AddChoices : function(nb,id,lbl,type,def,req){ for(i=1;i<=nb;i++){ cb.settings_choices.push({name:id+i,label:lbl+i,type:type,defaultValue:def,required:req}); } }, ///////////////////////////////////////////////// SHORTKEY sk_param : [cb.settings.Mess_1,cb.settings.Mess_2,cb.settings.Mess_3,cb.settings.Mess_4,cb.settings.Mess_5,cb.settings.Mess_6,cb.settings.Mess_7,cb.settings.Mess_8,cb.settings.Mess_9,cb.settings.Mess_10], sk : [], sk_user_param : [cb.settings.FMess_1,cb.settings.FMess_2,cb.settings.FMess_3,cb.settings.FMess_4,cb.settings.FMess_5,cb.settings.FMess_6,cb.settings.FMess_7,cb.settings.FMess_8,cb.settings.FMess_9,cb.settings.FMess_10], sk_user : [], CalcSk : function(){ this.sk.push({id_sk:0,msg:'SHORTKEY LIST -> /sklist'}); t = 1; for(i = 0;i < this.sk_param.length;i++){ if(this.sk_param[i] != ""){ this.sk.push({id_sk:t,msg:this.sk_param[i]}); t++; } } this.sk_user.push({id_sk:0,msg:'SHORTKEY LIST -> /sklist'}); t = 1; for(i = 0;i < this.sk_user_param.length;i++){ if(this.sk_user_param[i] != ""){ this.sk_user.push({id_sk:t,msg:this.sk_user_param[i]}); t++; } } }, GetSk : function(id_sk,id_user){ if(this.sk.length == 0){this.CalcSk();} if(this.userlist[id_user].num >= 7){ if(this.indexOf(parseInt(id_sk),this.sk,'id_sk') == -1){ notice = 'Nope, this shortkey can\'t be found ... /sklist ?'; this.SendNot(notice,'warning',this.userlist[id_user].user); return false; } else{ msg = {}; msg.m = this.userlist[id_user].rank+this.sk[id_sk].msg; msg.c = this.userlist[id_user].color; this.Upgrade(id_user,'message'); return msg; } } else{ if(this.indexOf(parseInt(id_sk),this.sk_user,'id_sk') == -1){ notice = 'Nope, this shortkey can\'t be found ... /sklist ?'; this.SendNot(notice,'warning',this.userlist[id_user].user); return false; } else{ msg = {}; msg.m = this.userlist[id_user].rank+this.sk_user[id_sk].msg; msg.c = this.userlist[id_user].color; this.Upgrade(id_user,'message'); return msg; } } }, GetSkList : function(){ if(this.sk_user.length == 0){this.CalcSk();} if(this.sk_user.length > 0){ if(this.userlist[id_user].num >= 7){ notice = '::: SHORTKEY LIST\n'; for(i = 1;i < this.sk.length;i++){ notice += '/sk&'+this.sk[i].id_sk; notice += ' - > '+this.sk[i].msg; if(i < (this.sk.length - 1)){ notice += '\n'; } } this.SendNot(notice,'info',this.userlist[id_user].user); return false; } else{ notice = '::: SHORTKEY LIST\n'; for(i = 1;i < this.sk_user.length;i++){ notice += '/sk&'+this.sk_user[i].id_sk; notice += ' - > '+this.sk_user[i].msg; if(i < (this.sk_user.length - 1)){ notice += '\n'; } } this.SendNot(notice,'info',this.userlist[id_user].user); return false; } } else{ notice = 'There is no shortkey ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); return false; } }, ///////////////////////////////////////////////// TIPMENU tipmenu_params : [cb.settings.TipMenu_1,cb.settings.TipMenu_2,cb.settings.TipMenu_3,cb.settings.TipMenu_4,cb.settings.TipMenu_5,cb.settings.TipMenu_6,cb.settings.TipMenu_7,cb.settings.TipMenu_8,cb.settings.TipMenu_9,cb.settings.TipMenu_10,cb.settings.TipMenu_11,cb.settings.TipMenu_12,cb.settings.TipMenu_13,cb.settings.TipMenu_14,cb.settings.TipMenu_15,cb.settings.TipMenu_16,cb.settings.TipMenu_17,cb.settings.TipMenu_18,cb.settings.TipMenu_19,cb.settings.TipMenu_20], tipmenu : [], tipmenu_content :"", CalcTipMenu : function(){ for(i = 0;i < this.tipmenu_params.length;i++){ if(this.tipmenu_params[i].length > 0 && this.tipmenu_params[i].indexOf('-') != -1){ tab = this.tipmenu_params[i].split('-'); this.tipmenu.push({action:tab[0],amount:parseInt(tab[1])}); } } this.tipmenu_content += "TIPMENU : " for(i = 0;i < this.tipmenu.length;i++){ if(i > 0){ this.tipmenu_content += ' | '; } this.tipmenu_content += this.tipmenu[i].action+'-'+this.tipmenu[i].amount ; } }, GetTipMenu : function(){ if(this.tipmenu_content == ""){this.CalcTipMenu();} return this.tipmenu_content; }, ///////////////////////////////////////////////// USERBOARD userlist : [], ChkNewUser : function(user){ if(user.in_fanclub == true){num = 6;} if(user.is_mod == true){num = 7;} if(user.user == cb.room_slug){num = 8;} if(!user.in_fanclub && !user.is_mod && user.user != cb.room_slug){num = 0;} return num; }, GetUser : function(user,silence = false){ id_user = this.indexOf(user.user, this.userlist, 'user'); if(id_user == -1 && !silence){ this.AddUser(user.user,this.ChkNewUser(user)); id_user = this.indexOf(user.user, this.userlist, 'user'); } return id_user; }, AddUser : function(username,num){ this.userlist.push({user:username,nb_tip:0,amount:0,action:[],num:num,color:this.lvl[num].color,rank:this.lvl[num].rank,lbl:this.lvl[num].lbl,mess:0,cmd:0,firstconnect:this.GetDate(),lastconnect:this.GetDate()}); }, Upgrade : function(id_user,type,value = false,id_action = false){ if(type == 'message'){ this.userlist[id_user].mess++; this.userlist[id_user].lastconnect = this.GetDate(); } else if(type == 'cmd'){ this.userlist[id_user].cmd++; this.userlist[id_user].lastconnect = this.GetDate(); } else if(type == 'tip' && value > 0){ upgrade = false; if((this.userlist[id_user].amount == 0) && (this.userlist[id_user].amount + value > 0)){ upgrade = true; new_num = 1; } if((this.userlist[id_user].amount < 50) && (this.userlist[id_user].amount + value >= 50)){ upgrade = true; new_num = 2; } if((this.userlist[id_user].amount < 100) && (this.userlist[id_user].amount + value >= 100)){ upgrade = true; new_num = 3; } if((this.userlist[id_user].amount < 500) && (this.userlist[id_user].amount + value >= 500)){ upgrade = true; new_num = 4; } if((this.userlist[id_user].amount < 1000) && (this.userlist[id_user].amount + value >= 1000)){ upgrade = true; new_num = 5; } this.userlist[id_user].amount = this.userlist[id_user].amount + value; this.userlist[id_user].nb_tip++; this.userlist[id_user].lastconnect = this.GetDate(); if(id_action > -1){ this.userlist[id_user].action.push({action:this.tipmenu[id_action].action,amount:value,date:this.GetDate()}); } else{ this.userlist[id_user].action.push({action:'NO ACTION',amount:value,date:this.GetDate()}); } if(upgrade == true){ this.userlist[id_user].num = new_num; this.userlist[id_user].color = this.lvl[new_num].color; this.userlist[id_user].rank = this.lvl[new_num].rank; this.userlist[id_user].lbl = this.lvl[new_num].lbl; notice = 'Congratulation '+this.userlist[id_user].user+' ! With this Tip you\'re upgraded to '+this.lvl[new_num].lbl ; this.SendNot(notice,'valid',this.userlist[id_user].user); } } }, GetUserBoard : function(){ }, ///////////////////////////////////////////////// TIP TotalTip : 0, NbTip : 0, AllTips : [], NbTippers : 0, AddTip : function(tip,id_user){ id_action = this.indexOf(tip.amount,this.tipmenu,'amount'); this.TotalTip = this.TotalTip + tip.amount; this.NbTip++; this.Upgrade(id_user,'tip',tip.amount,id_action); if(id_action > -1){ act = this.tipmenu[id_action].action; notice = this.userlist[id_user].user+' has tip for : '+this.tipmenu[id_action].action; this.SendNot(notice,'valid'); } else{ act = 'NO ACTION'; } if(this.indexOf(this.userlist[id_user].user,this.AllTips,'user') == -1){this.NbTippers++;} this.AllTips.push({user:this.userlist[id_user].user,action:act,amount:tip.amount,rank:this.userlist[id_user].rank,date:this.GetDate()}); }, GetUserTipBoard : function(id_user,f_user){ usertipboard = '::: '+this.userlist[f_user].user+' TIPBOARD\n'; usertipboard += this.userlist[f_user].amount+' Tokens in '+this.userlist[f_user].nb_tip+' Tips in '+this.GetTimeSpent(this.userlist[f_user].firstconnect); this.SendNot(usertipboard,'info',this.userlist[id_user].user); }, GetMyTipBoard : function(id_user){ mytipboard = '::: MY TIPBOARD\n'; mytipboard += this.userlist[id_user].amount+' Tokens in '+this.userlist[id_user].nb_tip+' Tips in '+this.GetTimeSpent(this.userlist[id_user].firstconnect); this.SendNot(mytipboard,'info',this.userlist[id_user].user); }, GetTipBoard : function(id_user){ tipboard = '::: TIPBOARD\n'; tipboard += this.TotalTip+' Tokens in '+this.NbTip+' Tips by '+this.NbTippers+' users in '+this.GetTimeSpent(); this.SendNot(tipboard,'info',this.userlist[id_user].user); }, GetTipList : function(id_user){ if(this.NbTip > 0){ tiplist = '::: TIPLIST\n'; for(i=0;i < this.AllTips.length;i++){ tiplist += 'User->'+this.AllTips[i].user+' | Action->'+this.AllTips[i].action+' | Amount->'+this.AllTips[i].amount+' Rank->'+this.AllTips[i].rank+' | Date->'+this.GetDate(this.AllTips[i].date)+'\n'; } this.SendNot(tiplist,'info',this.userlist[id_user].user); } else{ notice = 'The TipList is empty ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } }, GetUserTipList : function(id_user,f_user){ if(this.userlist[f_user].amount > 0){ tiplist = '::: '+this.userlist[f_user].user+' TIPLIST\n' for(i=0;i < this.AllTips.length;i++){ if(this.AllTips[i].user == this.userlist[f_user].user){ tiplist += 'User->'+this.AllTips[i].user+' | Action->'+this.AllTips[i].action+' | Amount->'+this.AllTips[i].amount+' Rank->'+this.AllTips[i].rank+' | Date->'+this.GetDate(this.AllTips[i].date)+'\n'; } } this.SendNot(tiplist,'info',this.userlist[id_user].user); } else{ notice = 'The '+this.userlist[f_user].user+' TipList is empty ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } }, GetLeaderBoard : function(id_user,to_user = false){ if(this.TotalTip > 0){ style = 'info'; TipperList = []; for(i=0;i < this.AllTips.length;i++){ t_user = this.indexOf(this.AllTips[i].user,TipperList,'user'); if(t_user > -1){ TipperList[t_user].amount = TipperList[t_user].amount + this.AllTips[i].amount ; TipperList[t_user].nb_tip++; } else{ TipperList.push({user:this.AllTips[i].user,amount:this.AllTips[i].amount,nb_tip:1}); } } TipperList.sort(function(a, b){ return b.amount-a.amount; }); if(TipperList.length > 5){nb_tipper = 5;} else{nb_tipper = TipperList.length}; notice = '::: LEADERBOARD \n'; for(i=0;i<nb_tipper;i++){ x = i+1; notice += x+' - '+TipperList[i].user+' '+TipperList[i].amount+' Tokens ( '+TipperList[i].nb_tip+' Tips )'; if(i < 4){ notice += '\n'; } } if(to_user == false){ receive_user = this.userlist[id_user].user; group = ''; } else{ if(to_user == '$all'){ receive_user = ''; group = ''; } else if(to_user == '$modo'){ receive_user = ''; group = 'red'; } else if(to_user == '$fan'){ receive_user = ''; group = 'green'; } else{ obj = {}; obj.user = to_user; if(this.GetUser(obj,true) > -1){ receive_user = to_user; group = ''; } else{ receive_user = this.userlist[id_user].user; group = ''; notice = 'Nope, '+to_user+' isn\'t in userlist ... '; style = 'warning'; } } } this.SendNot(notice,style,receive_user,group); } else{ notice = 'The LeadeBoard is empty ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } }, ///////////////////////////////////////////////// LEVEL lvl : [], ChkLvl : function(){ this.lvl.push({lvl: 0,color:'#afafaf',rank:'[---]',lbl:'Grey',commands:['/tipmenu','/help','/time']}); this.lvl.push({lvl: 1,color:'#afafaf',rank:'[BRZ]',lbl:'Bronze',commands:['/tipmenu','/help','/time','/timeleft']}); this.lvl.push({lvl: 2,color:'#666666',rank:'[SLV]',lbl:'Silver',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard']}); this.lvl.push({lvl: 3,color:'#7b6ceb',rank:'[GLD]',lbl:'Gold',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard','/whisp']}); this.lvl.push({lvl: 4,color:'#d64fc0',rank:'[PLT]',lbl:'Platinium',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard','/whisp','/leaderboard']}); this.lvl.push({lvl: 5,color:'#8d1a8d',rank:'[DMD]',lbl:'Diamond',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard','/whisp','/sk','/sklist','/leaderboard']}); this.lvl.push({lvl: 6,color:'#276100',rank:'[FAN]',lbl:'Fan',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard','/whisp','/sk','/sklist','/leaderboard']}); this.lvl.push({lvl: 7,color:'#ff4949',rank:'[MOD]',lbl:'Moderator',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/mytipboard','/whisp','/greyoff','/greyon','/timerup','/timerdown','/ban','/mute','/sk','/sklist','/userlist',,'/tipboard','/leaderboard']}); this.lvl.push({lvl: 8,color:'#f18226',rank:'[HOT]',lbl:'Broadcaster',commands:['/tipmenu','/tipmenusend','/help','/time','/timeleft','/whisp','/greyoff','/greyon','/timerup','/timerdown','/ban','/mute','/setmodo','/unsetmodo','/crazy','/bye','/sk','/sklist','/userlist','/tipboard','/tiplist','/leaderboard']}); }, ///////////////////////////////////////////////// COMMANDES ChkCmd : function(msg){ if(msg.m.indexOf('/') != -1){ args = msg.m.split('&'); return args ; } else{ return false; } }, Cmd : function(args,id_user){ listcmd = this.lvl[this.userlist[id_user].num].commands ; if(listcmd.indexOf(args[0]) > -1){ this.Upgrade(id_user,'cmd'); command = args[0]; /////////////////////////// TIPMENU if(command == '/tipmenu'){ if(cb.settings.Tm_Active == 'YES'){ notice = this.GetTipMenu(); this.SendNot(notice,'info',this.userlist[id_user].user); } else{ notice = 'Nope, TipMenu is disabled ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } } /////////////////////////// TIPMENUSEND else if(command == '/tipmenusend'){ if(cb.settings.Tm_Active == 'YES'){ to_user = []; if(args[1] == '$all'){ to_user.user = ''; to_group = ''; } else if(args[1] == '$modo'){ to_user.user = ''; to_group = 'red'; } else{ to_user.user = args[1]; to_group = ''; } if(to_user.user == '' || (this.GetUser(to_user,true) > -1)){ notice = cb.room_slug+' sent you the TipMenu \n'; notice += this.GetTipMenu(); this.SendNot(notice,'info',to_user.user,to_group); } else{ notice = 'Nope, '+to_user.user+' isn\'t in userlist ... '; this.SendNot(notice,'warning',this.userlist[id_user].user); } } else{ notice = 'Nope, TipMenu is disabled ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } } /////////////////////////// TIME else if(command == '/time'){ notice = '::: TIME STATS : \n'; notice += 'The '+cb.room_slug+'\'s show started since '+this.GetTimeSpent(); notice += '\n'; notice += ' You\'re in '+cb.room_slug+'\'s room since '+this.GetTimeSpent(this.userlist[id_user].firstconnect); this.SendNot(notice,'info',this.userlist[id_user].user); } /////////////////////////// WHISPER else if(command == '/whisp'){ if(args[1] && args[2]){ this.SendWhisp(args[1],args[2],id_user); } else{ notice = 'Invalid command e.g: /whisp&your message&username ... '; this.SendNot(notice,'error',this.userlist[id_user].user); } } /////////////////////////// SK else if(command == '/sk'){ if(cb.settings.Sk_Active == 'YES'){ return this.GetSk(args[1],id_user); } else{ notice = 'Nope, Shortkey is disabled ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } } /////////////////////////// SKLIST else if(command == '/sklist'){ if(cb.settings.Sk_Active == 'YES'){ return this.GetSkList(); } else{ notice = 'Nope, Shortkey is disabled ...'; this.SendNot(notice,'warning',this.userlist[id_user].user); } } /////////////////////////// GREY else if(command == '/grey'){ } /////////////////////////// TIMER else if(command == '/timer'){ } /////////////////////////// MUTE else if(command == '/mute'){ } /////////////////////////// MODO else if(command == '/modo'){ } /////////////////////////// CRAZY else if(command == '/crazy'){ } /////////////////////////// BYE else if(command == '/bye'){ } /////////////////////////// USERBOARD else if(command == '/userboard'){ } /////////////////////////// MYTIPBOARD else if(command == '/mytipboard'){ this.GetMyTipBoard(id_user); } /////////////////////////// TIPBOARD else if(command == '/tipboard'){ if(args[1]){ filter = {}; filter.user = args[1]; f_user = this.GetUser(filter,true); if(f_user > -1){ this.GetUserTipBoard(id_user,f_user); } else{ notice = 'Nope, '+filter.user+' isn\'t in userlist ... '; this.SendNot(notice,'warning',this.userlist[id_user].user); } } else{ this.GetTipBoard(id_user); } } /////////////////////////// TIPBOARD else if(command == '/tiplist'){ if(args[1]){ filter = {}; filter.user = args[1]; f_user = this.GetUser(filter,true); if(f_user > -1){ this.GetUserTipList(id_user,f_user); } else{ notice = 'Nope, '+filter.user+' isn\'t in userlist ... '; this.SendNot(notice,'warning',this.userlist[id_user].user); } } else{ this.GetTipList(id_user); } } else if(command == '/leaderboard'){ if(args[1]){ this.GetLeaderBoard(id_user,args[1]); } else{ this.GetLeaderBoard(id_user); } } /////////////////////////// HELP else if(command == '/help'){ } else{ this.SendNot('Command not found ... ','error',this.userlist[id_user].user); } } else{ this.SendNot('Command not found or you don\'t have permissions to use it ... ','error',this.userlist[id_user].user); } }, ///////////////////////////////////////////////// MESSAGE SendNot : function(msg,style,to,group){ if(style == 'error'){color = '#be0000';background = '#e4b2b2';weight = 'bold';} else if(style == 'valid'){color = '#6fa007';background = '#ceeb90';weight = 'bold';} else if(style == 'info'){color = '#01375c';background = '#bfd9eb';weight = 'bold';} else if(style == 'warning'){color = '#6b5a00';background = '#ffeb83';weight = 'bold';} else if(style == 'simple'){color = '#888888';background = '';weight = '';} else if(style == 'whisp_send'){color = '#888888';background = '#f5f5f5';weight = '';} else if(style == 'whisp_receive'){color = '#888888';background = '#f1d7f5';weight = '';} if(!to){to = ''}; if(!group){group = '';} cb.sendNotice(msg,to,background,color,weight,group); }, SendWhisp : function(mess,to_user,id_user){ to_id_user = this.indexOf(to_user,this.userlist,'user'); if(to_id_user > -1){ if(to_id_user != id_user){ if(mess != ""){ notice_to = '['+this.userlist[id_user].user+']->[you] : '+mess; this.SendNot(notice_to,'whisp_send',this.userlist[to_id_user].user); notice_from = '[you]->['+this.userlist[to_id_user].user+'] : '+mess; this.SendNot(notice_from,'whisp_receive',this.userlist[id_user].user); } else{ notice = 'Nope, Your whisp isn\'t valid ...' ; this.SendNot(notice,'warning',this.userlist[id_user].user); } } else{ notice = 'Nope, you can\'t whisper to yourself ... ' ; this.SendNot(notice,'warning',this.userlist[id_user].user); } } else{ notice = 'Nope, '+to_user+' isn\'t in userlist ... '; this.SendNot(notice,'warning',this.userlist[id_user].user); } }, SendMsg: function(msg,id_user){ if(this.userlist[id_user].num > 0){ msg.c = this.userlist[id_user].color; msg.m = this.userlist[id_user].rank+msg.m; this.Upgrade(id_user,'message'); return msg; } else{ msg.c = ''; msg.m = ''; msg['X-Spam'] = true; notice = 'Your rank does not allow you, to write messages, 1 TOKEN to upgrade to BRONZE !' ; this.SendNot(notice,'simple',this.userlist[id_user].user); return msg; } } } // EVENTS GRABBER cb.onEnter(function(user){ /* user: user who entered the room in_fanclub: is the user in the broadcaster’s fan club has_tokens: does the user have at least 1 token is_mod: is the user a moderator tipped_recently: is the user a “dark blue”? tipped_alot_recently: is the user a “purple”? tipped_tons_recently: is the user a “dark purple”? gender: “m” (male), “f” (female), “s” (trans), or “c” (couple) */ id_user = Com.GetUser(user); }); cb.onMessage(function(msg){ /* c: message color m: the message text user: username of message sender f: message font in_fanclub: is the user in the broadcasters fan club has_tokens: does the user have at least 1 token is_mod: is the user a moderator tipped_recently: is the user a “dark blue”? tipped_alot_recently: is the user a “purple”? tipped_tons_recently: is the user a “dark purple”? gender: “m” (male), “f” (female), “s” (trans), or “c” (couple) */ id_user = Com.GetUser(msg); args = Com.ChkCmd(msg); if(args){ ret = Com.Cmd(args,id_user); if(!ret){ msg['X-Spam'] = true; } else{ msg.m = ret.m; msg.c = ret.c; } } else{ msg = Com.SendMsg(msg,id_user); } }); cb.onTip(function(tip){ /* amount: amount of tip message: message in tip to_user: user who received tip from_user: user who sent tip from_user_in_fanclub: is the user in the broadcasters fan club from_user_has_tokens: does the user have at least 1 token from_user_is_mod: is the user a moderator from_user_tipped_recently: is the user a “dark blue”? from_user_tipped_alot_recently: is the user a “purple”? from_user_tipped_tons_recently: is the user a “dark purple”? from_user_gender: “m” (male), “f” (female), “s” (trans), or “c” (couple) */ Tip = Com.CleanFromUser(tip); id_user = Com.GetUser(Tip); Com.AddTip(Tip,id_user); }); cb.onLeave(function(user){ /* user: user who left the room in_fanclub: is the user in the broadcaster’s fan club has_tokens: does the user have at least 1 token is_mod: is the user a moderator tipped_recently: is the user a “dark blue”? tipped_alot_recently: is the user a “purple”? tipped_tons_recently: is the user a “dark purple”? gender: “m” (male), “f” (female), “s” (trans), or “c” (couple) */ id_user = Com.GetUser(user); }); cb.settings_choices.push({name:'Sk_Active',label:'Active ShortKey',type:'choice',choice1:'yes',choice2:'no',defaultValue:'yes',required:true}); Com.AddChoices(10,'Mess_','Broadcaster Message ','str','',false); Com.AddChoices(10,'FMess_','User Message ','str','',false); cb.settings_choices.push({name:'Tm_Active',label:'Active TipMenu',type:'choice',choice1:'yes',choice2:'no',defaultValue:'yes',required:true}); Com.AddChoices(20,'TipMenu_','[action-10] TipMenu ','str','',false); Com.start = Com.GetDate(); Com.ChkLvl(); //Com.CalcTipMenu();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.