Bots Home
|
Create an App
objecttesting
Author:
tok124
Description
Source Code
Launch Bot
Current Users
Created by:
Tok124
let myObject = { botname:'tok124 bot', noticebg:'#000000', noticetxtclr:'#FFFFFF', tipuser:[], finduser: function(user, amount) { let users = {name:user, amount:amount, sendmsg:0}; let userexist = false; for(let i = 0; i < this.tipuser.length; i++) { if(this.tipuser[i].name == user) { this.tipuser[i].amount += amount; userexist = true; break; } } if(!userexist) { this.tipuser.push(users); } }, onTip: function(tip) { this.finduser(tip.from_user, tip.amount); for(let i = 0; i < this.tipuser.length; i++) { if(this.tipuser[i].name == tip.from_user && this.tipuser[i].amount >= 500 && this.tipuser[i].sendmsg == 0) { cb.sendNotice("Thank you for tipping a total amount of " + this.tipuser[i].amount+ " Tokens " + this.tipuser[i].name, this.tipuser[i].name, this.noticebg, this.noticetxtclr, 'bold'); this.tipuser[i].sendmsg = 1; } } }, onEnter: function(user) { if(this.botname != '') { cb.sendNotice(this.botname+' is running','',this.noticebg, this.noticetxtclr,'bold'); } } } cb.onEnter(user => { myObject.onEnter(user); }); cb.onTip(tip => { myObject.onTip(tip); });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.