Bots Home
|
Create an App
some bot
Author:
joedoe
Description
Source Code
Launch Bot
Current Users
Created by:
Joedoe
/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "sortBasicLevels": () => (/* binding */ sortBasicLevels), /* harmony export */ "formatLevels": () => (/* binding */ formatLevels), /* harmony export */ "Bot": () => (/* binding */ Bot) /* harmony export */ }); /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _levels__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i]; return to; }; function sortBasicLevels(levels) { return __spreadArray([], levels).sort(function (x, y) { return x.tokens.from > y.tokens.from ? 1 : -1; }); } function formatLevels(levels, special) { var output = sortBasicLevels(levels).map(function (x, n) { return x.format(n + 1); }); output.unshift('===== My Lovense Lush Levels ====='); output.unshift(':lovense130'); output.push('====== Special Commands ======='); Object.values(special).forEach(function (command) { return command ? output.push(command.format()) : null; }); return output.join('\n'); } var Bot = /** @class */ (function () { function Bot() { this.basicLevels = {}; this.specialCommands = {}; } Bot.prototype.onStart = function (_) { }; Bot.prototype.parseLevels = function (m) { if (m === '--------Lovense Toys respond to tips. Here are my levels:' || m == '--------Special Commands:') { return true; } var level = _levels__WEBPACK_IMPORTED_MODULE_1__.BasicLevel.parse(m); if (level) { this.basicLevels[JSON.stringify(level)] = level; // api.sendNotice({ message: `registered ${JSON.stringify(level)}`}); return true; } var pattern = _levels__WEBPACK_IMPORTED_MODULE_1__.PatternCommand.parse(m); if (pattern) { this.specialCommands[pattern.pattern] = pattern; // api.sendNotice({ message: `registered ${JSON.stringify(pattern)}`}); return true; } var random = _levels__WEBPACK_IMPORTED_MODULE_1__.RandomLevelCommand.parse(m); if (random) { this.specialCommands.random = random; // api.sendNotice({ message: `registered ${JSON.stringify(random)}`}); return true; } var pause = _levels__WEBPACK_IMPORTED_MODULE_1__.PauseCommand.parse(m); if (pause) { this.specialCommands.pause = pause; // api.sendNotice({ message: `registered ${JSON.stringify(pause)}`}); return true; } var clear = _levels__WEBPACK_IMPORTED_MODULE_1__.ClearCommand.parse(m); if (clear) { this.specialCommands.clear = clear; // api.sendNotice({ message: `registered ${JSON.stringify(clear)}`}); return true; } return false; }; Bot.prototype.onEnter = function (user) { _api__WEBPACK_IMPORTED_MODULE_0__.sendNotice({ message: formatLevels(Object.values(this.basicLevels), this.specialCommands), to_user: user.user, foreground: '#9C2868', background: '#FFF0DE', // weight: 'bold', }); }; Bot.prototype.onLeave = function (_user) { }; Bot.prototype.onTip = function (_tip) { }; Bot.prototype.onMessage = function (message) { if (message.user === cb.room_slug) { if (this.parseLevels(message.m)) { message['X-Spam'] = true; message.m = '\u2705'; } if (message.m.trim() == '/levels') { message.m = '\u2705'; _api__WEBPACK_IMPORTED_MODULE_0__.sendNotice({ message: formatLevels(Object.values(this.basicLevels), this.specialCommands), foreground: '#9C2868', background: '#FFF0DE', // weight: 'bold', }); } } return message; }; return Bot; }()); /***/ }), /* 2 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "sendNotice": () => (/* binding */ sendNotice) /* harmony export */ }); function sendNotice(notice) { cb.sendNotice(notice.message, notice.to_user, notice.background, notice.foreground, notice.weight, notice.to_group); } /***/ }), /* 3 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "BasicLevel": () => (/* binding */ BasicLevel), /* harmony export */ "PatternCommand": () => (/* binding */ PatternCommand), /* harmony export */ "RandomLevelCommand": () => (/* binding */ RandomLevelCommand), /* harmony export */ "ClearCommand": () => (/* binding */ ClearCommand), /* harmony export */ "PauseCommand": () => (/* binding */ PauseCommand) /* harmony export */ }); var BasicLevel = /** @class */ (function () { function BasicLevel(toy, tokens, duration, vibration) { this.toy = toy; this.tokens = tokens; this.duration = duration; this.vibration = vibration; } ; BasicLevel.prototype.formatTokens = function () { var tokens = this.tokens; return tokens.to ? tokens.from + "-" + tokens.to : tokens.from + "+"; }; BasicLevel.prototype.format = function (n) { return ":llvlc" + n + " Tip " + this.formatTokens() + " " + this.vibration.toUpperCase() + " :lushsm " + this.duration + " seconds"; }; BasicLevel.parse = function (m) { var match = m.replace(/\s/g, "").match(this.regex); if (match === null || match === void 0 ? void 0 : match.groups) { var groups = match.groups; var tokens = groups.from_ ? { from: Number(groups.from_) } : { from: Number(groups.from), to: Number(groups.to) }; var vibration = groups.vibration.toLowerCase(); if (vibration == 'ultrahigh') { vibration = 'ultra high'; } return new BasicLevel(groups.toy.split(',').map(function (x) { return x.toLowerCase(); }), tokens, Number(groups.duration), vibration); } else { return null; } }; BasicLevel.regex = /^--------\[((?<from>\d+)to(?<to>\d+)|\u2265(?<from_>\d+))tokens](?<toy>\S+)=(?<duration>\d+)SEC(ONDS)?\((?<vibration>Low|Medium|High|Ultrahigh)Vibrations\)$/; return BasicLevel; }()); var PatternCommand = /** @class */ (function () { function PatternCommand(tokens, pattern, duration) { this.tokens = tokens; this.pattern = pattern; this.duration = duration; } PatternCommand.prototype.format = function () { return PatternCommand.icon[this.pattern] + " " + this.pattern.toUpperCase() + " Pattern " + this.duration + " seconds :lushsm " + this.tokens + " Tokens"; }; PatternCommand.parse = function (m) { var match = m.trim().match(this.regex); if (match === null || match === void 0 ? void 0 : match.groups) { var groups = match.groups; return new PatternCommand(Number(groups.tokens), groups.pattern.toLowerCase(), Number(groups.duration)); } else { return null; } }; PatternCommand.icon = { earthquake: ':lslvl4', fireworks: ':lslvl5', wave: ':lslvl3', pulse: ':lslvl2', }; PatternCommand.regex = /^--------\[(?<tokens>\d+) Tokens] = (?<pattern>Earthquake|Fireworks|Wave|Pulse) pattern - (?<duration>\d+) sec$/; return PatternCommand; }()); var RandomLevelCommand = /** @class */ (function () { function RandomLevelCommand(tokens, level) { this.tokens = tokens; this.level = level; } RandomLevelCommand.prototype.format = function () { return ":lslvl1 RANDOM Level between :llvlc" + this.level.from + " and :llvlc" + this.level.to + " :lushsm " + this.tokens + " Tokens"; }; RandomLevelCommand.parse = function (m) { var match = m.trim().match(this.regex); if (match === null || match === void 0 ? void 0 : match.groups) { var groups = match.groups; return new RandomLevelCommand(Number(groups.tokens), { from: Number(groups.from), to: Number(groups.to), }); } else { return null; } }; RandomLevelCommand.regex = /^--------\[(?<tokens>\d+) Tokens] = Randomly choose a level between (?<from>\d+)-(?<to>\d+)$/; return RandomLevelCommand; }()); var ClearCommand = /** @class */ (function () { function ClearCommand(tokens) { this.tokens = tokens; } ClearCommand.prototype.format = function () { return ":lslvl8 CLEAR THE QUEUE (will remove all pending tips) :lushsm " + this.tokens + " Tokens"; }; ClearCommand.parse = function (m) { var match = m.trim().match(this.regex); if (match === null || match === void 0 ? void 0 : match.groups) { var groups = match.groups; return new ClearCommand(Number(groups.tokens)); } else { return null; } }; ClearCommand.regex = /^--------\[(?<tokens>\d+) Tokens] = CLEAR THE QUEUE \(will remove all pending tips\)$/; return ClearCommand; }()); var PauseCommand = /** @class */ (function () { function PauseCommand(tokens, duration) { this.tokens = tokens; this.duration = duration; } PauseCommand.prototype.format = function () { return ":lslvl7 PAUSE THE QUEUE for " + this.duration + " seconds :lushsm " + this.tokens + " Tokens"; }; PauseCommand.parse = function (m) { var match = m.trim().match(this.regex); if (match === null || match === void 0 ? void 0 : match.groups) { var groups = match.groups; return new PauseCommand(Number(groups.tokens), Number(groups.duration)); } else { return null; } }; PauseCommand.regex = /^--------\[(?<tokens>\d+) Tokens] = PAUSE THE QUEUE FOR (?<duration>\d+) SEC(ONDS)?$/; return PauseCommand; }()); /***/ }) /******/ ]); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { __webpack_require__.r(__webpack_exports__); /* harmony import */ var _bot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); cb.settings_choices = [ // {name: "tips", type: "str", defaultValue: "{}", required: false}, // {name: "privileged", type: "str", defaultValue: "", required: false}, ]; var bot = __webpack_require__.g.bot = new _bot__WEBPACK_IMPORTED_MODULE_0__.Bot(); cb.onStart(bot.onStart.bind(bot)); cb.onEnter(bot.onEnter.bind(bot)); cb.onLeave(bot.onLeave.bind(bot)); cb.onMessage(bot.onMessage.bind(bot)); cb.onTip(bot.onTip.bind(bot)); })(); /******/ })() ;
© Copyright Chaturbate 2011- 2025. All Rights Reserved.