Bots Home
|
Create an App
FG-RaMBot
Author:
testing1010
Description
Source Code
Launch Bot
Current Users
Created by:
Testing1010
const tipMenus = [ { title: 'Team Rick', items: [ {name: 'Vote Team Bush', value: 18}, {name: 'Booty', value: 45}, {name: 'Asshole Flash', value: 75}, {name: 'Ice Play', value: 100}, {name: 'Nipple Clamps', value: 142}, {name: 'Be A Perv', value: 345}, {name: 'Buy Me A Drink', value: 666}, {name: 'Cum Deny', value: 1001}, {name: 'All Day Buttplug', value: 11370} ] }, { title: 'Team Morty', items: [ {name: 'Vote Team Bare', value: 16}, {name: 'Boobs', value: 25}, {name: 'Pussy Flash', value: 60}, {name: 'Dildo Sucking', value: 88}, {name: 'Dance', value: 123}, {name: 'Make Me Smile', value: 321}, {name: 'Handwritten Letter', value: 777}, {name: 'Cum Grant', value: 1000}, {name: 'Date Night', value: 11320} ] } ] cb.settings_choices = [ {name: 'game_state', type: 'str', defaultValue: '{}'}, {name: 'memo', type: 'str', required: true} ] const state = { teamRickMembers: [], teamMortyMembers: [], teamBushVotes: 0, teamBareVotes: 0 } const memo = cb.settings.memo if(cb.settings.game_state){ let parsed = JSON.parse(cb.settings.game_state); for(let i in parsed){ if(parsed.hasOwnProperty(i)) state[i] = parsed[i] } } sendMemo(); cb.onTip((tip) => { switch(tip.amount){ case 1137: addToTeam('rick', tip.from_user); // removeFromTeam('morty', tip.from_user); break; case 1132: addToTeam('morty', tip.from_user); // removeFromTeam('rick', tip.from_user); break; case 16: case 37: teamVote('bare', tip.from_user, 1, tip.amount); break; case 18: case 32: teamVote('bush', tip.from_user, 1, tip.amount); break; default: reward(tip.from_user, tip.amount); break; } return tip; }) cb.onMessage((msg) => { let idx1 = state.teamRickMembers.indexOf(msg.user); let idx2 = state.teamMortyMembers.indexOf(msg.user); if(msg.user === cb.room_slug){ switch(msg.m){ case '/save': saveState(); msg['X-Spam'] = true; break; default: break; } } switch(msg.m){ case '/tipmenu': showTipMenu(msg.user); msg['X-Spam'] = true; break; case '/scores': showScores(msg.user); msg['X-Spam'] = true; break; default: break; } let text = '' if(idx1 !== -1){ text += '[Team Rick]'; } if(idx2 !== -1){ text += '[Team Morty]'; } msg.m = text + ' ' + msg.m; return msg; }) function reward(user, amt){ let idx1 = state.teamRickMembers.indexOf(user); let idx2 = state.teamMortyMembers.indexOf(user); let itemsRick = [] let itemsMorty = [] if(idx1 !== -1){ itemsRick = tipMenus[0].items; } if(idx2 !== -1){ itemsMorty = tipMenus[1].items; } for(let i in itemsRick){ if(itemsRick[i].value === amt){ cb.sendNotice(user + ' tipped for ' + itemsRick[i].name + ' for Team Rick!', '', '', '#FF0000', 'bold'); break; } } for(let i in itemsMorty) { if(itemsMorty[i].value === amt){ cb.sendNotice(user + ' tipped for ' + itemsMortys[i].name + ' for Team Morty!', '', '', '#FF0000', 'bold'); break; } } } function teamVote(team, user, amt, tip){ let idx1 = state.teamRickMembers.indexOf(user); let idx2 = state.teamMortyMembers.indexOf(user); if((tip === 16 && idx2 === -1) || (tip === 18 && idx1 === -1)){ return; } cb.log(tip + ': ' + idx1 + ' - ' + idx2); amt = amt || 1; switch(team){ case 'bush': state.teamBushVotes += amt; cb.sendNotice(user + ' just added ' + amt + ' votes for Team Bush! Total Votes: ' + state.teamBushVotes, '', '', '#FF0000', 'bold'); break; case 'bare': state.teamBareVotes += amt; cb.sendNotice(user + ' just added ' + amt + ' votes for Team Bare! Total Votes: ' + state.teamBareVotes, '', '', '#FF0000', 'bold'); break; } } function addToTeam(team, user){ let idx1 = state.teamRickMembers.indexOf(user); let idx2 = state.teamMortyMembers.indexOf(user); if(team === 'rick'){ if(idx1 === -1){ state.teamRickMembers.push(user); } cb.sendNotice(user + ' joined team Rick! Wubba lubba dubb dubb!', '', '', '', 'bold'); teamVote('bush', user, 100); } else if(team === 'morty'){ if(idx2 === -1){ state.teamMortyMembers.push(user); } cb.sendNotice(user + ' joined team Morty! Oh geez guys!', '', '', '', 'bold'); teamVote('bare', user, 100); } } function removeFromTeam(team, user){ let idx1 = state.teamRickMembers.indexOf(user); let idx2 = state.teamMortyMembers.indexOf(user); if(team === 'rick' && idx1 !== -1){ state.teamRickMembers.splice(idx1, 1); cb.sendNotice(user + ' left team Rick', '', '', '', 'bold'); } else if(team === 'morty' && idx2 !== -1){ state.teamMortyMembers.splice(idx2, 1); cb.sendNotice(user + ' left team Morty!', '', '', '', 'bold'); } } function showTipMenu(user){ let idx1 = state.teamRickMembers.indexOf(user); let idx2 = state.teamMortyMembers.indexOf(user); if(idx1 === -1 && idx2 === -1){ cb.sendNotice('You\'re not yet on a team. Join Team Rick by tipping 1137 or Team Morty by tipping 1132', user, '', '', 'bold'); return; } let str = 'Tip Menus:\n'; if(idx1 !== -1){ str += 'Team Rick Menu:\n' for(let i in tipMenus[0].items){ str += tipMenus[0].items[i].name + ': ' + tipMenus[0].items[i].value + '\n'; } str += '\n'; } if(idx2 !== -1){ str += 'Team Morty Menu:\n' for(let i in tipMenus[1].items){ str += tipMenus[1].items[i].name + ': ' + tipMenus[1].items[i].value + '\n'; } str += '\n'; } cb.sendNotice(str, user, '', '', 'bold'); } function saveState(){ cb.sendNotice(JSON.stringify(state), cb.room_slug); } function showScores(user){ let str = 'Current Scores:\n'; str += 'Team Rick Members: ' + state.teamRickMembers.length + '\n'; str += 'Team Morty Members: ' + state.teamMortyMembers.length + '\n'; str += 'Votes for Team Bush: ' + state.teamBushVotes + '\n'; str += 'Votes for Team Bare: ' + state.teamBareVotes + '\n'; if(user === cb.room_slug){ cb.sendNotice(str, '', '', '', 'bold'); } else { cb.sendNotice(str, user, '', '', 'bold'); } } function sendMemo(){ cb.sendNotice(memo, '', '', '#FF0000', 'bold'); setTimeout(() => { sendMemo(); }, 15 * 60 * 60 * 1000); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.