Apps Home
|
Create an App
toy_tracker_1.1.4
Author:
chef_101
Description
Source Code
Launch App
Current Users
Created by:
Chef_101
/* toy_tracker By: chef_101 First Version: 5/23/2018 */ //app objects var app_command = [ { app_command_name: 'app_command_name', //command name app_command_value: 'app_command_value', //the actual command app_command_help: 'app_command_description', //description of the command app_command_access: 'app_command_access', //access level needed to execute the command you, controller, player, all app_command_function: 'app_command_function' //function associated to the command } ]; var app_color_setup = [ { app_color_name: 'default_app_color', //app_color setting name app_color_label: 'help', //user help for setting app_color_app_color_name: '', app_color_app_color_hex: '' } ]; var app_color = [ { app_color_debug_backcolor_name: 'app_color', //app_color name app_color_debug_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_debug_forecolor_hex: 'app_color', //app_color name app_color_debug_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_chat_backcolor_name: 'app_color', //app_color name app_color_chat_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_chat_forecolor_hex: 'app_color', //app_color name app_color_chat_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_notice_box_backcolor_name: 'app_color', //app_color name app_color_notice_box_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_notice_box_forecolor_name: 'app_color', //app_color name app_color_notice_box_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_command_que_backcolor_name: 'app_color', //app_color name app_color_command_que_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_command_que_forecolor_name: 'app_color', //app_color name app_color_command_que_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_available_toys_backcolor_name: 'app_color', //app_color name app_color_available_toys_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_available_toys_forecolor_name: 'app_color', //app_color name app_color_available_toys_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_claimed_toys_backcolor_name: 'app_color', //app_color name app_color_claimed_toys_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_claimed_toys_forecolor_name: 'app_color', //app_color name_hex app_color_claimed_toys_forecolor_hex: '#FFFFFF', //app_color hex value; app_color_game_status_backcolor_name: 'app_color', //app_color name app_color_game_status_backcolor_hex: '#FFFFFF', //app_color hex value; app_color_game_status_forecolor_name: 'app_color', //app_color name app_color_game_status_forecolor_hex: '#FFFFFF', //app_color hex value; } ]; var app_room_subject = [ { app_room_subject_section_name: 'app_room_subject_section_name', app_room_subject_section_value: '*****App Room Subject Settings Section*****', app_room_subject_section_help_name: 'app_room_subject_section_help_name', app_room_subject_section_help_value: 'Settings Help: This tells the application how to set your room subject. You can change these to anything you like.', app_room_subject_name: 'app_room_subject_name', app_room_subject_help: 'What do you want your room subject to say?', app_room_subject_value: 'chef\'s compliance cam - to prove that I have obeyed!', app_room_game_subject_name: 'app_room_game_subject_name', app_room_game_subject_help: 'What do you want the game part of the room subject to say? Must contain \'[version]\' if the app version is to show correctly.', app_room_game_subject_value: 'Playing toy_tracker [version]', app_room_tags_name: 'app_room_tags_name', app_room_tags_help: 'What do you want for hashtags in your room subject?', app_room_tags_value: '#submissive, #masochist, #pens, #cbt' } ]; var app_interactive_menu = [ { app_interactive_name: 'interactive name', app_interactive_menu_name: 'name of the interactive menu', app_interactive_commander: 'username of user using the interactive menu', app_interactive_complier: 'username of user who is complying with the interactive menu', app_interactive_step: 0, app_interactive_accept: 'command to accept ', app_interactive_decline: 'command to decline ' } ]; //game objects var game_setting = [ { game_setting_name: 'game_settings', //setting name game_setting_free_game_name: 'free_game', //holds free game toggle game_setting_free_game_value: 'free', //holds free game toggle game_setting_free_game_label: 'free', game_setting_free_game_choice1: 'free', game_setting_free_game_choice2: 'token', game_setting_become_player_name: 'become_player', //holds cost in credits to become a player game_setting_become_player_value: 100, game_setting_become_player_label: '', game_setting_player_credit_name: 'player_credit', //holds give credits to player game_setting_player_credit_value: 1000, game_setting_player_credit_label: '', game_setting_friend_credit_name: 'friend_credit', //holds give credits to friend game_setting_friend_credit_value: 10000, game_setting_friend_credit_label: '', game_setting_non_session_notice_interval_name: 'non_session_notice_interval', //the time between notices when no session has started game_setting_non_session_notice_interval_value: 5, game_setting_non_session_notice_interval_label: '', game_setting_session_notice_intervalession_notice_interval_name: 'session_notice_interval', //the time between notices when no session has started game_setting_session_notice_interval_value: 1, game_setting_session_notice_interval_label: '' } ]; var game_message = [ { name: 'message_name', label: 'message_label', type: 'str', defaultValue: '' } ]; var game_session = [ { session_name: 'game_session', //setting name session_time_remaining: 0, //time that remains before the current session ends session_maximum_name: 'session_maximum', //setting name session_maximum: 120, //the maximum amount of time a session will last session_maximum_value: 0, //the user selected value session_cooldown: 0, //time that remains before a new session can begin session_cooldown_value: 0, //the user selected value session_cooldown_maximum_name: 'session_cooldown_maximum', //setting name session_cooldown_maximum: 30, //time that must pass before a new session can start session_cooldown_maximum_value: 0, //the user selected value session_count: 0, //counter for the number of sessiong played since the game started session_command_que_count: 0, //the numbre of commands remaining in the command que session_CreditsForControl_name: 'session_CreditsForControl', //setting name session_CreditsForControl: 100, //the amount of Credits for a player to start a game session and become the controller session_CreditsForControl_value: 0, //the user selected value session_controller: 'username', //username of player who started the session session_controllerTitle: 'session_controllerTitle', //setting name session_controllerTitle: 'Session Mistress', //title of the controller of the session session_controllerTitle_value: '', //the user selected value session_submissiveTitle_name: 'session_submissiveTitle', //setting name session_submissiveTitle: 'chef', //the name you like to be refered to as session_submissiveTitle_value: '', //the user selected value session_toyMax: 1, //the maximum number of toys that can be controlled by a player in the current session 0 for no limit session_advertiseToPlay: 'Tip [playerTokenAmount] token to become a player!', //message sent to room on how to become a player session_Advertise: 'Type session to start a session and become the [session_controllerTitle]! It cost just [sessionStartCost] credits!', //message displayed to players about how to start a session session_setup_step: 0 } ]; var player = [ { player_name: 'username', //the username of person added to the game as a player player_credits: 0, //the amount of tip credits a player has remaining } ]; var toy = [ { toy_name: '', //toy name toy_value: '', //users toy name toy_type: '', //toy type toy_creditsCost: '', //cost in credits to claim this toy toy_claimedBy: '', //user who has claimed the toy toy_location: '' //location of toy; } ]; var friend = [ { friend_name: '', //friend name friend_label: '', friend_credits: 0 // the number of Credits you wish to give this friend } ]; var user = [ { user_name: '', //user name user_label: '', user_tips: 0 // the ammount in tokens this user has given since the app started } ]; //version decleration var app_debug = 'no' //set this to yes for debug mode var app_debug_function = 'all' //all for debug mode to run in all functions or function name to debug a single function var app_version = '1.1.4'; var app_date = '6/16/2018'; var app_hash = '#toy_tracker' var app_notes = new Array(); var app_todo = new Array(); var app_message = ''; //app var declerations var app_commands = new Array(); var app_web_colors = new Array(); var app_default_colors_setup = new Array(); var app_default_colors = app_clone(app_color); var app_room_subjects = app_clone(app_room_subject); //game var declerations var game_settings = app_clone(game_setting); var game_messages = new Array(); var game_sessions = app_clone(game_session); var game_commands = new Array(); var users = new Array(); var players = new Array(); var toys = new Array(); var toy_types = new Array(); var friends = new Array(); var iGameNextNotice = 0; var iGameStatusTimer = 1; var iGameRunning = 0; //default Notice box settings var default_Notice_Box_Length = "20" var default_Notice_Box_Top = "_" var default_Notice_Box_Side = "|" //app functions function app_clone(obj) { try { //object cloning let objCopy = {}; // objCopy will store a copy of the mainObj let key; for (key in obj.keys) { objCopy[key] = obj[key]; // copies each property to the objCopy object } return objCopy; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_clone: ' + err.name + ' - ' + err.message); } } function app_clone_initialize(obj) { //not used try { let objCopy = {}; // objCopy will store a copy of the mainObj let value; for (value in obj.values) { objCopy[value] = obj[value]; // copies each value to the objCopy object } return objCopy; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_clone: ' + err.name + ' - ' + err.message); } } function app_commands_initialize() { try { //build array of settings for the command names, access level, and method var appFunctions = new Array(); //name, command, access, method, description appFunctions.push('app_start,start,you,app_start,This is the command that starts a new game.'); appFunctions.push('app_stop,stop,you,app_stop,This is the command that stops the current game.'); appFunctions.push('app_add_player,add,you,app_add_player,This is the command that manually add a player to the game.'); appFunctions.push('app_remove_looser,looser,you,app_remove_looser,This is the command that manually removes a looser from the game.'); appFunctions.push('app_check_player,check,you,app_check_for_user,This is the command that checks to see if a user is in the game.'); appFunctions.push('app_list_players,list,you,app_list_users,This is the command that shows all users playing the game.'); appFunctions.push('app_play,play,all,app_play,This is the command that allows a player to join the game.'); appFunctions.push('app_player_starts_session,session,player,game_player_starts_session,This is the command a player uses to start a session.'); appFunctions.push('app_player_claims_toy,claim,player,game_player_claims_toy,This is the command a player uses to claim a toy.'); appFunctions.push('app_player_releases_toy,release,player,game_player_releases_toy,This is the command a player uses to release a toy.'); appFunctions.push('app_yes,yes,player,game_interactive_menu_yes,This is the yes command a player uses to negotiate a interactive menu.'); appFunctions.push('app_no,no,player,game_interactive_menu_no,This is the no command a player uses to negotiate a interactive menu.'); //build default command objects and populate the commands array for (iAppFunctionIndex = 0; iAppFunctionIndex < appFunctions.length; iAppFunctionIndex++) { var newAppcommand = app_clone(app_command); var functionParts = appFunctions[iAppFunctionIndex].split(","); newAppcommand.app_command_name = functionParts[0]; newAppcommand.app_command_value = functionParts[1]; newAppcommand.app_command_access = functionParts[2]; newAppcommand.app_command_function = functionParts[3]; newAppcommand.app_command_help = functionParts[4]; app_commands.push(newAppcommand); } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: commands_initialize: ' + err.name + ' - ' + err.message); } } function app_command_interpreter(user, messageParts) { try { var debug = 'START debuging on: app_command_interpreter function '; var debugInfo = 'true'; //trim the slash messageParts[0] = messageParts[0].substring(1, messageParts[0].length); debug += 'username: ' + user; debug += messageParts[0]; //find the app_command var bFoundCommand = false; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (messageParts[0] == app_commands[iAppCommandIndex].app_command_value) { if (app_commands[iAppCommandIndex].app_command_access == 'you') { if (cb.room_slug != user) { app_buildMessage('You do not have access to the App Command ' + messageParts[0], user); debug += app_message; app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_command_interpreter')) { if (debugInfo == 'true') { debug += ' END debuging on: app_command_interpreter function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } return; } } else if (app_commands[iAppCommandIndex].app_command_access == 'player') { if (user != cb.room_slug) { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user) == false) { app_buildMessage('You do not have access to the Player Command ' + messageParts[0], user); debug += app_message; app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_command_interpreter')) { if (debugInfo == 'true') { debug += ' END debuging on: app_command_interpreter function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } return; } } } if (app_commands[iAppCommandIndex].app_command_function == 'app_start') { debug += ' I hit app_start '; bFoundCommand = true; iGameRunning = 1 app_start(); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_stop') { debug += ' I hit app_stop ' bFoundCommand = true; iGameRunning = 0 iGameStatusTimer = 1; app_stop(); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_add_player') { debug += ' I hit app_add_player ' bFoundCommand = true; app_add_player(messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_remove_looser') { debug += ' I hit app_remove_looser ' bFoundCommand = true; app_remove_looser(messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_check_for_user') { debug += ' I hit app_check_for_user ' bFoundCommand = true; app_check_for_user(messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_list_users') { debug += ' I hit app_list_users ' bFoundCommand = true; app_list_users(); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'app_play') { debug += ' I hit app_play ' bFoundCommand = true; app_play(user); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_player_starts_session') { debug += ' I hit game_player_starts_session ' bFoundCommand = true; game_player_starts_session(user); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_player_claims_toy') { debug += ' I hit game_player_claims_toy ' bFoundCommand = true; game_player_claims_toy(user, messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_player_releases_toy') { debug += ' I hit game_player_releases_toy ' bFoundCommand = true; game_player_releases_toy(user, messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { debug += ' I hit game_interactive_menu_yes ' bFoundCommand = true; game_interactive_menu_yes(user, messageParts[1]); break; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { debug += ' I hit game_interactive_menu_no ' bFoundCommand = true; game_interactive_menu_no(user, messageParts[1]); break; } } } if (bFoundCommand == false) { app_buildMessage('Is not a command /' + messageParts[0], user); debug += app_message; app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_command_interpreter')) { if (debugInfo == 'true') { debug += ' END debuging on: app_command_interpreter function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_command_interpreter: ' + err.name + ' - ' + err.message); } } function app_initialize() { //set the debug mode toggle //update all objects with user selections try { app_debug = cb.settings['app_debug']; //see if user has opted to run in debugging mode var debug_notice = 'debug mode is on: '; app_debug_function = cb.settings['app_debug_function']; //see if user wants only debug info from specific function debug_notice = 'showing debug information for ' + app_debug_function + ' function(s)'; //update app command objects with user settings debug_notice += '\n***App command objects settings values***\n'; for (iAppCommandCount = 0; iAppCommandCount < app_commands.length; iAppCommandCount++) { app_commands[iAppCommandCount].app_command_value = cb.settings[app_commands[iAppCommandCount].app_command_name]; debug_notice += app_commands[iAppCommandCount].app_command_name + ', '; debug_notice += app_commands[iAppCommandCount].app_command_value + ', '; } //update app color setting object with user settings for (iapp_colorCount = 0; iapp_colorCount < app_default_colors_setup.length; iapp_colorCount++) { var app_color_name = cb.settings[app_default_colors_setup[iapp_colorCount].app_color_name]; var app_color_hex = app_colorTranslator(app_color_name); if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_debug_backcolor') { app_default_colors.app_color_debug_backcolor_name = app_color_name; app_default_colors.app_color_debug_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_debug_forecolor') { app_default_colors.app_color_debug_forecolor_name = app_color_name; app_default_colors.app_color_debug_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_chat_backcolor') { app_default_colors.app_color_chat_backcolor_name = app_color_name; app_default_colors.app_color_chat_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_chat_forecolor') { app_default_colors.app_color_chat_forecolor_name = app_color_name; app_default_colors.app_color_chat_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_notice_box_backcolor') { app_default_colors.app_color_notice_box_backcolor_name = app_color_name; app_default_colors.app_color_notice_box_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_notice_box_forecolor') { app_default_colors.app_color_notice_box_forecolor_name = app_color_name; app_default_colors.app_color_notice_box_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_command_que_backcolor') { app_default_colors.app_color_command_que_backcolor_name = app_color_name; app_default_colors.app_color_command_que_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_command_que_forecolor') { app_default_colors.app_color_command_que_forecolor_name = app_color_name; app_default_colors.app_color_command_que_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_available_toys_backcolor') { app_default_colors.app_color_available_toys_backcolor_name = app_color_name; app_default_colors.app_color_available_toys_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_available_toys_forecolor') { app_default_colors.app_color_available_toys_forecolor_name = app_color_name; app_default_colors.app_color_available_toys_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_claimed_toys_backcolor') { app_default_colors.app_color_claimed_toys_backcolor_name = app_color_name; app_default_colors.app_color_claimed_toys_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_claimed_toys_forecolor') { app_default_colors.app_color_claimed_toys_forecolor_name = app_color_name; app_default_colors.app_color_chat_claimed_toys_forecolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_game_status_backcolor') { app_default_colors.app_color_game_status_backcolor_name = app_color_name; app_default_colors.app_color_game_status_backcolor_hex = app_color_hex; } else if (app_default_colors_setup[iapp_colorCount].app_color_name == 'app_color_game_status_forecolor') { app_default_colors.app_color_game_status_forecolor_name = app_color_name; app_default_colors.app_color_game_status_forecolor_hex = app_color_hex; } } debug_notice += '\n***App color object settings values***\n'; debug_notice += app_color_name = 'app_color_debug_backcolor , '; debug_notice += app_default_colors.app_color_debug_backcolor_name + ' , '; debug_notice += app_default_colors.app_color_debug_backcolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_debug_forecolor , '; debug_notice += app_default_colors.app_color_debug_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_debug_forecolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_chat_backcolor , '; debug_notice += app_default_colors.app_color_chat_backcolor_name + ' , '; debug_notice += app_default_colors.app_color_chat_backcolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_chat_forecolor , '; debug_notice += app_default_colors.app_color_chat_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_chat_forecolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_notice_box_forecolor , '; debug_notice += app_default_colors.app_color_notice_box_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_notice_box_forecolor_hex + ' , ' debug_notice += app_color_name = '\n app_color_available_toys_backcolor , '; debug_notice += app_default_colors.app_color_available_toys_backcolor_name + ' , '; debug_notice += app_default_colors.app_color_available_toys_backcolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_available_toys_forecolor , '; debug_notice += app_default_colors.app_color_available_toys_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_available_toys_forecolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_claimed_toys_backcolor , '; debug_notice += app_default_colors.app_color_claimed_toys_backcolor_name + ' , '; debug_notice += app_default_colors.app_color_claimed_toys_backcolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_claimed_toys_forecolor , '; debug_notice += app_default_colors.app_color_claimed_toys_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_chat_claimed_toys_forecolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_game_status_backcolor , '; debug_notice += app_default_colors.app_color_game_status_backcolor_name + ' , '; debug_notice += app_default_colors.app_color_game_status_backcolor_hex + ' , '; debug_notice += app_color_name = '\n app_color_game_status_forecolor , '; debug_notice += app_default_colors.app_color_game_status_forecolor_name + ' , '; debug_notice += app_default_colors.app_color_game_status_forecolor_hex + ' , '; //update app room subject object with user settings debug_notice += '\n***App room subject object settings values***\n'; app_room_subjects.app_room_subject_value = cb.settings[app_room_subjects.app_room_subject_name]; debug_notice += app_room_subjects.app_room_subject_name + ', '; debug_notice += app_room_subjects.app_room_subject_value + ', '; app_room_subjects.app_room_game_subject_value = cb.settings[app_room_subjects.app_room_game_subject_name]; debug_notice += app_room_subjects.app_room_game_subject_name + ', '; debug_notice += app_room_subjects.app_room_game_subject_value + ', '; app_room_subjects.app_room_tags_value = cb.settings[app_room_subjects.app_room_tags_name]; debug_notice += app_room_subjects.app_room_tags_name + ', '; debug_notice += app_room_subjects.app_room_tags_value + ', '; //update game setting objects with user settings debug_notice += '\n***Game settings object values***\n'; game_settings.game_setting_free_game_value = cb.settings[game_settings.game_setting_free_game_name]; debug_notice += game_settings.game_setting_free_game_name + ', '; debug_notice += game_settings.game_setting_free_game_value + ', '; game_settings.game_setting_become_player_value = cb.settings[game_settings.game_setting_become_player_name]; debug_notice += game_settings.game_setting_become_player_name + ', '; debug_notice += game_settings.game_setting_become_player_value + ', '; game_settings.game_setting_player_credit_value = cb.settings[game_settings.game_setting_player_credit_name]; debug_notice += game_settings.game_setting_player_credit_name + ', '; debug_notice += game_settings.game_setting_player_credit_value + ', '; game_settings.game_setting_friend_credit_value = cb.settings[game_settings.game_setting_friend_credit_name]; debug_notice += game_settings.game_setting_friend_credit_name + ', '; debug_notice += game_settings.game_setting_friend_credit_value + ', '; game_settings.game_setting_non_session_notice_interval_value = cb.settings[game_settings.game_setting_non_session_notice_interval_name]; debug_notice += game_settings.game_setting_non_session_notice_interval_name + ', '; debug_notice += game_settings.game_setting_non_session_notice_interval_value + ', '; game_settings.game_setting_session_notice_interval_value = cb.settings[game_settings.game_setting_session_notice_interval_name]; debug_notice += game_settings.game_setting_session_notice_interval_name + ', '; debug_notice += game_settings.game_setting_session_notice_interval_value + ', '; //update session setting objects with user settings game_sessions.session_maximum_value = cb.settings[game_sessions.session_maximum_name]; game_sessions.session_cooldown_maximum_value = cb.settings[game_sessions.session_cooldown_maximum_name]; game_sessions.session_CreditsForControl_value = cb.settings[game_sessions.session_CreditsForControl_name]; game_sessions.session_controllerTitle_value = cb.settings[game_sessions.session_controllerTitle_name]; game_sessions.session_submissiveTitle_value = cb.settings[game_sessions.session_submissiveTitle_name]; debug_notice += '\n***Game session settings object values***\n'; debug_notice += game_sessions.session_maximum_name + ' , '; debug_notice += game_sessions.session_maximum_value + ' , '; debug_notice += game_sessions.session_cooldown_maximum_name + ' , '; debug_notice += game_sessions.session_cooldown_maximum_value + ' , '; debug_notice += game_sessions.session_CreditsForControl_name + ' , '; debug_notice += game_sessions.session_CreditsForControl_value + ' , '; debug_notice += game_sessions.session_controllerTitle_name + ' , '; debug_notice += game_sessions.session_controllerTitle_value + ' , '; debug_notice += game_sessions.session_submissiveTitle_name + ' , '; debug_notice += game_sessions.session_submissiveTitle_value + '\n'; //update toy objects with user settings debug_notice += '\n***Toy settings object values***\n'; for(iToyCount = 0; iToyCount < toys.length; iToyCount++) { toys[iToyCount].toy_value = cb.settings[toys[iToyCount].toy_name + '_value']; toys[iToyCount].toy_type = cb.settings[toys[iToyCount].toy_name + '_type']; toys[iToyCount].toy_creditsCost = cb.settings[toys[iToyCount].toy_name + '_cost']; toys[iToyCount].toy_claimedBy = ''; toys[iToyCount].toy_location = 'off'; debug_notice += toys[iToyCount].toy_name + ' , '; debug_notice += toys[iToyCount].toy_value + ' , '; debug_notice += toys[iToyCount].toy_type + ' , '; debug_notice += toys[iToyCount].toy_creditsCost + ' , '; debug_notice += toys[iToyCount].toy_claimedBy + ' , '; debug_notice += toys[iToyCount].toy_location + ' , '; } app_buildMessage('You must type \'/start\' to start the game ' + cb.room_slug + '!', cb.room_slug); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, cb.room_slug ); //start if (app_debug == 'yes') { app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug_notice); } //end } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_initialize: ' + err.name + ' - ' + err.message); } } //app command functions function app_start() { try { iGameNextNotice = 0; app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); roomTopic = app_room_subjects.app_room_subject_value + ' ' + app_room_subjects.app_room_game_subject_value + ' ' + app_room_subjects.app_room_tags_value + ' ' + app_hash + ' ' + app_hash + '_' + app_version; roomTopic = app_internalSubstitution(roomTopic, ''); cb.changeRoomSubject(roomTopic); app_buildMessage(app_formatMessage('The game has started!', default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); app_stats(); } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_start: ' + err.name + ' - ' + err.message); } } function app_stop() { try { app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); iGameRunning = 0; cb.limitCam_stop(); app_buildMessage(app_formatMessage('The game has stopped!', default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_stop: ' + err.name + ' - ' + err.message); } } function app_add_player(username) { try { var debug = 'START debuging on: app_add_player function '; var debugInfo = 'true'; debug += 'username: ' + username + ''; newPlayer = app_clone(player) newPlayer.player_name = 'player_' + (players.length + 1); newPlayer.player_username = username; newPlayer.player_credits = parseInt(game_settings.game_setting_player_credit_value); players.push(newPlayer); //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], username); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); cb.limitCam_addUsers(newPlayer.player_username); app_buildMessage(app_formatMessage(cb.room_slug + ' Added ' + newPlayer.player_username + ' to the game!', default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_add_player')) { if (debugInfo == 'true') { debug += ' END debuging on: app_add_player function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_add_user: ' + err.name + ' - ' + err.message); } } function app_remove_looser(looser) { try { for(iPlayerCount = 0; iPlayerCount < players.length; iPlayerCount++) { if(players[iPlayerCount].player_username == looser) { cb.limitCam_removeUsers([looser]); app_buildMessage(app_formatMessage(cb.room_slug + ' has removed looser ' + looser + ' from the game!', default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); //see if they have claimed toys and release them for (iToysCount = 0; iToysCount < toys.length; iToysCount++) { if (toys[iToysCount].toy_claimedBy == looser) { toys[iToysCount].toy_claimedBy = ''; app_buildMessage(looser + ' has released ' + toys[iToysCount].toy_value + ' for use!', default_Notice_Box_Length, ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } } players.splice(iPlayerCount, 1); return; } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_remove_looser: ' + err.name + ' - ' + err.message); } } function app_check_for_user(username) { try { if (cb.limitCam_userHasAccess(username)) { app_buildMessage(app_formatMessage(username + ' is in the game!', default_Notice_Box_Length), ''); } else { app_buildMessage(app_formatMessage(username + ' is not in the game!', default_Notice_Box_Length), ''); } app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_check_for_user: ' + err.name + ' - ' + err.message); } } function app_list_users() { try { var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length > 0) { app_buildMessage(app_formatMessage(userlist.length + (userlist.length > 1 ? " users" : " user") + " in game: " + cbjs.arrayJoin(userlist, ", "), default_Notice_Box_Length), ''); } else { app_buildMessage(app_formatMessage("No users in game.", default_Notice_Box_Length), ''); } app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_list_users: ' + err.name + ' - ' + err.message); } } function app_play(username) { try { var debug = 'START debuging on: app_play function '; var debugInfo = 'true'; debug += 'username: ' + username + ''; var isPlayer = 'no'; for (iPlayersCount = 0; iPlayersCount < players.length; iPlayersCount++) { //see if the user is a returning player if (players[iPlayersCount].player_username == username) { isPlayer = 'yes'; } } debug += ' is player: ' + isPlayer; if (isPlayer == 'yes') { //if returning player //add them to the cam //show there credits remaining cb.limitCam_addUsers(username); app_buildMessage(username + ' re-joined the game!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], username); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); } //see if the user is set to friend status if not a player var isFriend = 'no' for (iFriendsCount = 0; iFriendsCount < friends.length; iFriendsCount++) { if (cb.settings[friends[iFriendsCount].friend_name] == username) { isFriend = 'yes'; } } debug += ' is friend: ' + isFriend; if ((isPlayer == 'no') && (isFriend == 'yes')) { //if a friend but not yet a player //welcome them //add them to the cam //add them to game app_buildMessage('Hi my friend ' + username + '!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); newPlayer = app_clone(player) newPlayer.player_name = 'player_' + (players.length + 1); newPlayer.player_username = username; newPlayer.player_credits = parseInt(game_settings.game_setting_friend_credit_value); debug += ' and has ' + newPlayer.player_credits + ' credits available.'; players.push(newPlayer); //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], username); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); cb.limitCam_addUsers(username); app_buildMessage(' Added ' + username + ' to the game!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } //if game is in free mode add user to the game_request que if ((isPlayer == 'no') && (isFriend == 'no') && (game_settings.game_setting_free_game_value == 'free')) { newGame_Command = app_clone(app_interactive_menu); newGame_Command.app_interactive_commander = username; newGame_Command.app_interactive_complier = cb.room_slug; newGame_Command.app_interactive_menu_name = 'play'; newGame_Command.app_interactive_step = 0; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { newGame_Command.app_interactive_accept = app_commands[iAppCommandIndex].app_command_value; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { newGame_Command.app_interactive_decline = app_commands[iAppCommandIndex].app_command_value; } } game_commands.push(newGame_Command); debug += ' game command added!'; debug += ' ' + newGame_Command.app_interactive_commander; debug += ' ' + newGame_Command.app_interactive_complier; debug += ' ' + newGame_Command.app_interactive_menu_name; debug += ' ' + newGame_Command.app_interactive_accept; debug += ' ' + newGame_Command.app_interactive_decline; } if (game_commands.length != 0) { app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), cb.room_slug); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, cb.room_slug); app_buildMessage('You have ' + game_commands.length + ' command(s) in the game commands que, would you like to review them?', cb.room_slug); var commandsMessage = ''; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { commandsMessage += ' type /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { commandsMessage += ' or /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } } app_buildMessage(commandsMessage, cb.room_slug); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, cb.room_slug); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), cb.room_slug); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, cb.room_slug); } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_play')) { if (debugInfo == 'true') { debug += ' END debuging on: app_play function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_play: ' + err.name + ' - ' + err.message); } } //app control functions function app_stats() { try { setTimeout(function () { var debug = 'START debuging on: app_stats function '; var debugInfo = 'true'; debug += 'start value of iGameNextNotice value: ' + iGameNextNotice; if (game_commands.length != 0) { app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), cb.room_slug); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, cb.room_slug); app_buildMessage('You have ' + game_commands.length + ' command(s) in the game commands que, would you like to review them?', cb.room_slug); var commandsMessage = ''; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { commandsMessage += ' type /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { commandsMessage += ' or /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } } app_buildMessage(commandsMessage, cb.room_slug); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, cb.room_slug); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), cb.room_slug); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, cb.room_slug); } if (iGameNextNotice == 0) { app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); app_buildMessage(app_formatMessage(cb.settings['game_status'], default_Notice_Box_Length), ''); app_buildMessage(app_formatMessage('Game has been running for ' + iGameStatusTimer + ' minute(s).', default_Notice_Box_Length), ''); if (parseInt(game_sessions.session_time_remaining) != 0) { game_sessions.session_time_remaining = (parseInt(game_sessions.session_time_remaining) - 1); if (game_sessions.session_time_remaining == 0) { cb.limitCam_stop(); app_buildMessage('Session has ended, all toys to be removed.'); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } else { app_buildMessage('Session in progress: time remaining ' + game_sessions.session_time_remaining + ' minute(s).'); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); if (iGameRunning = 0) { return; } //show status of available and claimed toys var toys_available = ''; var toys_claimed = ''; for (iToysCount = 0; iToysCount < toys.length; iToysCount++) { if (toys[iToysCount].toy_value != '') { if ((toys[iToysCount].toy_type != 'session') && (toys[iToysCount].toy_type != 'expendable')) { if (toys[iToysCount].toy_claimedBy == '') { toys_available = toys_available + toys[iToysCount].toy_value + '(' + toys[iToysCount].toy_creditsCost + ' credits), '; } else { toys_claimed = toys_claimed + toys[iToysCount].toy_value + ' is controlled by ' + toys[iToysCount].toy_claimedBy + ', '; } } } } app_buildMessage(cb.settings['available_toys'],'') app_buildMessage(toys_available,''); app_buildMessage(' Type /claim [toy name] to claim one!',''); app_buildMessage(' Example type \'/claim pen0\' to claim pen0.',''); app_buildMessage(cb.settings['available_toys'],''); app_sendMessage(app_default_colors.app_color_available_toys_backcolor_hex, app_default_colors.app_color_available_toys_forecolor_hex, ''); app_buildMessage(cb.settings['claimed_toys'],''); app_buildMessage(toys_claimed,''); app_buildMessage(' Type /release [toy name] to relinquish one!',''); app_buildMessage(' Example type \'/release pen0\' to relinquish pen0.',''); app_buildMessage(cb.settings['claimed_toys'],''); app_sendMessage(app_default_colors.app_color_claimed_toys_backcolor_hex, app_default_colors.app_color_claimed_toys_forecolor_hex, ''); } iGameNextNotice = game_settings.game_setting_session_notice_interval_value; } else { if (parseInt(game_sessions.session_cooldown) == 0) { app_buildMessage('A session can be started for ' + game_sessions.session_CreditsForControl + ' credits!',''); app_buildMessage('Type: /session to start a session!',''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); iGameNextNotice = game_settings.game_setting_non_session_notice_interval_value; } else { app_buildMessage('A new session can be started in ' + game_sessions.session_cooldown + ' minutes for ' + game_sessions.session_CreditsForControl + ' credits!',''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); iGameNextNotice = game_settings.game_setting_session_notice_interval_value; game_sessions.session_cooldown = (parseInt(game_sessions.session_cooldown) - 1); } } app_buildMessage(app_formatMessage(cb.settings['game_status'], default_Notice_Box_Length),''); app_sendMessage(app_default_colors.app_color_game_status_backcolor_hex, app_default_colors.app_color_game_status_forecolor_name, ''); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); } iGameStatusTimer = parseInt(iGameStatusTimer) + 1; iGameNextNotice = parseInt(iGameNextNotice) - 1; debug += ' end value of iGameNextNotice value: ' + iGameNextNotice; if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_stats')) { if (debugInfo == 'true') { debug += ' END debuging on: app_stats function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } app_stats(); }, 60000); } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: stats: ' + err.name + ' - ' + err.message); } } function app_buildMessage(message, user) { try { message = app_internalSubstitution(message, user); app_message = app_message + message + "\n"; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_buildMessage: ' + err.name + ' - ' + err.message); } } function app_sendMessage(backcolor, forecolor, user) { try { cb.sendNotice(app_message.substring(0, app_message.length - 1), user, backcolor, forecolor, 'bold'); app_message = ""; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_sendMessage: ' + err.name + ' - ' + err.message); } } function app_sendDebugMessage(backcolor, forecolor, message) { try { cb.sendNotice(message, cb.room_slug, backcolor, forecolor, 'bold'); app_message = ""; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_sendMessage: ' + err.name + ' - ' + err.message); } } function app_internalSubstitution(message, user) { try { var debug = 'START debuging on: app_internalSubstitution function '; var debugInfo = 'false'; var iIndex = 0; if (user != '') { //internal substitution if (message.includes('[credits]')) { debugInfo = 'true'; debug += ' found [credits] ' iIndex = message.indexOf('[credits]'); for (iPlayerCount = 0; iPlayerCount < players.length; iPlayerCount++) { if (players[iPlayerCount].player_username == user) { message = message.substring(0, iIndex - 1) + ' ' + players[iPlayerCount].player_credits + ' ' + message.substring(iIndex + 9, message.length); debug += message; break; } } } } else { if (message.includes('[version]')) { debugInfo = 'true'; debug += ' found [version] ' iIndex = message.indexOf('[version]'); message = message.substring(0, iIndex - 1) + '_' + app_version + ' ' + message.substring(iIndex + 9, message.length); debug += message; } } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'app_internalSubstitution')) { if (debugInfo == 'true') { debug += ' END debuging on: app_internalSubstitution function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } return message; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_internalSubstitution: ' + err.name + ' - ' + err.message); } } function app_formatMessage(message, desired_length) { try { if (message.length >= desired_length) { return message; } var newPad = ''; var iAdd = (message.length - desired_length - 1) + 1; for (iAdd; iAdd < desired_length; iAdd++) { newPad = newPad + default_Notice_Box_Top; } message = default_Notice_Box_Side + message + newPad + default_Notice_Box_Side; return message; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: app_formatMessage: ' + err.name + ' - ' + err.message); } } function app_colorTranslator(app_colorName) { try { //return hex value of the app_color name for (iWebColorIndex = 0; iWebColorIndex < app_web_colors.length; iWebColorIndex++) { if (app_web_colors[iWebColorIndex].app_colorName == app_colorName) { //cb.chatNotice(app_web_colors[iWebapp_colorIndex].app_colorHex); return app_web_colors[iWebColorIndex].app_colorHex; } } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: app_colorTranslator: ' + err.name + ' - ' + err.message); } } //app initializations - for settings_choice form function app_notes_initialize() { try { app_notes.push('_____Version Notes_____'); } catch (err) { cb.chatNotice('Error: Send this message to chef_101: app_notes_initialize: ' + err.name + ' - ' + err.message); } } function app_todo_initialize() { try { app_todo.push('_____To Do List___'); app_todo.push('add session inteactive setup, add session toy options, add session clothing options'); app_todo.push('add session controller comands, add toy commands, add Wicked Whims'); } catch (err) { cb.chatNotice('Error: Send this message to chef_101: app_todo_initialize: ' + err.name + ' - ' + err.message); } } function app_web_colors_initialize() { try { //build array x11 app_colors var x11 = new Array(); x11.push('Alice Blue,#F0F8FF'); x11.push('Antique White,#FAEBD7'); x11.push('Aqua,#00FFFF'); x11.push('Aquamarine,#7FFFD4'); x11.push('Azure,#F0FFFF'); x11.push('Beige,#F5F5DC'); x11.push('Bisque,#FFE4C4'); x11.push('Black,#000000'); x11.push('Blanched Almond,#FFEBCD'); x11.push('Blue,#0000FF'); x11.push('Blue Violet,#8A2BE2'); x11.push('Brown,#A52A2A'); x11.push('Burlywood,#DEB887'); x11.push('Cadet Blue,#5F9EA0'); x11.push('Chartreuse,#7FFF00'); x11.push('Chocolate,#D2691E'); x11.push('Coral,#FF7F50'); x11.push('Cornflower,#6495ED'); x11.push('Cornsilk,#FFF8DC'); x11.push('Crimson,#DC143C'); x11.push('Cyan,#00FFFF'); x11.push('Dark Blue,#00008B'); x11.push('Dark Cyan,#008B8B'); x11.push('Dark Goldenrod,#B8860B'); x11.push('Dark Gray,#A9A9A9'); x11.push('Dark Green,#006400'); x11.push('Dark Khaki,#BDB76B'); x11.push('Dark Magenta,#8B008B'); x11.push('Dark Olive Green,#556B2F'); x11.push('Dark Orange,#FF8C00'); x11.push('Dark Orchid,#9932CC'); x11.push('Dark Red,#8B0000'); x11.push('Dark Salmon,#E9967A'); x11.push('Dark Sea Green,#8FBC8F'); x11.push('Dark Slate Blue ,#483D8B'); x11.push('Dark Slate Gray ,#2F4F4F'); x11.push('Dark Turquoise,#00CED1'); x11.push('Dark Violet,#9400D3'); x11.push('Deep Pink,#FF1493'); x11.push('Deep Sky Blue,#00BFFF'); x11.push('Dim Gray,#696969'); x11.push('Dodger Blue,#1E90FF'); x11.push('Firebrick,#B22222'); x11.push('Floral White,#FFFAF0'); x11.push('Forest Green,#228B22'); x11.push('Fuchsia,#FF00FF'); x11.push('Gainsboro,#DCDCDC'); x11.push('Ghost White,#F8F8FF'); x11.push('Gold,#FFD700'); x11.push('Goldenrod,#DAA520'); x11.push('Gray,#BEBEBE'); x11.push('Web Gray,#808080'); x11.push('Green,#00FF00'); x11.push('Web Green,#008000'); x11.push('Green Yellow,#ADFF2F'); x11.push('Honeydew,#F0FFF0'); x11.push('Hot Pink,#FF69B4'); x11.push('Indian Red,#CD5C5C'); x11.push('Indigo,#4B0082'); x11.push('Ivory,#FFFFF0'); x11.push('Khaki,#F0E68C'); x11.push('Lavender,#E6E6FA'); x11.push('Lavender Blush,#FFF0F5'); x11.push('Lawn Green,#7CFC00'); x11.push('Lemon Chiffon,#FFFACD'); x11.push('Light Blue,#ADD8E6'); x11.push('Light Coral,#F08080'); x11.push('Light Cyan,#E0FFFF'); x11.push('Light Goldenrod,#FAFAD2'); x11.push('Light Gray,#D3D3D3'); x11.push('Light Green,#90EE90'); x11.push('Light Pink,#FFB6C1'); x11.push('Light Salmon,#FFA07A'); x11.push('Light Sea Green,#20B2AA'); x11.push('Light Sky Blue,#87CEFA'); x11.push('Light Slate Gray,#778899'); x11.push('Light Steel Blue,#B0C4DE'); x11.push('Light Yellow,#FFFFE0'); x11.push('Lime,#00FF00'); x11.push('Lime Green,#32CD32'); x11.push('Linen,#FAF0E6'); x11.push('Magenta,#FF00FF'); x11.push('Maroon,#B03060'); x11.push('Web Maroon,#7F0000'); x11.push('Medium Aquamarine,#66CDAA'); x11.push('Medium Blue,#0000CD'); x11.push('Medium Orchid,#BA55D3'); x11.push('Medium Purple,#9370DB'); x11.push('Medium Sea Green,#3CB371'); x11.push('Medium Slate Blue,#7B68EE'); x11.push('Medium Spring Green,#00FA9A'); x11.push('Medium Turquoise,#48D1CC'); x11.push('Medium Violet Red,#C71585'); x11.push('Midnight Blue,#191970'); x11.push('Mint Cream,#F5FFFA'); x11.push('Misty Rose,#FFE4E1'); x11.push('Moccasin,#FFE4B5'); x11.push('Navajo White,#FFDEAD'); x11.push('Navy Blue,#000080'); x11.push('Old Lace,#FDF5E6'); x11.push('Olive,#808000'); x11.push('Olive Drab,#6B8E23'); x11.push('Orange,#FFA500'); x11.push('Orange Red,#FF4500'); x11.push('Orchid,#DA70D6'); x11.push('Pale Goldenrod,#EEE8AA'); x11.push('Pale Green,#98FB98'); x11.push('Pale Turquoise,#AFEEEE'); x11.push('Pale Violet Red,#DB7093'); x11.push('Papaya Whip,#FFEFD5'); x11.push('Peach Puff,#FFDAB9'); x11.push('Peru,#CD853F'); x11.push('Pink,#FFC0CB'); x11.push('Plum,#DDA0DD'); x11.push('Powder Blue,#B0E0E6'); x11.push('Purple,#A020F0'); x11.push('Web Purple,#7F007F'); x11.push('Rebecca Purple,#663399'); x11.push('Red,#FF0000'); x11.push('Rosy Brown,#BC8F8F'); x11.push('Royal Blue,#4169E1'); x11.push('Saddle Brown,#8B4513'); x11.push('Salmon,#FA8072'); x11.push('Sandy Brown,#F4A460'); x11.push('Sea Green,#2E8B57'); x11.push('Seashell,#FFF5EE'); x11.push('Sienna,#A0522D'); x11.push('Silver,#C0C0C0'); x11.push('Sky Blue,#87CEEB'); x11.push('Slate Blue,#6A5ACD'); x11.push('Slate Gray,#708090'); x11.push('Snow,#FFFAFA'); x11.push('Spring Green,#00FF7F'); x11.push('Steel Blue,#4682B4'); x11.push('Tan,#D2B48C'); x11.push('Teal,#008080'); x11.push('Thistle,#D8BFD8'); x11.push('Tomato,#FF6347'); x11.push('Turquoise,#40E0D0'); x11.push('Violet,#EE82EE'); x11.push('Wheat,#F5DEB3'); x11.push('White,#FFFFFF'); x11.push('White Smoke,#F5F5F5'); x11.push('Yellow,#FFFF00'); x11.push('Yellow Green,#9ACD32'); //load app_color objects and populate the app_colors array for (ix11 = 0; ix11 < x11.length; ix11++) { var newapp_color = app_clone(app_color); var app_colorParts = x11[ix11].split(","); newapp_color.app_colorName = app_colorParts[0]; newapp_color.app_colorHex = app_colorParts[1]; app_web_colors.push(newapp_color); } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: app_web_colors_initialize: ' + err.name + ' - ' + err.message); } } function app_colors_initialize() { try { //app_color setting var app_colorSettings = new Array(); app_colorSettings.push('app_color_debug_backcolor,Sky Blue,#87CEEB, Debug message background color.'); app_colorSettings.push('app_color_debug_forecolor,White Smoke,#F5F5F5, Debug message foreground color.'); app_colorSettings.push('app_color_chat_backcolor,Antique White,#FAEBD7, App message background color.'); app_colorSettings.push('app_color_chat_forecolor,Black,#000000, App message foreground color.'); app_colorSettings.push('app_color_notice_box_backcolor,Black,#000000, Notice box message background color.'); app_colorSettings.push('app_color_notice_box_forecolor,Fuchsia,#FF00FF, Notice box message foreground color.'); app_colorSettings.push('app_color_command_que_backcolor,Black,#000000, Command que message background color.'); app_colorSettings.push('app_color_command_que_forecolor,White,#FF00FF, Command que message foreground color.'); app_colorSettings.push('app_color_available_toys_backcolor,Antique White,#FAEBD7, Available toys menu background color.'); app_colorSettings.push('app_color_available_toys_forecolor,Black,#000000, Available toys menu foreground color.'); app_colorSettings.push('app_color_claimed_toys_backcolor,Antique White,#FAEBD7, Claimed toys status message background color.'); app_colorSettings.push('app_color_claimed_toys_forecolor,Black,#000000, Claimed toys status message foreground color.'); app_colorSettings.push('app_color_game_status_backcolor,Antique White,#FAEBD7, Game status message background color.'); app_colorSettings.push('app_color_game_status_forecolor,Black,#000000, Game status message foreground color.'); //build default app_color option and populate the default app_colors array for (iapp_colorCount = 0; iapp_colorCount < app_colorSettings.length; iapp_colorCount++) { var newapp_colorSetup = app_clone(app_color_setup); var app_colorParts = app_colorSettings[iapp_colorCount].split(","); newapp_colorSetup.app_color_name = app_colorParts[0]; newapp_colorSetup.app_color_label = app_colorParts[3] newapp_colorSetup.app_color_app_color_name = app_colorParts[1]; newapp_colorSetup.app_color_app_color_hex = app_colorParts[2]; app_default_colors_setup.push(newapp_colorSetup); if (newapp_colorSetup.app_color_name == 'app_color_debug_backcolor') { app_default_colors.app_color_debug_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_debug_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_debug_forecolor') { app_default_colors.app_color_debug_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_debug_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_chat_backcolor') { app_default_colors.app_color_chat_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_chat_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_chat_forecolor') { app_default_colors.app_color_chat_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_chat_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_notice_box_backcolor') { app_default_colors.app_color_notice_box_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_notice_box_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_notice_box_forecolor') { app_default_colors.app_color_notice_box_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_notice_box_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_command_que_backcolor') { app_default_colors.app_color_command_que_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_command_que_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_command_que_forecolor') { app_default_colors.app_color_command_que_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_command_que_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_available_toys_backcolor') { app_default_colors.app_color_available_toys_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_available_toys_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_available_toys_forecolor') { app_default_colors.app_color_available_toys_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_available_toys_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_claimed_toys_backcolor') { app_default_colors.app_color_claimed_toys_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_claimed_toys_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_claimed_toys_forecolor') { app_default_colors.app_color_claimed_toys_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_chat_claimed_toys_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_game_status_backcolor') { app_default_colors.app_color_game_status_backcolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_game_status_backcolor_hex = newapp_colorSetup.app_color_app_color_hex; } else if (newapp_colorSetup.app_color_name == 'app_color_game_status_forecolor') { app_default_colors.app_color_game_status_forecolor_name = newapp_colorSetup.app_color_app_color_name; app_default_colors.app_color_game_status_forecolor_hex = newapp_colorSetup.app_color_app_color_hex; } } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: app_colors_initialize: ' + err.name + ' - ' + err.message); } } function app_room_subjects_initialize() { try { app_room_subjects.app_room_subject_section_name = 'app_room_subject_section_name'; app_room_subjects.app_room_subject_section_value = '*****App Room Subject Settings Section*****'; app_room_subjects.app_room_subject_section_help_name = 'app_room_subject_section_help_name'; app_room_subjects.app_room_subject_section_help_value = 'Settings Help: This tells the application how to set your room subject. You can change these to anything you like.'; app_room_subjects.app_room_subject_name = 'app_room_subject_name'; app_room_subjects.app_room_subject_help = 'What do you want your room subject to say?'; app_room_subjects.app_room_subject_value ='chef\'s compliance cam - to prove that I have obeyed!'; app_room_subjects.app_room_game_subject_name = 'app_room_game_subject_name'; app_room_subjects.app_room_game_subject_help = 'What do you want the game part of the room subject to say? Must contain \'[version]\' if the app version is to show correctly.'; app_room_subjects.app_room_game_subject_value = 'Playing toy_tracker [version]'; app_room_subjects.app_room_tags_name = 'app_room_tags_name'; app_room_subjects.app_room_tags_help = 'What do you want for hashtags in your room subject?'; app_room_subjects.app_room_tags_value = '#submissive, #masochist, #pens, #cbt'; } catch (err) { cb.chatNotice('Error: Send this message to chef_101: subjects_initialize: ' + err.name + ' - ' + err.message); } } //cb events cb.onMessage(function (msg) { try { var debug = 'START debuging on: onMessage function '; var debugInfo = 'false'; var message = msg['m']; var user = msg['user']; debug += 'message:' + message; debug += ' username:' + user; //split the message into its parts and check for a command var messageParts = message.split(' '); if (messageParts[0].substring(0, 1) == '/') { debugInfo = 'true'; app_command_interpreter(user, messageParts); msg['X-Spam'] = true; } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'onMessage')) { if (debugInfo == 'true') { debug += ' END debuging on: onMessage function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } return msg; } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: cb.onMessage: ' + err.name + ' - ' + err.message); } }); cb.onEnter(function (user) { try { var debug = 'START debuging on: onEnter function '; var debugInfo = 'true'; var username = user['user']; debug += 'username: ' + username + ''; var isUser = 'no'; for (iUsersCount = 0; iUsersCount < users.length; iUsersCount++) { //see if the user is a returning user //welcome them back //show there tip ammount //show them number of tokens they need to tip to become a player if (users[iUsersCount].user_name == username) { isUser = 'yes'; app_buildMessage('WB ' + users[iUsersCount].user_name + '!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); } } if (isUser == 'no') { } debug += ' is user: ' + isUser; var isPlayer = 'no'; for (iPlayersCount = 0; iPlayersCount < players.length; iPlayersCount++) { //see if the user is a returning player if (players[iPlayersCount].player_username == username) { isPlayer = 'yes'; app_buildMessage('WB ' + username + '!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex,''); //send player a message with the play command app_buildMessage('I found you in ' + cb.room_slug + '\'s player list type /play to re-join the game', username); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); } } debug += ' is player: ' + isPlayer; //see if the user is set to friend status var isFriend = 'no' for (iFriendsCount = 0; iFriendsCount < friends.length; iFriendsCount++) { if (cb.settings[friends[iFriendsCount].friend_name] == username) { isFriend = 'yes'; //send friend a message with the play command if (isPlayer == 'no') { app_buildMessage('Welcome my friend ' + username + '!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex,''); app_buildMessage('I found you in ' + cb.room_slug + '\'s friends list type /play to join the game', username); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); } } } debug += ' is friend: ' + isFriend; //if not player or friend welcome user if new user if (isUser == 'no') { newUser = app_clone(user); newUser.user_name = username; newUser.user_tips = 0; users.push(newUser); if ((isPlayer == 'no') && (isFriend == 'no')) { if (game_settings.game_setting_free_game_value == 'free') { app_buildMessage('The game is running in free mode, type \'/play\' to request to join!', newUser.user_name); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, newUser.user_name); } else if (game_settings.game_setting_free_game_value == 'token') { app_buildMessage('The game is running in token mode, tip 100 tokens to join!', newUser.user_name); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, newUser.user_name); } app_buildMessage('Welcome ' + username + '!', ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex,''); app_buildMessage(cb.settings['join_message'], username);//, app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, username); } } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'onEnter')) { if (debugInfo == 'true') { debug += ' END debuging on: onEnter function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: cb.onEnter: ' + err.name + ' - ' + err.message); } }); cb.onLeave(function (user) { try { //see if the user has cam access and remove them if they do if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user['user'])) { cb.limitCam_removeUsers(user['user']); } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: cb.onLeave: ' + err.name + ' - ' + err.message); } }); cb.onTip(function (tip) { try { var debug = 'START debuging on: onTip function '; var debugInfo = 'true'; var amount = parseInt(tip['amount']); var user = tip['from_user']; debug += 'username: ' + user debug +=' tip: ' + amount; debug += ' game type: ' + game_settings.game_setting_free_game_value; debug += ' cost to become a player:' + game_settings.game_setting_become_player_value if (game_settings.game_setting_free_game_value == 'free') { app_buildMessage(app_formatMessage('No need to tip friend, I am just here for fun!', default_Notice_Box_Length), user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); } else if(game_settings.game_setting_free_game_value = 'token') { //see if user is a player yet for (iPlayerCount = 0; iPlayerCount < players.length; iPlayerCount++) { if (players[iPlayerCount].player_username == user) { debug += ' is player: yes' players[iPlayerCount].player_credits = players[iPlayerCount].player_credits + amount; //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'onTip')) { if (debugInfo == 'true') { debug += ' END debuging on: onTip function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } return; } } debug += user + ' is player: no '; //we didn't find a player see if tip was enough to become a player if(parseInt(amount) >= parseInt(game_settings.game_setting_become_player_value)) { newPlayer = app_clone(player) newPlayer.player_name = 'player_' + (players.length + 1); newPlayer.player_username = user; newPlayer.player_credits = parseInt(game_settings.game_setting_player_credit_value + amount); players.push(newPlayer); debug += newPlayer.player_name + ' became a player and has ' + newPlayer.player_credits + ' credits available.'; //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); cb.limitCam_addUsers(newPlayer.player_username); app_buildMessage(app_formatMessage('Was added ' + newPlayer.player_username + ' to the game!', default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); debug += user + ' became player: yes'; } else { app_buildMessage('You must tip ' + game_settings.game_setting_become_player_value + ' tokens to becomme a player.', user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); debug += user + ' became player: no'; } } if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'onTip')) { if (debugInfo == 'true') { debug += ' END debuging on: onTip function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: onTip: ' + err.name + ' - ' + err.message); } }); //game command functions function game_player_starts_session(user) { try { if (parseInt(game_sessions.session_cooldown) != 0) { app_buildMessage('A session can not be started during cooldown.', user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); return; } if (parseInt(game_sessions.session_time_remaining) == 0) { for (iPlayerCount = 0; iPlayerCount < players.length; iPlayerCount++) { if (players[iPlayerCount].player_username == user) { players[iPlayerCount].player_credits = parseInt(players[iPlayerCount].player_credits) - parseInt(game_sessions.session_CreditsForControl); break; } } //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); cb.limitCam_start(cb.settings['cam_message']); game_sessions.session_time_remaining = game_sessions.session_maximum_value; game_sessions.session_cooldown = game_sessions.session_cooldown_maximum_value; game_sessions.session_count = (parseInt(game_sessions.session_count + 1)); game_sessions.session_controller = user; app_buildMessage(game_sessions.session_controllerTitle + ': ' + game_sessions.session_controller + ' has started the session!', default_Notice_Box_Length, ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); //update array of available toys var toys_available = ''; for (iToysCount = 0; iToysCount < toys.length; iToysCount++) { if (toys[iToysCount].toy_value != '') { if ((toys[iToysCount].toy_type != 'session') && (toys[iToysCount].toy_type != 'expendable')) { toys_available = toys_available + toys[iToysCount].toy_value + '(' + toys[iToysCount].toy_creditsCost + ' credits), ' }; } } app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); app_buildMessage(cb.settings['available_toys'], ''); app_buildMessage(toys_available, ''); app_buildMessage("Type /claim [toy name] to claim one!", ''); app_buildMessage("Example type \'/claim pen0\' to claim pen0.", ''); app_buildMessage(cb.settings['available_toys'], ''); app_sendMessage(app_default_colors.app_color_available_toys_backcolor_hex, app_default_colors.app_color_available_toys_forecolor_hex, ''); app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), ''); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, ''); iGameNextNotice = 0; } else { app_buildMessage('The session has already started!', default_Notice_Box_Length, ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: game_player_starts_session: ' + err.name + ' - ' + err.message); } } function game_player_claims_toy(user, toyName) { try { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) { var bFoundToy = false; for (iToysCount = 0; iToysCount < toys.length; iToysCount++) { if (toys[iToysCount].toy_value == toyName) { bFoundToy = true; if(toys[iToysCount].toy_claimedBy == '') { toys[iToysCount].toy_claimedBy = user; for (iPlayerCount = 0; iPlayerCount < players.length; iPlayerCount++) { if (players[iPlayerCount].player_username == user) { players[iPlayerCount].player_credits = parseInt(players[iPlayerCount].player_credits) - parseInt(toys[iToysCount].toy_creditsCost); app_buildMessage(user + ' has claimed ' + toyName + '!', default_Notice_Box_Length, ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); //send player a message with the balance of there Credits app_buildMessage(cb.settings['player_tip_balance_message'], user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); return; } } } else { app_buildMessage('That toy is already in use by ' + toys[iToysCount].toy_claimedBy, user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); return; } } } if (bFoundToy == false) { app_buildMessage('That toy does not exist ' + toyName, user); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, user); } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: game_player_claims_toy: ' + err.name + ' - ' + err.message); } } function game_player_releases_toy(user, toyName) { try { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) { for (iToysCount = 0; iToysCount < toys.length; iToysCount++) { if (toys[iToysCount].toy_value == toyName) { if (toys[iToysCount].toy_claimedBy == user) { toys[iToysCount].toy_claimedBy = ''; break; } } } app_buildMessage(user + ' has released ' + toyName + ' for use!', default_Notice_Box_Length, ''); app_sendMessage(app_default_colors.app_color_chat_backcolor_hex, app_default_colors.app_color_chat_forecolor_hex, ''); } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: game_player_releases_toy: ' + err.name + ' - ' + err.message); } } function game_interactive_menu_yes(username, message) { try { var debug = 'START debuging on: game_interactive_menu_yes function '; var debugInfo = 'true'; debug += ' username = ' + username; debug += ' message = ' + message; debug += ' commands in que = ' + game_commands.length; app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), username); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, username); for (iGameCommandQueIndex = 0; iGameCommandQueIndex < game_commands.length; iGameCommandQueIndex++) { debug += ' app_interactive_commander = ' + game_commands[iGameCommandQueIndex].app_interactive_commander; debug += ' app_interactive_complier = ' + game_commands[iGameCommandQueIndex].app_interactive_complier; debug += ' app_interactive_menu_name = ' + game_commands[iGameCommandQueIndex].app_interactive_menu_name; debug += ' app_interactive_step = ' + game_commands[iGameCommandQueIndex].app_interactive_step; if (game_commands[iGameCommandQueIndex].app_interactive_complier == username) { if (game_commands[iGameCommandQueIndex].app_interactive_menu_name == 'play') { if (game_commands[iGameCommandQueIndex].app_interactive_step == 0) { app_buildMessage( game_commands[iGameCommandQueIndex].app_interactive_commander + ' Commands you to play! Do you accept? ', default_Notice_Box_Length, username); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, username); game_commands[iGameCommandQueIndex].app_interactive_step = 1; break; } else if (game_commands[iGameCommandQueIndex].app_interactive_step == 1) { app_add_player(game_commands[iGameCommandQueIndex].app_interactive_commander); game_commands.splice(iGameCommandQueIndex, 1); break; } } } } if (game_commands.length != 0) { var commandsMessage = ''; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { commandsMessage += ' type /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { commandsMessage += ' or /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } } app_buildMessage(commandsMessage, username); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, username); } app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), username); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, username); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'game_interactive_menu_yes')) { if (debugInfo == 'true') { debug += ' END debuging on: game_interactive_menu_yes function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: game_interactive_menu_yes: ' + err.name + ' - ' + err.message); } } function game_interactive_menu_no(username, message) { try { var debug = 'START debuging on: game_interactive_menu_no function '; var debugInfo = 'true'; debug += ' username = ' + username; debug += ' message = ' + message; debug += ' commands in que = ' + game_commands.length; app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), username); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, username); for (iGameCommandQueIndex = 0; iGameCommandQueIndex < game_commands.length; iGameCommandQueIndex++) { debug += ' app_interactive_commander = ' + game_commands[iGameCommandQueIndex].app_interactive_commander; debug += ' app_interactive_complier = ' + game_commands[iGameCommandQueIndex].app_interactive_complier; debug += ' app_interactive_menu_name = ' + game_commands[iGameCommandQueIndex].app_interactive_menu_name; debug += ' app_interactive_step = ' + game_commands[iGameCommandQueIndex].app_interactive_step; if (game_commands[iGameCommandQueIndex].app_interactive_complier == username) { if (game_commands[iGameCommandQueIndex].app_interactive_menu_name == 'play') { if ((game_commands[iGameCommandQueIndex].app_interactive_step == 0) || (game_commands[iGameCommandQueIndex].app_interactive_step == 1)) { if (message == undefined) { app_buildMessage(username + ' Declined your request to ' + game_commands[iGameCommandQueIndex].app_interactive_menu_name + '.', game_commands[iGameCommandQueIndex].app_interactive_commander); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, game_commands[iGameCommandQueIndex].app_interactive_commander); } else { app_buildMessage(username + ' Declined your request to ' + game_commands[iGameCommandQueIndex].app_interactive_menu_name + '. ' + message, game_commands[iGameCommandQueIndex].app_interactive_commander); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, game_commands[iGameCommandQueIndex].app_interactive_commander); } game_commands.splice(iGameCommandQueIndex, 1); break; } } } } if (game_commands.length != 0) { var commandsMessage = ''; for (iAppCommandIndex = 0; iAppCommandIndex < app_commands.length; iAppCommandIndex++) { if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_yes') { commandsMessage += ' type /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } else if (app_commands[iAppCommandIndex].app_command_function == 'game_interactive_menu_no') { commandsMessage += ' or /\'' + app_commands[iAppCommandIndex].app_command_value + '\''; } } app_buildMessage(commandsMessage, username); app_sendMessage(app_default_colors.app_color_command_que_backcolor_hex, app_default_colors.app_color_command_que_forecolor_hex, username); } app_buildMessage(app_formatMessage(default_Notice_Box_Top, default_Notice_Box_Length), username); app_sendMessage(app_default_colors.app_color_notice_box_backcolor_hex, app_default_colors.app_color_notice_box_forecolor_hex, username); if (app_debug == 'yes') { if ((app_debug_function == 'all') || (app_debug_function == 'game_interactive_menu_no')) { if (debugInfo == 'true') { debug += ' END debuging on: game_interactive_menu_no function'; app_sendDebugMessage(app_default_colors.app_color_debug_backcolor_hex, app_default_colors.app_color_debug_forecolor_hex, debug); } } } } catch (err) { cb.chatNotice ('Error: Send this message to chef_101: game_interactive_menu_no: ' + err.name + ' - ' + err.message); } } //game initializations - for settings_choice form function game_settings_initialize() { try { game_settings.game_setting_name = 'game_settings', //setting name game_settings.game_setting_free_game_name = 'free_game', //holds free game toggle game_settings.game_setting_free_game_value = 'free', //holds free game toggle game_settings.game_setting_free_game_label = 'Is your room a free room or a token room?', game_settings.game_setting_free_game_choice1 = 'free', game_settings.game_setting_free_game_choice2 = 'token', game_settings.game_setting_become_player_name = 'become_player', //holds cost in credits to become a player game_settings.game_setting_become_player_value = 100, game_settings.game_setting_become_player_label = 'If your room is a token room.How many tokens should it cost to become a player?', game_settings.game_setting_player_credit_name = 'player_credit', //holds give credits to player game_settings.game_setting_player_credit_value = 1000, game_settings.game_setting_player_credit_label = ' If your room is a free room you need to give players credits when they are added to the game. How many credits would you like to give each player?', game_settings.game_setting_friend_credit_name = 'friend_credit', //holds give credits to friend game_settings.game_setting_friend_credit_value = 10000, game_settings.game_setting_friend_credit_label = ' Would you like to give credits to your friends when they join the game? If so how many?' game_settings.game_setting_non_session_notice_interval_name = 'non_session_notice_interval', //the time between notices when no session has started game_settings.game_setting_non_session_notice_interval_value = 5, game_settings.game_setting_non_session_notice_interval_label = ' How long in minutes do you want between notices when no session is in progress?', game_settings.game_setting_session_notice_interval_name = 'session_notice_interval', //the time between notices when no session has started game_settings.game_setting_session_notice_interval_value = 1, game_settings.game_setting_session_notice_interval_label = ' How long in minutes do you want between notices when a session is in progress?' } catch (err) { cb.chatNotice('Error: Send this message to chef_101: game_settings_initialize: ' + err.name + ' - ' + err.message); } } function game_messages_initialize() { try { //message settings var messageSettings = new Array(); messageSettings.push('available_toys,What do you want the topic of your available toys notice to say?,*****Available Toys*****') messageSettings.push('claimed_toys,What do you want the topic of your claimed toys notice to say?,*****Claimed Toys*****') messageSettings.push('game_status,What do you want the topic for the notice of you game status say?,*****Game Status*****') messageSettings.push('cam_message,Cam Message, Hi my friends! I am here to chat and have fun, not for cash.'); messageSettings.push('join_message,User Join Message,I am only here to chat and have fun, not for cash. The game runs on credits which you get when you are added as a player for free. I like to see the ones who our tormenting me, so if you have a cam and want to play the game type /play.'); messageSettings.push('player_tip_balance_message,What do you want the credit balance message to say to your players? Must contain \'[credits]\' to show their balnce., You have [credits] credits remaining to spend!'); //build default room_subjects and populate the room array for (iMessageCount = 0; iMessageCount < messageSettings.length; iMessageCount++) { var newMessage = app_clone(game_message); var messageParts = messageSettings[iMessageCount].split(","); newMessage.name = messageParts[0]; newMessage.label = messageParts[1]; newMessage.defaultValue = messageParts[2]; game_messages.push(newMessage); } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: game_messages_initialize: ' + err.name + ' - ' + err.message); } } function game_session_initialize() { try { //update session setting objects with user settings game_sessions.session_name = 'game_session'; game_sessions.session_time_remaining = 0; game_sessions.session_maximum_name = 'session_maximum' game_sessions.session_maximum = 120; game_sessions.session_maximum_value = 0; game_sessions.session_cooldown = 0; game_sessions.session_cooldown_maximum_name = 'session_cooldown_maximum'; game_sessions.session_cooldown_maximum = 30; game_sessions.session_cooldown_maximum_value = 0; game_sessions.session_count = 0; game_sessions.session_command_que_count = 0; game_sessions.session_CreditsForControl_name = 'session_CreditsForControl'; game_sessions.session_CreditsForControl = 100; game_sessions.session_CreditsForControl_value = 0; game_sessions.session_controller = ''; game_sessions.session_controllerTitle_name = 'session_controllerTitle'; game_sessions.session_controllerTitle = 'Session Mistress'; game_sessions.session_controllerTitle_value = ''; game_sessions.session_submissiveTitle_name = 'session_submissiveTitle'; game_sessions.session_submissiveTitle = 'chef'; game_sessions.session_submissiveTitle_value = ''; game_sessions.session_advertiseToPlay = 'Tip [playerTokenAmount] tokens to become a player!'; game_sessions.session_setup_step = 0; } catch (err) { cb.chatNotice('Error: Send this message to chef_101: session_initialize: ' + err.name + ' - ' + err.message); } } function toys_initialize() { try { //dynamicaly generate public toys for (iToysCount = 0; iToysCount < 25; iToysCount++) { var newToy = app_clone(toy); newToy.toy_name = 'toy_' + (iToysCount + 1); newToy.toy_value = ''; newToy.toy_type = 'timed'; newToy.toy_creditsCost = 10; newToy.toy_claimedBy = ''; newToy.toy_location = 'off'; toys.push(newToy); } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: toys_initialize: ' + err.name + ' - ' + err.message); } } function toy_types_initialize() { try { toy_types.push('session'); toy_types.push('decremental'); toy_types.push('timed'); toy_types.push('expendable'); } catch (err) { cb.chatNotice('Error: Send this message to chef_101: toy_types_initialize: ' + err.name + ' - ' + err.message); } } function friends_initialize() { try { //dynamicaly generate friends list for (iFriendsCount = 0; iFriendsCount < 25; iFriendsCount++) { var newFriend = app_clone(friend); newFriend.friend_name = 'friend_' + (iFriendsCount + 1); newFriend.friend_label = ''; newFriend.friend_credits = cb.settings['friend_credit']; friends.push(newFriend); } } catch (err) { cb.chatNotice('Error: Send this message to chef_101: friends_initialize: ' + err.name + ' - ' + err.message); } } function init() { try { app_commands_initialize(); app_notes_initialize(); app_todo_initialize(); app_web_colors_initialize(); app_colors_initialize(); app_room_subjects_initialize(); game_settings_initialize(); game_session_initialize(); game_messages_initialize(); toys_initialize(); toy_types_initialize(); friends_initialize(); //verison info //clear old verion info cb.settings.app_version = ''; cb.settings.app_date = ''; cb.settings.app_notes = new Array(); cb.settings.app_todo = new Array(); cb.settings_choices = [ { name: '*****Debug Mode Section*****', type: 'choice', choice1: '-', label: '*****Debug Mode Section*****', defaultValue: '-', required: true }, { name: '*****Debug Mode Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: Settings in this section allow you turn on debug mode and see function specific debug information only.', defaultValue: '-', required: true }, { name: 'app_debug', type: 'choice', choice1: 'no', choice2: 'yes', label: 'Setting this to yes turns debug code mode on.', defaultValue: app_debug, required: true }, { name: 'app_debug_function', type: 'choice', choice1: 'all', choice2: 'onMessage', choice3: 'onEnter', choice4: 'onTip', choice5: 'app_add_player', choice6: 'app_play', choice7: 'app_stats', choice8: 'app_command_interpreter', choice9: 'app_internalSubstitution', choice10: 'game_interactive_menu_yes', choice11: 'game_interactive_menu_no', label: 'Setting this to all will show debug information from all functions that have it. Setting this to a single function will only show debug information from that function.', defaultValue: 'all', required: true }, { name: '*****Version Info Section*****', type: 'choice', choice1: '-', label: '*****Version Info Section*****', defaultValue: '-', required: true }, { name: '*****Version Info Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: You can not change the values in this section. This section is to show you application version information.', defaultValue: '-', required: true }, { name: 'app_version', type: 'choice', choice1: app_version, label: 'Version:', defaultValue: app_version, required: true }, { name: 'app_date', type: 'choice', choice1: app_date, label: 'Version Date:', defaultValue: app_date, required: true }, { name: 'app_hash', type: 'choice', choice1: app_hash, label: 'Hash tag for app:', defaultValue: app_hash, required: true }, ]; for (iAppNoteCount = 0; iAppNoteCount < app_notes.length; iAppNoteCount++) { cb.settings_choices.push ( { name: app_notes[iAppNoteCount] + iAppNoteCount, type: 'choice', choice1: '-', label: app_notes[iAppNoteCount], defaultValue: '-', required: true } ); } for (iToDoNoteCount = 0; iToDoNoteCount < app_todo.length; iToDoNoteCount++) { cb.settings_choices.push ( { name: app_todo[iToDoNoteCount] + iToDoNoteCount, type: 'choice', choice1: '-', label: app_todo[iToDoNoteCount], defaultValue: '-', required: true } ); } //app commands cb.settings_choices.push ( { name: '*****App Command Settings Section*****', type: 'choice', choice1: '-', label: '*****App Command Settings Section*****', defaultValue: '-', required: true }, { name: '*****App Command Settings Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: These are the app commands useable by only you and you can change them to anything you like.', defaultValue: '-', required: true } ); for (iCommandCount = 0; iCommandCount < app_commands.length; iCommandCount++) { if (app_commands[iCommandCount].app_command_access == 'you') { cb.settings_choices.push ( { name: app_commands[iCommandCount].app_command_name, type: 'str', label: app_commands[iCommandCount].app_command_help, defaultValue: app_commands[iCommandCount].app_command_value } ); } } //player commands cb.settings_choices.push ( { name: '*****Player Command Settings Section*****', type: 'choice', choice1: '-', label: '*****Player Command Settings Section*****', defaultValue: '-', required: true }, { name: '*****Player Command Settings Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: These are the player commands useable by all users who have become players and you can change them to anything you like.', defaultValue: '-', required: true } ); for (iCommandCount = 0; iCommandCount < app_commands.length; iCommandCount++) { if (app_commands[iCommandCount].app_command_access == 'player') { cb.settings_choices.push ( { name: app_commands[iCommandCount].app_command_name, type: 'str', label: app_commands[iCommandCount].app_command_help, defaultValue: app_commands[iCommandCount].app_command_value } ); } } //all user commands cb.settings_choices.push ( { name: '*****All User Command Settings Section*****', type: 'choice', choice1: '-', label: '*****All User Command Settings Section*****', defaultValue: '-', required: true }, { name: '*****All User Command Settings Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: These are the all user commands useable by all users and you can change them to anything you like.', defaultValue: '-', required: true } ); for (iCommandCount = 0; iCommandCount < app_commands.length; iCommandCount++) { if (app_commands[iCommandCount].app_command_access == 'all') { cb.settings_choices.push ( { name: app_commands[iCommandCount].app_command_name, type: 'str', label: app_commands[iCommandCount].app_command_help, defaultValue: app_commands[iCommandCount].app_command_value } ); } } //game settings cb.settings_choices.push ( { name: '*****Game Settings Section*****', type: 'choice', choice1: '-', label: '*****Game Settings Section*****', defaultValue: '-', required: true }, { name: '*****Game Settings Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: These are game settings that change how the application functions, you can change them to anything you like.', defaultValue: '-', required: true } ); //game settings cb.settings_choices.push ( { name: game_settings.game_setting_free_game_name, type: 'choice', label: game_settings.game_setting_free_game_label, choice1: game_settings.game_setting_free_game_choice1, choice2: game_settings.game_setting_free_game_choice2, defaultValue: game_settings.game_setting_free_game_value }, { name: game_settings.game_setting_become_player_name, type: 'int', label: game_settings.game_setting_become_player_label, defaultValue: game_settings.game_setting_become_player_value }, { name: game_settings.game_setting_player_credit_name, type: 'int', label: game_settings.game_setting_player_credit_label, defaultValue: game_settings.game_setting_player_credit_value }, { name: game_settings.game_setting_friend_credit_name, type: 'int', label: game_settings.game_setting_friend_credit_label, defaultValue: game_settings.game_setting_friend_credit_value }, { name: game_settings.game_setting_non_session_notice_interval_name, type: 'int', label: game_settings.game_setting_non_session_notice_interval_label, defaultValue: game_settings.game_setting_non_session_notice_interval_value }, { name: game_settings.game_setting_session_notice_interval_name, type: 'int', label: game_settings.game_setting_session_notice_interval_label, defaultValue: game_settings.game_setting_session_notice_interval_value } ); //add chat app_color options cb.settings_choices.push ( { name: '*****App Color Settings Section*****', type: 'choice', choice1: '-', label: '*****App Color Settings Section*****', defaultValue: '-', required: true }, { name: '*****App Color Setting Section Help*****', type: 'choice', choice1: '-', label: 'Settings Help: This section allows you to change the colors of the apps chat notices.', defaultValue: '-', required: true } ); for (iColorCount = 0; iColorCount < app_default_colors_setup.length; iColorCount++) { cb.settings_choices.push ( { name: app_default_colors_setup[iColorCount].app_color_name, type: 'choice', label: app_default_colors_setup[iColorCount].app_color_label, choice0: 'Alice Blue', choice1: 'Antique White', choice2: 'Aqua', choice3: 'Aquamarine', choice4: 'Azure', choice5: 'Beige', choice6: 'Bisque', choice7: 'Black', choice8: 'Blanched Almond', choice9: 'Blue', choice10: 'Blue Violet', choice11: 'Brown', choice12: 'Burlywood', choice13: 'Cadet Blue', choice14: 'Chartreuse', choice15: 'Chocolate', choice16: 'Coral', choice17: 'Cornflower', choice18: 'Cornsilk', choice19: 'Crimson', choice20: 'Cyan', choice21: 'Dark Blue', choice22: 'Dark Cyan', choice23: 'Dark Goldenrod', choice24: 'Dark Gray', choice25: 'Dark Green', choice26: 'Dark Khaki', choice27: 'Dark Magenta', choice28: 'Dark Olive Green', choice29: 'Dark Orange', choice30: 'Dark Orchid', choice31: 'Dark Red', choice32: 'Dark Salmon', choice33: 'Dark Sea Green', choice34: 'Dark Slate Blue ', choice35: 'Dark Slate Gray ', choice36: 'Dark Turquoise', choice37: 'Dark Violet', choice38: 'Deep Pink', choice39: 'Deep Sky Blue', choice40: 'Dim Gray', choice41: 'Dodger Blue', choice42: 'Firebrick', choice43: 'Floral White', choice44: 'Forest Green', choice45: 'Fuchsia', choice46: 'Gainsboro', choice47: 'Ghost White', choice48: 'Gold', choice49: 'Goldenrod', choice50: 'Gray', choice51: 'Web Gray', choice52: 'Green', choice53: 'Web Green', choice54: 'Green Yellow', choice55: 'Honeydew', choice56: 'Hot Pink', choice57: 'Indian Red', choice58: 'Indigo', choice59: 'Ivory', choice60: 'Khaki', choice61: 'Lavender', choice62: 'Lavender Blush', choice63: 'Lawn Green', choice64: 'Lemon Chiffon', choice65: 'Light Blue', choice66: 'Light Coral', choice67: 'Light Cyan', choice68: 'Light Goldenrod', choice69: 'Light Gray', choice70: 'Light Green', choice71: 'Light Pink', choice72: 'Light Salmon', choice73: 'Light Sea Green', choice74: 'Light Sky Blue', choice75: 'Light Slate Gray', choice76: 'Light Steel Blue', choice77: 'Light Yellow', choice78: 'Lime', choice79: 'Lime Green', choice80: 'Linen', choice81: 'Magenta', choice82: 'Maroon', choice83: 'Web Maroon', choice84: 'Medium Aquamarine', choice85: 'Medium Blue', choice86: 'Medium Orchid', choice87: 'Medium Purple', choice88: 'Medium Sea Green', choice89: 'Medium Slate Blue', choice90: 'Medium Spring Green', choice91: 'Medium Turquoise', choice92: 'Medium Violet Red', choice93: 'Midnight Blue', choice94: 'Mint Cream', choice95: 'Misty Rose', choice96: 'Moccasin', choice97: 'Navajo White', choice98: 'Navy Blue', choice99: 'Old Lace', choice100: 'Olive', choice101: 'Olive Drab', choice102: 'Orange', choice103: 'Orange Red', choice104: 'Orchid', choice105: 'Pale Goldenrod', choice106: 'Pale Green', choice107: 'Pale Turquoise', choice108: 'Pale Violet Red', choice109: 'Papaya Whip', choice110: 'Peach Puff', choice111: 'Peru', choice112: 'Pink', choice113: 'Plum', choice114: 'Powder Blue', choice115: 'Purple', choice116: 'Web Purple', choice117: 'Rebecca Purple', choice118: 'Red', choice119: 'Rosy Brown', choice120: 'Royal Blue', choice121: 'Saddle Brown', choice122: 'Salmon', choice123: 'Sandy Brown', choice124: 'Sea Green', choice125: 'Seashell', choice126: 'Sienna', choice127: 'Silver', choice128: 'Sky Blue', choice129: 'Slate Blue', choice130: 'Slate Gray', choice131: 'Snow', choice132: 'Spring Green', choice133: 'Steel Blue', choice134: 'Tan', choice135: 'Teal', choice136: 'Thistle', choice137: 'Tomato', choice138: 'Turquoise', choice139: 'Violet', choice140: 'Wheat', choice141: 'White', choice142: 'White Smoke', choice143: 'Yellow', choice144: 'Yellow Green', defaultValue: app_default_colors_setup[iColorCount].app_color_app_color_name } ); } //add room subjects cb.settings_choices.push ( { name: app_room_subjects.app_room_subject_section_name, type: 'choice', choice1: '-', label: app_room_subjects.app_room_subject_section_value, defaultValue: '-', required: true }, { name: app_room_subjects.app_room_subject_section_help_name, type: 'choice', choice1: '-', label: app_room_subjects.app_room_subject_section_help_value, defaultValue: '-', required: true }, { name: app_room_subjects.app_room_subject_name, type: 'str', label: app_room_subjects.app_room_subject_help, defaultValue: app_room_subjects.app_room_subject_value, required: true }, { name: app_room_subjects.app_room_game_subject_name, type: 'str', label: app_room_subjects.app_room_game_subject_help, defaultValue: app_room_subjects.app_room_game_subject_value, required: true }, { name: app_room_subjects.app_room_tags_name, type: 'str', label: app_room_subjects.app_room_tags_help, defaultValue: app_room_subjects.app_room_tags_value, required: true } ); //session settings cb.settings_choices.push ( { name: '*****Session Info Section*****', type: 'choice', choice1: '-', label: '*****Session Info Section*****', defaultValue: '-', required: true }, { name: '*****Session Info Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: The game is divided into rounds called sessions. When the session begins only user who have become players will be able to see your cam. Each session last a period of time. After a session has ended and the cooldown period begins. No new session can be started by a player until the cooldown period has ended.', defaultValue: '-', required: true }, { name: game_sessions.session_maximum_name, type: 'int', label: 'How long in minutes do you want a session to last?', defaultValue: game_sessions.session_maximum }, { name: game_sessions.session_cooldown_maximum_name, type: 'int', label: 'How long in minutes do you want between sessions?', defaultValue: game_sessions.session_cooldown_maximum }, { name: game_sessions.session_CreditsForControl_name, type: 'int', label: 'How many credits do you want it to cost to control a session?', defaultValue: game_sessions.session_CreditsForControl }, { name: game_sessions.session_controllerTitle_name, type: 'str', label: 'How do you want the game to refrence the session controller?', defaultValue: game_sessions.session_controllerTitle }, { name: game_sessions.session_submissiveTitle_name, type: 'str', label: 'How do you want the game to refrence you?', defaultValue: game_sessions.session_submissiveTitle } ); //add game messages cb.settings_choices.push ( { name: '*****Game Messages Settings Section*****', type: 'choice', choice1: '-', label: '*****Game Messages Settings Section****', defaultValue: '-', required: true }, { name: '*****Game Messages Section Help*****', type: 'choice', choice1: '-', label: 'Section Help: These are game messages that the application uses to communicate with players when a command is activated or an event occurs. You can change these to anything you like.', defaultValue: '-', required: true } ); for (iMessageCount = 0; iMessageCount < game_messages.length; iMessageCount++) { cb.settings_choices.push ( { name: game_messages[iMessageCount].name, type: 'str', minLength: 1, maxLength: 255, label: game_messages[iMessageCount].label, defaultValue: game_messages[iMessageCount].defaultValue } ); } //add toys cb.settings_choices.push ( { name: '*****Toy Settings Section*****', type: 'choice', choice1: '-', label: '*****Toy Settings Section*****', defaultValue: '-', required: true }, { name: '*****Toy Settings Section*****', type: 'choice', choice1: '-', label: 'Section Help: These are where you set up your toys to be claimable buy your players during a session. Toy Types: Session toys are controlled by the session controller - Decremental/Timed toys are claimable - Expendable toys are one time use toys', defaultValue: '-', required: true } ); for (iToyCount = 0; iToyCount < toys.length; iToyCount++) { cb.settings_choices.push ( { name: toys[iToyCount].toy_name + '_value', type: 'str', label: 'Name this toy?', defaultValue: toys[iToyCount].toy_value, required: false }, { name: toys[iToyCount].toy_name + '_cost', type: 'int', label: 'The cost to claim this toy in credits?', defaultValue: toys[iToyCount].toy_creditsCost, required: true }, { name: toys[iToyCount].toy_name + '_type', label: '', type: 'choice', choice1: toy_types[0], choice2: toy_types[1], choice3: toy_types[2], choice4: toy_types[3], defaultValue: toy_types[2], required: true } ); } //add friends cb.settings_choices.push ( { name: '*****Friends Settings Section*****', type: 'choice', choice1: '-', label: '*****Friends Settings Section*****', defaultValue: '-', required: true }, { name: '*****Friends Settings Section*****', type: 'choice', choice1: '-', label: 'Section Help: These are the usernames of people you want to have automatic access to the game when they enter your room.', defaultValue: '-', required: true } ); for (iFriendCount = 0; iFriendCount < friends.length; iFriendCount++) { cb.settings_choices.push ( { name: friends[iFriendCount].friend_name, type: 'str', label: friends[iFriendCount].friend_name, defaultValue: '', required: false } ); } app_initialize(); } catch (err) { cb.chatNotice('Error: Send this message to chef_101: init: ' + err.name + ' - ' + err.message); } } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.