Bots Home
|
Create an App
testsongs
Author:
new
Description
Source Code
Launch Bot
Current Users
Created by:
New
var songAmount = 0; var choiceAmount = 10; cb.settings_choices = [ {name: 'songTip', type: 'int', minValue:1, maxValue:500}, {name: 'song0', type: 'string', minLength: 1, maxLength: 255}, {name: 'song1', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song2', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song3', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song4', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song5', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song6', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song7', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song8', type: 'string', minLength: 1, maxLength: 255, required: false}, {name: 'song9', type: 'string', minLength: 1, maxLength: 255, required: false} ]; cb.onTip(function (tip) { if (parseInt(tip['amount']) == cb.settings['songTip']) { cb.chatNotice(getSong()); } }); function getSong() { var rand = iRandom(0, songAmount); return cb.settings['song' + rand]; } function init() { for (var i = 0; i < choiceAmount; i ++) { if (cb.settings['song' + i] === '') { songAmount = i; break; } } cb.chatNotice('Song choice started. Songs amount: ' + parseInt(i + 1)); } function iRandom(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.