Bots Home
|
Create an App
Tip Title_sexyhotwifeporn1
Author:
gloriagrey
Description
Source Code
Launch Bot
Current Users
Created by:
Gloriagrey
//user settings { cb.settings_choices = [ {name: 'tipTitles', label: 'Do you want to display users\' tip totals as titles?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, ] } //variables { { var tipperArray = new Array; var numTippers = 0; } } //functions { { function tipperArrayPopulate(user) { tipperArray[numTippers] = new Array; tipperArray[numTippers][0] = user; tipperArray[numTippers][1] = 0; numTippers++; } function findTipper(user) { //find the index of the user for(var i = 0; i < tipperArray.length; i++) { if(tipperArray[i][0] == user) { break; } } //the user is not in the array. add him and call findTipper if(i == tipperArray.length) { tipperArrayPopulate(user); findTipper(user); } return i; } function setTipTitles(user, message) { if(cb.settings.kingTipper == 'Yes' && user == currentKing) { var m = ':smallCrown |' + tipperArray[findTipper(user)][1] + '| ' + message; } else { var m = '|' + tipperArray[findTipper(user)][1] + '| ' + message; } return m; } } } //onMessage { cb.onMessage(function (msg) { //turn the message into an array var message = msg['m'].split(' '); //tip titles, if turned on, as well as king's crown if(cb.settings.tipTitles == 'Yes' && parseInt(tipperArray[findTipper(msg['user'])][1]) > 0 && message[0].charAt(0) != "/") { msg['m'] = setTipTitles(msg['user'],msg['m']); } return msg; }); } //onTip { cb.onTip(function (tip) { tipperArray[findTipper(tip['from_user'])][1] += parseInt(tip['amount']); }); }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.