Bots Home
|
Create an App
3 Boxes Outfit
Author:
gargoyle1
Description
Source Code
Launch Bot
Current Users
Created by:
Gargoyle1
/** * Bot: 3 Boxes Outfits * Version: 1.1 * Author: gargoyle1 * Date: 04.11.15 */ var tip1 = cb.settings.tip+1; var tip2 = cb.settings.tip+2; var tip3 = cb.settings.tip+3; var boxchoice; var username; var dieRoll; var tmp; var rand; var textcolor; boxes = new Array(1,2,3); colname = new Array('black','grey','blue','green','red','fire-red','pink'); colcode = new Array('#000000','#666699','#003399','#669a5e','#b84040','#ff0000','#ff6699'); cb.settings_choices = [ {name:'message_timer', type:'choice', label:'Game Message Repeating Time (minutes)', choice1:5, choice2:10, choice3:15, choice4:20, choice5:30, choice6:45, choice7:60, defaultValue:5}, {name:'color', type:'choice', label:'Note Color', choice1:'black', choice2:'grey', choice3:'blue', choice4:'green', choice5:'red', choice6:'fire-red', choice7:'pink', defaultValue:'grey', required:false}, {name:'tip', type:'int', label:'Tip for choosing Box', minValue:0, maxValue:999, defaultValue: 50}, {name:'divide', type:'choice', label:'Divide clothing', choice1:'random', choice2:'manual', defaultValue:'random'}, {name:'level', type:'choice', label:'Boxes (3 for normal or 2 for easy)', choice1:2, choice2:3, defaultValue:3}, {name:'showall', type:'choice', label:'Show all boxes', choice1:'Yes', choice2:'No', defaultValue:'Yes'}, {name:'garment1', type:'str', minLength:1, maxLength:255, label:'Garment', defaultValue:'Panties'}, {name:'boxno1', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', defaultValue:'1'}, {name:'garment2', type:'str', minLength:1, maxLength:255, label:'Garment', defaultValue:'Bra', required:false}, {name:'boxno2', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', defaultValue:'1', required:false}, {name:'garment3', type:'str', minLength:1, maxLength:255, label:'Garment', defaultValue:'Trousers', required:false}, {name:'boxno3', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', defaultValue:'2', required:false}, {name:'garment4', type:'str', minLength:1, maxLength:255, label:'Garment', defaultValue:'Shirt', required:false}, {name:'boxno4', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', defaultValue:'3', required:false}, {name:'garment5', type:'str', minLength:1, maxLength:255, label:'Garment', required:false}, {name:'boxno5', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', required:false}, {name:'garment6', type:'str', minLength:1, maxLength:255, label:'Garment', required:false}, {name:'boxno6', type:'choice', label:'Box No.', choice1:'1', choice2:'2', choice3:'3', required:false}, ]; cb.onEnter(function(user) { cb.sendNotice(cb.settings.level + ' Boxes Outfits by gargoyle1!', user['user'], '', textcolor, 'bold'); cb.sendNotice('I divided my actual clothing ' + cb.settings.divide + 'ly in ' + cb.settings.level + ' boxes! Choose one box for my next outfit I will wear!', user['user'], '', textcolor, 'bold'); if (cb.settings.level == 3) { cb.sendNotice(' Tip ' + tip1 + ' Tokens for Box No. 1, ' + tip2 + ' Tokens for Box No. 2 or ' + tip3 + ' Tokens for Box No. 3!', user['user'], '', textcolor, 'bold'); } else { cb.sendNotice(' Tip ' + tip1 + ' Tokens for Box No. 1 or ' + tip2 + ' Tokens for Box No. 2!', user['user'], '', textcolor, 'bold'); } cb.sendNotice('Or just tip ' + cb.settings.tip + ' Tokens for random Box!', user['user'], '', textcolor, 'bold'); }); cb.onTip(function (tip) { if (cb.settings.divide == 'random') { fillrandom(); garmentslots(); } else { changeboxes(); fillboxes(); garmentslots(); } if (tip['amount'] == cb.settings.tip) { rolldice(); boxchoice = dieRoll; otherboxes(); cb.setTimeout(openbox, 3000); } if (tip['amount'] == tip1) { boxchoice = 1; otherboxes(); cb.setTimeout(openbox, 3000); } if (tip['amount'] == tip2) { boxchoice = 2; otherboxes(); cb.setTimeout(openbox, 3000); } if (cb.settings.level == 3) { if (tip['amount'] == tip3) { boxchoice = 3; otherboxes(); cb.setTimeout(openbox, 3000); } } }); cb.onMessage(function (msg) { if (msg['user'] == cb.room_slug || msg['is_mod']) { var message = msg['m'].split(' '); if (msg['m'] == '/c') { msg['X-Spam'] = true; cb.sendNotice('/rules = show game rules', msg['user'], '', '', ''); cb.sendNotice('/time x = set game message time to x minutes', msg['user'], '', '', ''); cb.sendNotice('/color x = set color to x (name or code e.g. #FF6699)', msg['user'], '', '', ''); cb.sendNotice('/tokens x = set to x tokens for shot', msg['user'], '', '', ''); } if (msg['m'] == '/rules') { msg['X-Spam'] = true; messagetext(); } if (message[0] == '/time') { msg['X-Spam'] = true; cb.settings.message_timer = message[1]; timeleft = cb.settings.message_timer*60; mincount = 60; cb.sendNotice('Game message time set to ' + message[1] + ' minutes!', msg['user'], '', '', ''); } if (message[0] == '/color') { msg['X-Spam'] = true; cb.settings.color = message[1]; var codetest = message[1].split(''); if (codetest[0] == '#' && codetest.length == 7) { textcolor = message[1]; cb.sendNotice('Color set to code ' + textcolor + '!', msg['user'], '', '', ''); } else { setcolor(); } } if (message[0] == '/tokens') { msg['X-Spam'] = true; if (message[1] > 0) { cb.settings.tokens = message[1]; cb.sendNotice('Tip for shot set to ' + cb.settings.tokens + ' Tokens!', '', '', textcolor, 'bold'); } } } return msg; }); function message() { messagetext(); cb.setTimeout(message, cb.settings.message_timer * 60000); } function messagetext() { cb.sendNotice(cb.settings.level + ' Boxes Outfits by gargoyle1!', '', '', textcolor, 'bold'); cb.sendNotice('I divided my actual clothing ' + cb.settings.divide + 'ly in ' + cb.settings.level + ' boxes! Choose one box for my next outfit I will wear!', '', '', textcolor, 'bold'); if (cb.settings.level == 3) { cb.sendNotice(' Tip ' + tip1 + ' Tokens for Box No. 1, ' + tip2 + ' Tokens for Box No. 2 or ' + tip3 + ' Tokens for Box No. 3!', '', '', textcolor, 'bold'); } else { cb.sendNotice(' Tip ' + tip1 + ' Tokens for Box No. 1 or ' + tip2 + ' Tokens for Box No. 2!', '', '', textcolor, 'bold'); } cb.sendNotice('Or just tip ' + cb.settings.tip + ' Tokens for random Box!', '', '', textcolor, 'bold'); } function setcolor() { for(var i=0;i<=6;i++) { if (cb.settings.color == colname[i]) { textcolor = colcode[i]; cb.sendNotice('Color set to ' + cb.settings.color + '!', cb.room_slug, '', '', ''); } } } function fillrandom() { for(var i=1;i<=6;i++) { rolldice(); cb.settings['boxno'+i] = dieRoll; } } function changeboxes() { for (var i=0; i<cb.settings.level; i++) { rand = Math.floor(Math.random() * cb.settings.level); tmp = boxes[i]; boxes[i] = boxes[rand]; boxes[rand] = tmp; } } function fillboxes() { for(var i=1;i<=6;i++) { if (cb.settings['boxno'+i] == 1) { cb.settings['boxno'+i] = boxes[0]; } else { if (cb.settings['boxno'+i] == 2) { cb.settings['boxno'+i] = boxes[1]; } else { if (cb.settings['boxno'+i] == 3) { cb.settings['boxno'+i] = boxes[2]; } } } } } function rolldice() { dieRoll = Math.floor((Math.random() * cb.settings.level) + 1); } function otherboxes() { if (cb.settings.showall == 'Yes') { for(var n=1; n<=cb.settings.level; n++) { if (boxchoice != n) { cb.sendNotice(cb.room_slug + ' opens Box No. ' + n + '...', '', '', textcolor, 'bold'); var emptycount = 0; for(var i=1;i<=6;i++) { if (cb.settings['boxno'+i] == n) { emptycount = emptycount +1; cb.sendNotice(cb.settings['garment'+i], '', '', textcolor, 'bold'); } } if (emptycount == 0) cb.sendNotice('Nothing!', '', '', textcolor, 'bold'); } } } } function openbox() { cb.sendNotice(username + ' opens Box No. ' + boxchoice + '...', '', '', textcolor, 'bold'); var emptycount = 0; for(var i=1;i<=6;i++) { if (cb.settings['boxno'+i] == boxchoice) { emptycount = emptycount +1; cb.sendNotice(cb.settings['garment'+i], '', '', textcolor, 'bold'); } } if (emptycount == 0) cb.sendNotice('Nothing!', '', '', textcolor, 'bold'); cb.setTimeout(outfitmessage, 1000); } function outfitmessage() { cb.sendNotice('Box No. ' + boxchoice + ' is ' + cb.room_slug + 's new outfit!', '', '', textcolor, 'bold'); } function garmentslots() { for(var i=1;i<=6;i++) { if (cb.settings['garment'+i] == '') { cb.settings['boxno'+i] = 0; } } } function init() { setcolor(); message(); cb.sendNotice('Type c/ for setting commands, ' + cb.room_slug + '!', cb.room_slug, '', '', 'bold'); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.