Bots Home
|
Create an App
Chutes and Ladders
Author:
jessy_storm
Description
Source Code
Launch Bot
Current Users
Created by:
Jessy_Storm
/** * Chutes and Ladders Information Bot * Version: 1.0.0 * Authot: obsceneryfx * Date: 30 April 2018 */ cb.settings_choices = [ { name: 'turn_cost', type: 'int', minValue: 1, label: 'Tokens per spin', defaultValue: 6 }, { name: 'notice_interval', type: 'choice', label: 'Minutes between info displays', choice1: 1, choice2: 3, choice3: 5, choice4: 10, defaultValue: 5 }, { name: 'room_subject_update', type: 'choice', label: 'Update the Room Label for this Bot', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'game_prize', type: 'str', label: 'Winning Game Prize', defaultValue: '5 minute password show' }, { name: 'max_players', type: 'choice', label: 'Maximum Game Players', choice1: 3, choice2: 4, choice3: 5, choice4: 6, defaultValue: 6 } ]; var price = cb.settings.turn_cost; var maxPlayers = cb.settings.max_players; var tokenLabel = (price > 1) ? 'tokens' : 'token'; var playerLabel = maxPlayers > 1 ? 'players' : 'player'; var _is = maxPlayers > 1 ? ' are ' : ' is '; var prize = cb.settings.game_prize; cb.onEnter(function (user) { showAppAd(user['user']); }) function advertise() { showAppAd(); cb.setTimeout(advertise, parseInt(cb.settings.notice_interval) * 60000); } function showAppAd(username) { var msg = null != username && "" != username ? "Hey " + username + "! " : ""; msg += "We are playing Chutes and Ladders - by OBSceneryFX\n"; msg += "Your first tip of " + price + " " + tokenLabel + " adds you to the game\n"; msg += "Thereafter, each tip of " + price + " " + tokenLabel + " will give you an additional spin\n"; msg += "There" + _is + "only " + maxPlayers + " " + playerLabel + " allowed, so grab your spot fast!\n"; msg += "If your spin lands you on a square with a 'chute' (slide), you go down\n"; msg += "If your spin lands you on a square with a ladder, you go up!\n"; msg += "First player to 100 wins the prize (" + prize + ")\n"; cb.sendNotice(msg, username, '', '#5BC0DE', 'bold'); } function init() { advertise(); if (cb.settings.room_subject_update == 'Yes') { cb.changeRoomSubject('Tip ' + price + ' ' + tokenLabel + ' to play Chutes and Ladders and spin the wheel'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.