Bots Home
|
Create an App
New Follower Plus
Author:
everlast69_bio
Description
Source Code
Launch Bot
Current Users
Created by:
Everlast69_Bio
// Begining of New Follower Fubction // /*jshint esversion: 6 */ var messages = []; function init() { for (let i = 1; i < 6;i++) { if (eval("cb.settings.m" + i) != "") { messages.push(eval("cb.settings.m" + i)); } } } cb.settings_choices = [ {name: 'instru', type: 'str', minLength: 1, maxLength: 1, defaultValue: 'X', required: false, label: 'Enter 1 to 5 custom new follower messages. Use @user in the message where you want the new followers name to appear'}, {name: 'showun', type: 'choice', choice1: 'yes', choice2: 'no', defaultvalue: 'yes', required: false, label: 'Sgow unfollowers?'}, {name: 'm1', type: 'str', minLength: 1, maxLength: 255, label: 'Message 1', defaultValue:'@user thank you for following me'}, {name: 'm2', type: 'str', minLength: 1, maxLength: 255, label: 'Message 2', required: false}, {name: 'm3', type: 'str', minLength: 1, maxLength: 255, label: 'Message 3', required: false}, {name: 'm4', type: 'str', minLength: 1, maxLength: 255, label: 'Message 4', required: false}, {name: 'm5', type: 'str', minLength: 1, maxLength: 255, label: 'Message 5', required: false}, ]; cb.onFollow(user => { //cb.sendNotice(user); let sex = ""; let tempName = user.user.replace(/_/gi, " "); const newFollower = tempName.trim(); const hasTokens = (user.has_tokens ? "tokens" : "no tokens"); let color = "assume grey"; switch (user.gender) { case 'm': sex = 'male'; break; case 'f': sex = 'trans'; break; case 's': sex = 'male'; break; case 'c': sex = 'a couple'; break; } if (user.tipped_recently) { color = "dark blue"; } else if (user.tipped_tons_recently) { color = "dark purple"; } else if (user.tipped_alot_recently) { color = "purple"; } else if (user.has_tokens) { //cb.sendNotice("has Tokens"); color = "blue"; } //cb.sendNotice(newfollower + "/" + hasTokens + "/" + color); let msg = getRandomMessage(newFollower); cb.sendNotice(msg, '', "#1f22db", "#ffffff"); let msgb = newFollower + " is " + sex + ", " + color + " and has " + hasTokens; cb.sendNotice(msgb, cb.room_slug, '#1f22db', '#ffffff'); }); cb.onUnFollow(user => { if ( cb.settings.showun == 'yes') { cb.sendNotice(user.user + ' has stopped following you',cb.room_slug, '#ff0000', '#ffffff'); } }); function getRandomIntInclusive(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } function getRandomMessage(newFollower) { let msg = messages[getRandomIntInclusive(0, messages.length - 1)]; return msg.replace('@user', newFollower); } init(); // End of New Follower
© Copyright Chaturbate 2011- 2024. All Rights Reserved.