Bots Home
|
Create an App
tracytest2
Author:
girl_viewertestbed
Description
Source Code
Launch Bot
Current Users
Created by:
Girl_Viewertestbed
/* Tip Menu Deluxe by MentalCex (the Orgasm Control Wizard) Tested: 100% fully functional Change Log: v1.3.7.5 + Removed dependency on timer (Thank you Adele Taylor) --If timer left blank, bot will only advertise on load --However, /tipmenu and topic change remain functional v1.3.7 + Auto "Thank You" message for tips (All tips or Specific tips - with Custom Messages, including :gifs) --Leave blank what you will not use. Intelligent error handling --Use [tipper] for tipper's chat name EG: "[tipper], Tipped for PM!" --Set to Yes, bot will say thanks for all tip amounts ----User enters message. If blank, bot will default to "Thanks for the tip, [tipper]!" ----If a specific/custom message exists, bot will send this message over global/default messages --Set to NO, bot will say thanks only for specific tip amounts ----If specific/custom messages are blank, bot will say nothing v1.3.5 + Added "unadvertised" feature. type: /tipmenu v1.3 + Option to set custom item separator (can be anything, including :gifs) --If left blank, bot defaults to "|" EG: Item1 | Item2 | Item3 v1.2 + Code optimization/improvement v1 + Dynamically generated code (default is a 20 item tip menu) -- Change MaxValue to any number to dynamically reduce/expand the bot's capabilities -- EG: 4 will give the user 4 possible tip menu items, where 38 will give 38, etc + Basic error checking --The bot will ignore any item missing either a description or an amount (both must be entered) --No value less than 1 is allowed + Options to change tip menu foreground/background colors + Option to set tip menu delay (in minutes) + Option to change room topic + Fixed bugs copied from the work of others --Seems like a bunch of variants of this bot were copied from the same source --1. item(value) instead of item (value) --2. trailing separator character EG: Item 1 (value) | item 2 (value) | **************************************************************** DM me on Twitter with issues: @CexMental */ // max user interface length variable var MaxValue = 20; cb.settings_choices = []; // build user interface functionality settings cb.settings_choices.push({"name": "ColorFG", "type": "str", "required": false, "minLength": 0, "maxLength": 7, "defaultValue": "#FF0000", "label": "Text Highlight Color"} , {"name": "ColorBG", "type": "str", "required": false, "minLength": 0, "maxLength": 7, "defaultValue": "", "label": "Text Background Color"} , {"name": "ChrSeperator", "type": "str", "required": false, "minLength": 0, "maxLength": 20, "defaultValue": "|", "label": "Separating Character"} , {"name": "AdvertDelay", "type": "int", "required": false, "minValue": "", "defaultValue": "", "label": "Advertisement delay (minutes)"} , {"name": "ThankAll", "type": "choice", "choice1": "Yes", "choice2": "No", "defaultValue": "No", "label": "Say Thanks for Every Tip"} , {"name": "msgThankAll", "type": "str", "required": false, "minLength": 0, "maxLength": 128, "defaultValue": "", "label": "Thank You Message for Every Tip"} , {"name": "ChangeTopic", "type": "choice", "choice1": "Yes", "choice2": "No", "defaultValue": "No", "label": "Change Topic"}); // build dynamic interface based on MaxValue for(var i = 1; i <= MaxValue; i ++) { cb.settings_choices.push({"name": "tipitem" + i, "type": "str", "required": false, "minLength": 0, "maxLength": 50, "defaultValue": "", "label": "Menu Item " + i} , {"name": "tipamount" + i, "type": "int", "required": false, "minValue": 1, "defaultValue": "", "label": "Costs"} , {"name": "tipmsg" + i, "type": "str", "required": false, "minLength": 0, "maxLength": 128, "defaultValue": "", "label": "Thank You Message"}); } // close build dynamic interface FOR // global to function string holding variables var msgTipMenu; // populate itemSeperator variable var itemSeperator = cb.settings['ChrSeperator']; if (itemSeperator == "") { itemSeperator = '|'; } // build dynamic tip menu string for (n = 1; n <= MaxValue; n++) { // basic error checking var cbTip = parseInt(cb.settings['tipamount' + n]); var cbMsg = cb.settings['tipitem' + n]; if (cbTip > 0 && cbMsg.length > 0) { if (n == 1) { msgTipMenu = 'Tip Menu: '; } // silent mode if (n >= 2) { msgTipMenu += ' ' + itemSeperator.trim() + ' '; } msgTipMenu += cbMsg + ' (' + cbTip + ') '; } } // close build dynamic tip menu string FOR // change topic based on user settings if (cb.settings['ChangeTopic'] == 'Yes') { cb.changeRoomSubject(msgTipMenu); } function advertise() { // send chat notice cb.sendNotice(msgTipMenu, '', cb.settings['ColorBG'], cb.settings['ColorFG'], 'bold'); // call advertise function again based on user settings cb.setTimeout(advertise, (cb.settings['AdvertDelay'] * 60000)); } // call function to advertise 1st time cb.setTimeout(advertise, (1 * 1000)); // onMessage advertise the tip menu function onMessageHandler(msg) { if (msg['m'] == '/tipmenu') { cb.sendNotice(msgTipMenu, '', cb.settings['ColorBG'], cb.settings['ColorFG'], 'bold'); } } // Ontip send thanks cb.onTip(function(tip) { // value initialization var msgPublic = ""; // build specific public chat thank you message output string for (var x = 1; x <= MaxValue; x++) { if (parseInt(tip['amount']) == parseInt(cb.settings['tipamount' + x])) { var hTipItem = cb.settings['tipitem' + x]; var hTipMsg = cb.settings['tipmsg' + x]; if ((hTipItem.length = 0) || (hTipMsg.length = 0)) { msgPublic = "" } else { msgPublic = cb.settings['tipmsg' + x]; } } } if (cb.settings['ThankAll'] == "No") { // basic error checking if (msgPublic.length > 0) { msgPublic = msgPublic.replace("[tipper]", tip['from_user']); // post public chat message cb.sendNotice(msgPublic, '', cb.settings['ColorBG'], cb.settings['ColorFG'], 'bold'); } // close basic error checking IF } else { var msgThankAllHolder = cb.settings['msgThankAll']; var msgTAHTrim = msgThankAllHolder.trim(); var msgDefault = "Thanks for the tip, [tipper]!"; if (msgTAHTrim.length <= 0) { if (msgPublic.length <= 0) { msgPublic = msgDefault; } } else { if (msgPublic.length <= 0) { msgPublic = msgTAHTrim; } } // basic error checking if (msgPublic.length > 0) { msgPublic = msgPublic.replace("[tipper]", tip['from_user']); // post public chat message cb.sendNotice(msgPublic, '', cb.settings['ColorBG'], cb.settings['ColorFG'], 'bold'); } // close basic error checking IF } }); function init() { // call onMessage cb.onMessage(onMessageHandler); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.