Bots Home
|
Create an App
test_bot_what_a_shock
Author:
bfs_uk
Description
Source Code
Launch Bot
Current Users
Created by:
Bfs_Uk
/** * Timed messenger - picks a random message to send every x seconds * Written for HypnoticAphrodite by a fan */ cb.settings_choices = [ { name: 'timeout', type: 'int', minValue: 0, label: 'How often should I post a message, in seconds?', defaultValue: 300 }, { name: 'random', type: 'choice', label: 'Should I randomise how often it appears? (If yes, will be up to half shorter or half longer)', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'colour', type: 'str', label: 'What colour do you want the message in? (e.g. #FF0000)', defaultValue: '#000000' }, {name: 'message_1', type: 'str', label: 'Message to send 1', defaultValue: '.'}, {name: 'message_2', type: 'str', label: 'Message to send 2', defaultValue: '.'}, {name: 'message_3', type: 'str', label: 'Message to send 3', defaultValue: '.'}, {name: 'message_4', type: 'str', label: 'Message to send 4', defaultValue: '.'}, {name: 'message_5', type: 'str', label: 'Message to send 5', defaultValue: '.'}, {name: 'message_6', type: 'str', label: 'Message to send 6', defaultValue: '.'}, {name: 'message_7', type: 'str', label: 'Message to send 7', defaultValue: '.'}, {name: 'message_8', type: 'str', label: 'Message to send 8', defaultValue: '.'}, {name: 'message_9', type: 'str', label: 'Message to send 9', defaultValue: '.'}, {name: 'message_10', type: 'str', label: 'Message to send 10', defaultValue: '.'}, ]; var timeout = cb.settings.timeout; var random = (cb.settings.random == 'Yes'); var messages = []; var colour = cb.settings.colour; function setMessages() { for (var i = 1; i <= 10; i++) { if (cb.settings['message_' + i] != '.') { messages.push(cb.settings['message_' + i]); } } } function sendMessage() { var time = timeout * 1000; if (random) { time = time * (Math.random() + 0.5); } msg = messages[Math.floor(Math.random() * messages.length)]; cb.sendNotice(msg, '', '', colour, 'normal', ''); cb.setTimeout(sendMessage, time); } function init() { setMessages(); sendMessage(); } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.