Bots Home
|
Create an App
GenderBot
Author:
alysandrefan
Description
Source Code
Launch Bot
Current Users
Created by:
Alysandrefan
/************************************************************* ** Title : Gender Bot ** Author : ** Description : *************************************************************/ var botVersion = "1.0"; var botMsgBg = '#D32B2B'; var intro_women = 1; var intro_men = 0; function get_gender_avatar(gender) { var genderStr = ""; switch (gender) { case 'm' : genderStr = ':avatar_cb_male' ; break; case 'f' : genderStr = ':avatar_cb_female' ; break; case 's' : genderStr = ':avatar_cb_transsex' ; break; case 'c' : genderStr = ':avatar_cb_couple' ; break; default : genderStr = ':avatar_gen_unknown' ; break; } return genderStr; } function get_gender_bgcolor(gender) { switch (gender) { case 'f' : case 'c' : return "#F88"; case 'm' : return "#88F"; default : return "#888"; } } function is_worthy(gender) { switch (gender) { case 'f' : case 's' : case 'c' : return intro_women; case 'm' : return intro_men; default : return intro_women; } } cb.onEnter(function(user) { var gender = user['gender']; var genderStr = get_gender_avatar(gender); var genderColor = get_gender_bgcolor(gender); var isWorthy = is_worthy(gender); if (isWorthy) { cb.chatNotice(genderStr+' '+user['user'] + ' entered the room !', cb.room_slug, genderColor); } }); cb.onLeave(function(user) { var gender = user['gender']; var genderStr = get_gender_avatar(gender); var genderColor = get_gender_bgcolor(gender); var isWorthy = is_worthy(gender); if (isWorthy) { cb.chatNotice(genderStr+' '+user['user'] + ' left the room !', cb.room_slug, genderColor); } }); cb.onMessage(function(message) { var gender = message['gender']; var genderStr = get_gender_avatar(gender); message['m'] = genderStr + ' ' + message['m']; }); //end onMessage function announceBot() { statusMsg = '***** Gender Bot v'+botVersion+' *****'; return statusMsg; } cb.chatNotice(announceBot(),'', botMsgBg,'','bold');
© Copyright Freesexcam 2011- 2024. All Rights Reserved.