Bots Home
|
Create an App
Lovense by BeautyanTheDick
Author:
beautyanthedick
Description
Source Code
Launch Bot
Current Users
Created by:
Beautyanthedick
/** * Lovense by BeautyanTheDick * Version: 1.0 * Author: BeautyanTheDick * Date: 8/31/2018 * Based on work by: codeanon */ cb.settings_choices = function () { var output = []; var ins_index = 0; makeInstructions('[LOVENSE LEVELS] ----------- Set the below options to the same as in your Lovense control panel.'); makeLevel(1, 1, 25, 7, 'Low'); makeLevel(2, 26, 50, 7, 'Medium'); makeLevel(3, 51, 75, 15, 'High'); makeLevel(4, 76, 100, 20, 'Ultra'); makeLevel(5, 100, 99999, 30, 'Ultra High'); makeLevel(6, 69, 69, 1, 'Random'); makeLevel(7, 111, 111, 60, 'Wave'); makeLevel(8, 222, 222, 120, 'Pulse'); makeLevel(9, 333, 333, 180, 'Earthquake'); makeLevel(10, 444, 444, 240, 'Fireworks'); makeLevel(11, 200, 200, 180, 'Control'); // makeInstructions('[LOVENSE SPECIAL COMMANDS] ----------- Set the below options to the same as in your Lovense control panel. To disable an option, set the price to 0.'); // output.push({name: 'pause_price', label: '[PAUSE THE QUEUE] --- Price', type: 'int', minValue: 0, defaultValue: 0}); // output.push({name: 'pause_time', label: 'Time', type: 'int', minValue: 1, defaultValue: 10}); makeInstructions('[TIP NOTICES] ----------- This messages will appear when a user triggers the Lovense with a tip. {pwr} will be replaced with the power, {sec} with the duration, and {user} with the user who tipped.'); output.push({name: 'response', label: 'Response text', type: 'str', defaultValue: 'Vibrating at {pwr} power for {sec} seconds! (from {user})', required: false}); output.push({name: 'tColor', label: 'Text foreground color', type: 'str', defaultValue: '#DC5500', required: false}); output.push({name: 'tBg', label: 'Text background color', type: 'str', defaultValue: '#FFFF33', required: false}); makeInstructions('[ROTATING NOTICES] ----------- These messages will appear periodically to remind viewers of the lovense settings.'); output.push({name: 'header', label: 'Header', type: 'str', defaultValue: '--- Tip the numbers below to trigger the toy! ---'}); output.push({name: 'freq', label: 'Frequency in seconds (0 = off)', type: 'int', defaultValue: 120}); output.push({name: 'rColor', label: 'Text foreground color', type: 'str', defaultValue: '#DC5500', required: false}); output.push({name: 'rBg', label: 'Text background color', type: 'str', defaultValue: '#FFFF33', required: false}); function makeLevel(num, lo, hi, sec, pow) { output.push({name: 'use' + (num - 1), label: '[LEVEL ' + num + '] --- Enabled', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}); output.push({name: 'min' + (num - 1), label: 'Minimum Tokens', type: 'int', defaultValue: lo, minValue: 1}); output.push({name: 'max' + (num - 1), label: 'Maximum Tokens', type: 'int', defaultValue: hi, minValue: 1}); output.push({name: 'sec' + (num - 1), label: 'Time', type: 'int', defaultValue: sec, minValue: 1}); output.push({name: 'pwr' + (num - 1), label: 'Power', type: 'choice', choice1: 'Low', choice2: 'Medium', choice3: 'High', choice4: 'Ultra', choice5: 'Ultra High', choice6: 'Random', choice7: 'Wave', choice8: 'Pulse', choice9: 'Earthquake', choice10: 'Fireworks', choice11: 'Control', defaultValue: pow}); } function makeInstructions(text) { output.push({name: 'instructions_' + ins_index, label: text, type: 'choice', choice1: '', required: false}); ins_index++; } return output; }(); var freq = $('freq'); var rBg = $('rBg'); var rColor = $('rColor'); var tBg = $('tBg'); var tColor = $('tColor'); var noticeResponse = $('response'); var specMenu = function () { var obj = {}; return obj; }(); var tipMenu = function () { var arr = []; for (var i = 0; i < 12; i++) { if ($('use' + i) === 'Yes') { var obj = { min: $('min' + i), max: $('max' + i), sec: $('sec' + i), pwr: $('pwr' + i, true), txt: $('txt' + i) }; arr.push(obj); } } return arr; }(); var rotatorText = function () { var output = $('header') || '♥♥♥ :lovenseon12 :lovensein :lush_lush ♥♥♥'; for (var i = 0; i < tipMenu.length; i++) { var item = tipMenu[i]; output += '\n[' + item.min + ' to ' + item.max + ' tokens] = '; if (item.txt && item.txt.trim().length > 0) { output += item.txt; } else { output += item.sec + ' seconds (' + item.pwr + ')'; } } return output; }(); /********** ------------ TIPS ------------ **********/ cb.onTip(function (tip) { react(tip); }); function react(tip) { cb.log('Reacting to ' + tip.amount + ' (' + tipMenu.length + ')'); for (var i = 0; i < tipMenu.length; i++) { var item = tipMenu[i]; if (tip.amount >= item.min && tip.amount <= item.max) { var notice = noticeResponse.replace(/\{pwr\}/g, item.pwr).replace(/\{sec\}/g, item.sec).replace(/\{user}/g, tip.from_user); say(notice, '', tColor, tBg); break; } } } /********** ------------ COMMUNICATION ------------ **********/ //send a message to the user function say(text, user, color, bg) { cb.sendNotice(newLines(text), user, bg, color, 'bold', ''); } /********** ------------ MISC ------------ **********/ function $ (str, uc) { var setting = cb.settings[str]; if (typeof setting === 'string') { if (uc) setting = setting.toUpperCase(); setting = setting.trim(); if (setting.length > 0) return setting; } else { if (setting) return setting; } } function newLines(input) { return '\u25A0 ' + input.replace(new RegExp('\n', 'g'), '\n\u25A0 '); } /********** ------------ EXECUTE ------------ **********/ if (freq && freq > 0) { (function rotate() { say(rotatorText, '', rColor, rBg); cb.setTimeout(rotate, freq * 1000); })(); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.