Bots Home
|
Create an App
Violetta_secret_video
Author:
violetta52
Description
Source Code
Launch Bot
Current Users
Created by:
Violetta52
/*a_quiet_guy Sep 2016*/ // vars var total_secrets = 5; var secrets_list = []; cb.settings_choices = [ {name: 'secret_0', type: 'str', minLength: 1, maxLength: 255, label: "Secret 1 Question"}, {name: 'answer_0', type: 'str', minLength: 1, maxLength: 255, label: "Secret 1 Answer"}, {name: 'tokens_0', type: 'int', minValue: 1, maxValue: 32767, label: "Tokens to unlock Secret 1"}, {name: 'secret_1', type: 'str', minLength: 1, maxLength: 255, label: "Secret 2 Question", required: false}, {name: 'answer_1', type: 'str', minLength: 1, maxLength: 255, label: "Secret 2 Answer", required: false}, {name: 'tokens_1', type: 'int', minValue: 0, maxValue: 32767, label: "Tokens to unlock Secret 2", required: false}, {name: 'secret_2', type: 'str', minLength: 1, maxLength: 255, label: "Secret 3 Question", required: false}, {name: 'answer_2', type: 'str', minLength: 1, maxLength: 255, label: "Secret 3 Answer", required: false}, {name: 'tokens_2', type: 'int', minValue: 0, maxValue: 32767, label: "Tokens to unlock Secret 3", required: false}, {name: 'secret_3', type: 'str', minLength: 1, maxLength: 255, label: "Secret 4 Question", required: false}, {name: 'answer_3', type: 'str', minLength: 1, maxLength: 255, label: "Secret 4 Answer", required: false}, {name: 'tokens_3', type: 'int', minValue: 0, maxValue: 32767, label: "Tokens to unlock Secret 4", required: false}, {name: 'secret_4', type: 'str', minLength: 1, maxLength: 255, label: "Secret 5 Question", required: false}, {name: 'answer_4', type: 'str', minLength: 1, maxLength: 255, label: "Secret 5 Answer", required: false}, {name: 'tokens_4', type: 'int', minValue: 0, maxValue: 32767, label: "Tokens to unlock Secret 5", required: false} ]; getSecrets(); cb.onEnter(function (user) { var msg = "Hey " + user['user'] + ", I'm using the bot \'My Paid Secret.\' \n"; msg += "Tip the exact tokens for relative secret and put \"Secret\" in the tipnote.\n" msg += "Type \"/secrets\" to see the secrets list.\n" cb.sendNotice( msg, user['user'], '#FFCCCC', '#B80934', 'normal'); }); cb.onMessage(function (msg) { if (msg['m'].match(/\/secrets/i)) { msg['X-Spam'] = true; showSecrets(msg); } return msg; }); cb.onTip(function (tip) { ShowSecret(tip); }); ShowSecret = function(tip) { if(tip['message'] == 'Secret' || tip['message'] == 'secret') { for (i = 0; i < total_secrets; i++) { if(tip['amount'] == parseInt(cb.settings['tokens_' + i])) { var msg = cb.settings['secret_' + i]; cb.sendNotice( msg, tip['from_user'], '#FFCCCC', '#B80934', 'normal'); msg = " " + cb.settings['answer_' + i]; cb.sendNotice( msg, tip['from_user'], '#FFCCCC', '#B80934', 'bold'); } } } } showSecrets = function(msg) { var msgd = "+++++ MY SECRETS LIST +++++\n"; var i; for (i = 0; i < total_secrets; i++) { msgd += cb.settings['secret_' + i] + " for " + cb.settings['tokens_' + i] + "tkns\n"; } msgd += "+++++ +++++ +++++ +++++\n"; cb.sendNotice( msgd, msg['user'], '#FFCCCC', '#B80934', 'normal'); } function getSecrets() { var i; // Build the Secret array. for(i=0; i < total_secrets; ++i) { if (cb.settings['secret_' + i] == '' || cb.settings['answer_' + i] == '' || cb.settings['tokens_' + i] <= 0) { continue; } var l_secret = new Secret(cb.settings['secret_' + i], cb.settings['answer_' + i], cb.settings['tokens_' + i]); secrets_list.push(l_secret); } // Sort the secrets by lowest amount of tokens. if (secrets_list.length > 1) { secrets_list.sort( function(a, b) { return a.tokens - b.tokens; }); } } // Class Secret function Secret(secret, answer, tokens) { this.secret = secret; this.answer = answer; this.tokens = tokens; // Shows the secret. this.showSecret = function () { return 'Question: ' + this.secret ; }; // Shows the secret answer. this.showAnswer = function () { return this.secret + ' ' + this.answer; }; }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.