Bots Home
|
Create an App
Flea Market Game
Author:
gargoyle1
Description
Source Code
Launch Bot
Current Users
Created by:
Gargoyle1
/** * Bot: Flea Market Game * Version: 1.0 * Author: gargoyle1 * Date: 09.04.16 */ var clothes = []; var min = 0; var max = 0; var number; var tmp; var rnd; var counter = -1; var next_clothes = -1; var white = '#ffffff' var black = '#000000'; var pink = '#fd58d1'; var orange = '#db5300'; var red = '#dd0000'; var green = '#029903'; var lightblue = '#6699aa'; var darkblue = '#000099'; var lightpurple = '#be6bff'; var darkpurple = '#824bab'; var grey = '#494949'; cb.settings_choices = [ {name: 'note_time', type:'int', minValue:1, maxValue:60, label:'Repeating time (in min) for game message', defaultValue:5}, {name: 'color', type:'str', minLength:0, maxLength:7, label:'Message color', defaultValue:'#fd58d1', required:false}, {name: 'token', type:'int', minValue:1, maxValue:999, label:'Tip amount', defaultValue:100}, {name: 'back_time', type:'int', minValue:0, maxValue:60, label:'Time period (in min) for getting 1 piece of clothing back', defaultValue:10}, {name: 'min_wear', type:'int', minValue:0, maxValue:3, label:'Minimum amount of clothing you get', defaultValue:2}, {name: 'wear1', type:'str', minLength:1, maxLength:255, label:'What do you wear?', defaultValue:'a Shirt'}, {name: 'wear2', type:'str', minLength:1, maxLength:255, label:'', defaultValue:'a Skirt', required:false}, {name: 'wear3', type:'str', minLength:1, maxLength:255, label:'', defaultValue:'a Bra', required:false}, {name: 'wear4', type:'str', minLength:1, maxLength:255, label:'', defaultValue:'Panties', required:false}, {name: 'wear5', type:'str', minLength:1, maxLength:255, label:'', defaultValue:'Stockings', required:false}, {name: 'wear6', type:'str', minLength:1, maxLength:255, label:'', defaultValue:'High Heels', required:false}, ]; cb.onMessage(function (msg) { if ((msg['user'] == (cb.room_slug || msg['is_mod'])) && msg['m'].indexOf("!") == 0) { var message = msg['m']; if (msg['m'] == '!note') { msg['X-Spam'] = true; game_note(); } } }); cb.onTip(function (tip) { if (tip['amount'] == cb.settings.token) { mix_clothes(); random_clothes(); fm_message(tip); if (cb.settings.back_time > 0) { next_clothes = number; counter = -1; } } }); function note_timer() { cb.setTimeout(note_timer, 60000 * cb.settings.note_time); game_note(); } function game_note() { var message = '\u2605 ' + cb.room_slug + ' need a new outfit and goes to the flea market! \u2605 \n \u2605 Buy some new clothes for ' + cb.settings.token + ' token and ' + cb.room_slug + ' will wear what you get! \u2605'; if (cb.settings.min_wear > 0) { message += '\n \u2605 But ' + cb.room_slug + ' accept only a minimum of ' + cb.settings.min_wear + ' pieces of clothing! \u2605'; } if (cb.settings.back_time > 0) { message += '\n \u2605 If you do not found a complete outfit, ' + cb.room_slug + ' searches for an additional piece of clothes every ' + cb.settings.back_time + ' minutes! \u2605'; } cb.sendNotice(message, '', '', color, 'bold'); } function count_clothes() { min = cb.settings.min_wear; for (var i=1; i<=6; i++) { if (cb.settings['wear'+i] != '') { max++; clothes[max] = cb.settings['wear'+i]; } } } function random_clothes() { number = Math.floor((Math.random() * (max+1-min)) + min); } function mix_clothes() { for (var i=1; i<=max; i++) { rnd = Math.floor(Math.random() * max) + 1; tmp = clothes[i]; clothes[i] = clothes[rnd]; clothes[rnd] = tmp; } } function fm_message(tip) { var message = '\u2605 ' + tip['from_user'] + ' bought ' + cb.room_slug + ' a new outfit for ' + cb.settings.token + ' token and get... \u2605 \n \u2605'; if (number == 0) { message += ' NOTHING'; } else { message += ' '; for (var i=1; i<=number; i++) { message += clothes[i]; if (i < (number-1)) { message += ', '; } else if (i == (number-1)) { message += ' and '; } } } message += '! \u2605' cb.sendNotice(message, '', color, white, 'bold'); } function game_timer() { cb.setTimeout(game_timer, 60000); counter++; if (counter == cb.settings.back_time && next_clothes != -1) { next_clothes++; if (next_clothes < max) { message = '\u2605 ' + cb.room_slug + ' found ' + clothes[next_clothes] + ' on the flea market to wear! \u2605' counter = 0; } else if (next_clothes == max) { message = '\u2605 ' + cb.room_slug + ' found ' + clothes[next_clothes] + ' on the flea market to wear and has a full outfit now! \u2605' next_clothes = -1; } cb.sendNotice(message, '', color, white, 'bold'); } } function init() { color = cb.settings.color; count_clothes(); note_timer(); if (cb.settings.back_time > 0) { game_timer(); } if (cb.settings.min_wear >= max) { cb.settings.min_wear = max-1; } } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.