Bots Home
|
Create an App
Rick anon bot
Author:
boob
Description
Source Code
Launch Bot
Current Users
Created by:
Boob
// startof CBSv2 module - not for re-compilation (function(a,h){function f(a){this.message=a}f.prototype=Error();f.prototype.name="InvalidCharacterError";a.btoa||(a.btoa=function(a){a=String(a);for(var g,b,m=0,d=h,q="";a.charAt(m|0)||(d="=",m%1);q+=d.charAt(63&g>>8-m%1*8)){b=a.charCodeAt(m+=.75);if(255<b)throw new f('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');g=g<<8|b}return q});a.atob||(a.atob=function(a){a=String(a).replace(/=+$/,"");if(1==a.length%4)throw new f('"atob" failed: The string to be decoded is not correctly encoded.'); for(var g=0,b,m,d=0,q="";m=a.charAt(d++);~m&&(b=g%4?64*b+m:m,g++%4)?q+=String.fromCharCode(255&b>>(-2*g&6)):0)m=h.indexOf(m);return q})})("undefined"===typeof exports?this:exports,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="); (function(a){var h=cb.onMessage,f=null,p=null,g,b="#"+(cb.settings.hasOwnProperty("slot")?cb.settings.slot:"")+"CBSv2",m=/^\/#[0-3]CBSv2\//;cb.onMessage=function(d){if("function"!==typeof d)throw new TypeError(d+" is not a function");h(function(h){var e=h.m.replace(/\s*/g,"").split("/"),k,r;3<e.length&&""===e[0]&&e[1]===b?(f&&p&&h.user===cb.room_slug&&(k=e[2],4===e.length?(e[3]="?",h.m=e.join("/")):6===e.length?((g||{}).hasOwnProperty(k)||(r=f(),g={},g[k]=a.btoa(a.unescape(a.encodeURIComponent(r))), r||cb.log("onSave returned no data.")),g.hasOwnProperty(k)&&(r=parseInt(e[3],10),k=g[k].slice(r,r+512),e[4]=k,e[5]=k.length,h.m=e.join("/"))):7===e.length&&("0"===e[3]&&(g={},g[k]=""),g.hasOwnProperty(k)&&(e[3]=g[k].length,e[6]=e[4].length,h.m=e.join("/"),e[4]?g[k]+=e[4]:(r=a.decodeURIComponent(a.escape(a.atob(g[k]))),p(r),cb.sendNotice("Previously Saved Data Restored.",cb.room_slug))))),h["X-Spam"]=!0):m.test(h.m)&&(h["X-Spam"]=!0);return d(h)});return d};cb.onRestore=function(a){if("function"!== typeof a)throw new TypeError(a+" is not a function");return p=a};cb.onSave=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");return f=a};cb.onMessage(function(a){return a})})("undefined"===typeof exports?this:exports); // endof CBSv2 module - not for re-compilation //Written by Viper // custom notification text feature added by rubzombie var settings = { enter_notice: "Hello, %%USER%%. As a registered user you can view %%ROOM%%'s cam.", message_notice: "Hello, %%USER%%. As a registered user you can view %%ROOM%%'s cam.", re_enter_notice: "Welcome back, %%USER%%. As a registered user you can view %%ROOM%%'s cam.", start_msg: "Now blocking anonymous viewers. If you are a registered user please type a message in the chat or refresh!", start_notice: "Now blocking anonymous viewers!\\nIf you are signed in and can't see %%ROOM%%'s cam, refresh the page or type in the chat." }, reRoom = /%%ROOM%%/g, reUser = /%%USER%%/g; cb['settings_choices'] = [{ //'defaultValue': settings.enter_notice, 'label': 'On Enter notice (e.g. ' + settings.enter_notice + ')', 'minLength': 1, 'name': 'enter_notice', 'required': false, 'type': 'str' }, { //'defaultValue': settings.message_notice, 'label': 'On Message notice (e.g. ' + settings.message_notice + ')', 'minLength': 1, 'name': 'message_notice', 'required': false, 'type': 'str' }, { //'defaultValue': settings.re_enter_notice, 'label': 'On Re-enter notice (e.g. ' + settings.re_enter_notice + ')', 'minLength': 1, 'name': 're_enter_notice', 'required': false, 'type': 'str' }, { //'defaultValue': settings.start_msg, 'label': 'On Start message (e.g. ' + settings.start_msg + ')', 'minLength': 1, 'name': 'start_msg', 'required': false, 'type': 'str' }, { //'defaultValue': settings.start_notice, 'label': 'On Start notice (e.g. ' + settings.start_notice + ')', 'minLength': 1, 'name': 'start_notice', 'required': false, 'type': 'str' }]; cb['onEnter'](function (user) { if (user['user'] !== cb['room_slug'] && !cbjs['arrayContains'](cb['limitCam_allUsersWithAccess'](), user['user'])) { cb['limitCam_addUsers']([user['user']]); cb['chatNotice'](settings.enter_notice.replace(reUser, user['user']).replace(reRoom, cb['room_slug']), user['user'], '#fcb2bf', '#000000', 'bold'); } else if (cbjs['arrayContains'](cb['limitCam_allUsersWithAccess'](), user['user'])) { cb['chatNotice'](settings.re_enter_notice.replace(reUser, user['user']).replace(reRoom, cb['room_slug']), user['user'], '#fcb2bf', '#000000', 'bold'); } }); cb['onMessage'](function (msg) { if (msg['user'] !== cb['room_slug'] && !cbjs['arrayContains'](cb['limitCam_allUsersWithAccess'](), msg['user'])) { cb['limitCam_addUsers']([msg['user']]); cb['chatNotice'](settings.message_notice.replace(reUser, msg['user']).replace(reRoom, cb['room_slug']), msg['user'], '#fcb2bf', '#000000', 'bold'); } return msg; }); function init() { var choice; for (choice in settings) { if (settings.hasOwnProperty(choice)) { if (cb['settings'].hasOwnProperty(choice) && cb['settings'][choice] && cb['settings'][choice].length) { settings[choice] = cb['settings'][choice]; } settings[choice] = settings[choice].replace(/\s*\\n\s*/g, '\n'); } } cb['limitCam_start'](settings.start_msg.replace(/\n/g, ' ').replace(reRoom, cb['room_slug'])); // not sure if start message can include newlines ? cb['chatNotice'](settings.start_notice.replace(reRoom, cb['room_slug']), '', '#fcb2bf', '#000000', 'bold'); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.