Bots Home
|
Create an App
fish1
Author:
silverfish
Description
Source Code
Launch Bot
Current Users
Created by:
Silverfish
// ******************************************** // EXPORT SETTINGS // ******************************************** cb.settings_choices = [ { name: 'tipclue1', type: 'int', minValue: 1, defaultValue: 10, label: "clue tip 1" }, { name: 'tipclue2', type: 'int', minValue: 20, defaultValue: 30, label: "clue tip 2" }, { name: 'tipclue3', type: 'int', minValue: 30, defaultValue: 40, label: "clue tip 3" }, { name: 'tipclue4', type: 'int', minValue: 40, defaultValue: 50, label: "clue tip 4" }, { name: 'tipanswer', type: 'int', minValue: 1, defaultValue: 100, label: "answer tip" }, { name: 'linkclue1', type: 'str', defaultValue: 'link1.com', label: "Clue 1 Link" }, { name: 'linkclue2', type: 'str', defaultValue: 'link2.com', label: "Clue 2 Link" }, { name: 'linkclue3', type: 'str', defaultValue: 'link3.com', label: "Clue 3 Link" }, { name: 'linkclue4', type: 'str', defaultValue: 'link4.com', label: "Clue 4 Link" }, { name: 'linkanswer', type: 'str', defaultValue: 'link5.com', label: "Answer Link" } ]; // ******************************************** // EVENTS // ******************************************** cb.onTip(function(tip) { var tip_amount = tip['amount']; var tip_sender = tip['from_user']; var clue_tips = [ cb.settings.tipclue1, cb.settings.tipclue2, cb.settings.tipclue3, cb.settings.tipclue4, cb.settings.tipanswer ]; var clue_links = [ cb.settings.linkclue1, cb.settings.linkclue2, cb.settings.linkclue3, cb.settings.linkclue4, cb.settings.linkanswer ]; var clue_success = false; for(var i = 0; i < clue_tips.length; i++) { if(tip_amount === clue_tips[i]) { msg_private('You tipped for clue #' + (i+1) + '! Your link is:' + clue_links[i], tip_sender); clue_success = true; } } msg_public("Tip received: " + tip_amount); if(clue_success) msg_public("Clue Alert! " + tip_sender + " Got The Clue !"); }); // ******************************************** // CHATROOM // ******************************************** var COLOR = { NOTICE : '#6900CC', HIGHLIGHT : '#EEE5FF', INFO : '#144D8C', }; function msg_private(msg,user) { cb.sendNotice(msg,user,COLOR.HIGHLIGHT,COLOR.NOTICE,'bold'); } function msg_public(msg) { cb.sendNotice(msg,'',COLOR.HIGHLIGHT,COLOR.NOTICE,'bold'); } init = function() { msg_private("ClueBot started - you are bot owner", cb.room_slug); msg_public("ClueBot says hi all!"); }; init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.