Bots Home
|
Create an App
dsktest
Author:
dsktest
Description
Source Code
Launch Bot
Current Users
Created by:
Dsktest
//user Settings //Variables var userArray = new Array; var numUsers = 0; var initialize = 0; var notifierMessage = cb.settings.spamMessage; var purple = "#C287C2";//original color: #B369B3 //On Enter // remove BELOW after testing. cb.onEnter(function(user) { cb.sendNotice ( userArray ); }); // remove ABOVE after testing. //functions function userArrayPopulate(user) { userArray[numUsers] = new Array; userArray[numUsers][0] = user; userArray[numUsers][1] = 0; userArray[numUsers][2] = 0; numUsers++; } function findUser(user) { //find the index of the user for(var i = 0; i < userArray.length; i++) { if(userArray[i][0] == user) { break; } } //the user is not in the array. add him and call findUser if(i == userArray.length) { userArrayPopulate(user); findUser(user); } return i; } function setUserTitles(user, message) { var m = userArray[findUser(user)][0] + '| ' + 'Level: |' + userArray[findUser(user)][2] + '|' + ' Coins: |' + userArray[findUser(user)][1] + '| ' + message; return m; } //onMessage cb.onMessage(function (msg) { //turn the message into an array var message = msg['m'].split(' '); //0 = invalid command, 1 = valid command var cmd = 0; //1 = user is already silenced var silenced = 0; var symbolString = '~`!@#$%^&*()_-+={[}]|\\:;"\'<,>.?/'; //tip titles, if turned on, as well as king's crown if(parseInt(userArray[findUser(msg['user'])][1]) > 0 && message[0].charAt(0) != "/") { msg['m'] = setUserTitles(msg['user'],msg['m']); } return msg; }); //onTip cb.onTip(function (tip) { userArray[findUser(tip['from_user'])][1] += parseInt(tip['amount']); }); //onEnter //init
© Copyright Chaturbate 2011- 2024. All Rights Reserved.