Bots Home
|
Create an App
tjdaku
Author:
wanwan
Description
Source Code
Launch Bot
Current Users
Created by:
Wanwan
// June's Loot Boxes Notifier var nl = '\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501'; var COMMAND_PRIZES = '!p'; var queue = []; var noticeColorIndex = 0; var noticeColors = ["#25258e", "#006666"]; var advert_delay = 5; cb.settings_choices = [{ name: 'tipAmount', type: 'int', minValue: 1, defaultValue: 88, label: "Tokens to play" }, { name: 'advert_delay', type: 'int', minValue: 1, defaultValue: 5, label: "Delay between June Loot Box Bot information announcments", required: true }, { name: 'goal', type: 'int', minValue: 0, defaultValue: 0, label: "Tip goal (optional)", required: false }, { name: 'goal_description', type: 'str', minLength: 0, maxLength: 255, label: 'Goal Description (optional)', required: false }, { name: 't1', type: 'str', minLength: 1, maxLength: 255, label: 'Tier 1 Prizes', required: false },{ name: 't2', type: 'str', minLength: 1, maxLength: 255, label: 'Tier 2 Prizes', required: false },{ name: 't3', type: 'str', minLength: 1, maxLength: 255, label: 'Tier 3 Prizes', required: false },{ name: 't4', type: 'str', minLength: 1, maxLength: 255, label: 'Tier 4 Prizes', required: false }]; var tier_prizes = []; cb.onMessage(function(msg) { if (msg['m'].indexOf(COMMAND_PRIZES) > -1) { if(canUseModCmds(msg)) { drawPrizes(msg, true) } else { drawPrizes(msg, false) } } else if(msg['m'].startsWith("/jw ")) { if(canUseModCmds(msg)) { msg['X-Spam'] = true; var tmp = msg['m'].substring(4); // tmp = tmp.replace(/,\s/g, ","); tier_prizes = tmp.split("||") } } else if(msg['m'].toLowerCase().includes("rigged")) { riggedName = msg['user']; cb.setTimeout(riggedMessage, 50) } return msg }); var riggedName = ""; function riggedMessage() { cb.chatNotice('Shut up, ' + riggedName + ". It's not rigged, you just suck.", '', '', '', 'bold'); } function drawPrizes(msg, mod) { var out = ""; out += 'Player prize list:\n'; for (var j = 0; j < tier_prizes.length; j++) { out += "Tier " + (j+1) + ": " + tier_prizes[j]; out += "\n"; } out += nl; cb.chatNotice(out, msg['user'], '', ''); // cb.chatNotice(out) } function canUseCmds(msg) { if (msg['user'] == cb.room_slug || msg['is_mod'] || msg['has_tokens']) { return true } return false } function canUseModCmds(msg) { if (msg['user'] == cb.room_slug || msg['is_mod']) { return true } return false } function updateSubject() { cb.changeRoomSubject("June\'s Loot Boxes are now available! Tip " + cb.settings.tipAmount + " to play. Type !p to see the prizes. " + getSubject()) } function getSubject() { var subject = ''; subject += 'Tip ' + cb.settings.tipAmount + ' to play!'; if (cb.settings.goal_description && cb.settings.goal_description != '') { subject += ' Goal is [' + cb.settings.goal_description + ']' } return subject } // function getRules() { // var rules = 'GAME RULES\n' + nl + '\nTip ' + cb.settings.tipAmount + ' to spin the wheel.\n' + '- If a game is already running, you can still tip to queue up.\n'; // rules += nl; // return rules // } function formatName(val, length) { if (val === null) { return "--" } else { return val.substring(0, length) } } function advert() { cb.chatNotice("June\'s Loot Boxes are now available! Tip " + cb.settings.tipAmount + " to play. Type !p to see the prizes. " + getSubject(), '', '', '', 'bold'); cb.setTimeout(advert, (parseInt(cb.settings['advert_delay']) * 60000)) } function init() { try { var arr =[cb.settings.t1, cb.settings.t2, cb.settings.t3, cb.settings.t4]; tier_prizes = arr; } catch(e) { } //updateSubject(); cb.chatNotice("June\'s Loot Boxes are now available! Tip " + cb.settings.tipAmount + " to play. Type !p to see the prizes. " + getSubject()); cb.setTimeout(advert, (parseInt(cb.settings['advert_delay']) * 60000)) } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.