Bots Home
|
Create an App
anadice
Author:
analiestar
Description
Source Code
Launch Bot
Current Users
Created by:
Analiestar
/* * App: anadice * Author: analiestar * Date: 30-04/2020 * Version: 1.0.2 * Description: Yet another dice roller * Commands: /prizes */ cb.settings_choices=[ { name: 'price_roll', type: 'int', label: 'Dice roll price', defaultValue: 49, required: true }, { name: 'price_2', type: 'str', label: 'Price Roll #2', defaultValue: 'socks', required: true }, { name: 'price_3', type: 'str', label: 'Price Roll #3', defaultValue: 'feet', required: true }, { name: 'price_4', type: 'str', label: 'Price Roll #4', defaultValue: 'dick', required: true }, { name: 'price_5', type: 'str', label: 'Price Roll #5', defaultValue: 'tits', required: true }, { name: 'price_6', type: 'str', label: 'Price Roll #6', defaultValue: 'butt', required: true }, { name: 'price_7', type: 'str', label: 'Price Roll #7', defaultValue: 'hole', required: true }, { name: 'price_8', type: 'str', label: 'Price Roll #8', defaultValue: 'video', required: true }, { name: 'price_9', type: 'str', label: 'Price Roll #9', defaultValue: 'kiss', required: true }, { name: 'price_10', type: 'str', label: 'Price Roll #10', defaultValue: 'aheago', required: true }, { name: 'price_11', type: 'str', label: 'Price Roll #11', defaultValue: 'anal', required: true }, { name: 'price_12', type: 'str', label: 'Price Roll #12', defaultValue: 'sucking', required: true }, ]; var prizes=[] prizes.push(cb.settings.price_2); prizes.push(cb.settings.price_3); prizes.push(cb.settings.price_4); prizes.push(cb.settings.price_5); prizes.push(cb.settings.price_6); prizes.push(cb.settings.price_7); prizes.push(cb.settings.price_8); prizes.push(cb.settings.price_9); prizes.push(cb.settings.price_10); prizes.push(cb.settings.price_11); prizes.push(cb.settings.price_12); var dice1,dice2,dicetotal; var diceprice=cb.settings.price_roll; var notices; var rndMinMax=function(min,max) { return Math.floor(Math.random()*(max-min+1)+min); } function rolldice(user) { dice1=rndMinMax(1,6); dice2=rndMinMax(1,6); dicetotal=dice1+dice2; notices=""; notices+=user+" rolled "+":anadice"+dice1+" :anadice"+dice2+"\n"; notices+="Prize: "+prizes[dicetotal-2]; cb.sendNotice(notices,'','#34B92D','#DEDB69','bold'); } var cbT; function announcedice() { cb.cancelTimeout(cbT); notices=""; notices+="To roll the dice tip "+diceprice+", "+(diceprice*2)+" or "+(diceprice*3)+" tokens!\n"; notices+="List all prizes with command /prizes"; cb.sendNotice(notices,'','#34B92D','#DEDB69','bold'); cbT=cb.setTimeout(announcedice,1000*(60*7)); } cb.onTip(function(tip) { var user=tip['from_user']; var tip=parseInt(tip['amount']); if(tip==diceprice) { rolldice(user); } else if(tip==(diceprice*2)) { rolldice(user); rolldice(user); } else if(tip==(diceprice*3)) { rolldice(user); rolldice(user); rolldice(user); } }); cb.onMessage(function(msg) { if(msg['m'].match(/\/prizes/i)) { msg['X-Spam']=true; notices=""; notices+="Anadice prizes - Tip "+diceprice+", "+(diceprice*2)+" or "+(diceprice*3)+" tokens!\n"; for(var i=0;i<prizes.length;i++) { notices+="Prize Roll "+(i+2)+": "+prizes[i]+"\n"; } cb.sendNotice(notices,msg['user'],'#34B92D','#DEDB69','bold'); } }); cb.onEnter(function(user) { notices=""; notices+="Anadice bot is running!\n"; notices+="To roll the dice tip "+diceprice+", "+(diceprice*2)+" or "+(diceprice*3)+" tokens!\n"; notices+="List all prizes with command /prizes"; cb.sendNotice(notices,user['user'],'#34B92D','#DEDB69','bold'); }); function init() { notices=""; notices+="Anadice bot has started!\n"; notices+="To roll the dice tip "+diceprice+", "+(diceprice*2)+" or "+(diceprice*3)+" tokens!\n"; notices+="List all prizes with command /prizes"; cb.sendNotice(notices,'','#34B92D','#DEDB69','bold'); cbT=cb.setTimeout(announcedice,1000*(60*7)); } init()
© Copyright Chaturbate 2011- 2025. All Rights Reserved.