Bots Home
|
Create an App
LoveX
Author:
codeanon_master
Description
Source Code
Launch Bot
Current Users
Created by:
Codeanon_Master
cb.settings_choices = function () { var output = []; var ins_index = 0; makeInstructions('[MULTI-GOAL] ----------- Set the number of tokens per goal, and the actions that will be performed when a milestone (the specified number of goals) is reached.'); output.push({name: 'goal_amt', label: 'Tokens per goal', type: 'int', defaultValue: 40}); output.push({name: 'milestones', label: 'Milestones', type: 'str', defaultValue: '25: shirtless, 50: topless, 75: naked, 100: cum show'}); makeInstructions('[LOVENSE SETTINGS] ----------- Set the below options to the same as in your Lovense control panel.'); makeLevel(1, 1, 14, 7, 'Low'); makeLevel(2, 15, 74, 7, 'Medium'); makeLevel(3, 75, 199, 15, 'High'); makeLevel(4, 200, 499, 20, 'Ultra High'); makeLevel(5, 500, 99999, 30, 'Ultra High'); makeInstructions('[TIP NOTICES] ----------- This messages will appear when a user triggers the Lovense with a tip. The text in curly braces will be replaced with the power, duration, and 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 High', 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 = {}; //TODO return obj; }(); var tipMenu = function () { var arr = []; for (var i = 0; i < 5; i++) { if ($('use' + i) === 'Yes') { var obj = { min: $('min' + i), max: $('max' + i), sec: $('sec' + i), pwr: $('pwr' + i, true) }; arr.push(obj); } } return arr; }(); var rotatorText = function () { var output = $('header') || '--- Tip the numbers below to trigger the toy! ---'; for (var i = 0; i < tipMenu.length; i++) { var item = tipMenu[i]; output += '\n[' + item.min + ' to ' + item.max + ' tokens] = ' + item.sec + ' seconds (' + item.pwr + ' vibrations)'; } 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.