Bots Home
|
Create an App
ArtemisSpanksBotMk4
Author:
dark_muad_dib
Description
Source Code
Launch Bot
Current Users
Created by:
Dark_Muad_Dib
cb.settings_choices = [ { name: 'exec', type: 'str', defaultValue: '!', label: 'Commands Prefix' }, { name: 'onmsg', type: 'str', defaultValue: 'Spanks have been enabled', label: 'Spanks On Notice' }, { name: 'offmsg', type: 'str', defaultValue: 'Spanks have been disabled. Total Spanks: spanks', label: 'Spanks Off Notice' }, { name: 'sponmsg', type: 'str', defaultValue: 'A Special Deal on Spanks has Started!! Spanks are Now 1/2 off!! :leiaspanks', label: 'Special Deal Notice' }, { name: 'spoffmsg', type: 'str', defaultValue: 'The Deal on Spanks has Ended! Total Spanks: spanks', label: 'Special Deal Over Notice' }, { name: 'amt', type: 'int', defaultValue: '5', label: 'Spanks Amount' }, { name: 'addtip', type: 'int', defaultValue: '11', label: 'Add Spanks Amount' }, { name: 'addmsg', type: 'str', defaultValue: 'tipper Tipped total to add Spanks Total Spanks: spanks', label: 'Add Spanks Notice' }, { name: 'subtip', type: 'int', defaultValue: '12', label: 'Sub Spanks Amount' }, { name: 'submsg', type: 'str', defaultValue: 'tipper Tipped total to remove Spanks Total Spanks: spanks', label: 'Sub Spanks Msg' }, { name: 'sptip', type: 'int', defaultValue: '5', label: 'Special Spanks Amount' }, { name: 'spmsg', type: 'str', defaultValue: 'tipper Tipped total for AFK Spanks Total Spanks: spanks', label: 'Special Spanks Notice' }, { name: 'color', type: 'str', defaultValue: '#80FFE0', label: 'Default Notice Color' }, { name: 'subcolor', type: 'str', defaultValue: '#e0f2fb #d5edfa #c9e9f8 #bde4f7 #b0dff5 #a2daf4 #93d5f2 #83d0f0 #73cbef #5ec5ed #44c0eb #17bae9 #00b6e8 #0098d8 #0093d0 #008dc9 #0087c1', label: 'Notice Colors for Sub Spanks' }, { name: 'addcolor', type: 'str', defaultValue: '#FFCC80 #FFB74D #FF9800 #FF6E40 #EF5350 #E53935 #D50000 #C62828', label: 'Notice Color for Add Spanks' }, { name: 'inc', type: 'str', defaultValue: '0 25 50 100 150 200 250 300 400 500 600 700 800 900 1000 1500', label: 'Notice Color Increments' }, ] let spanks = 0; let spspanks = 0 let addtotal = 0; let subtotal = 0; let sptotal = 0; let time; let noticecolor; var spankson = true; var spon = false; cb.onMessage(function(msg) { func = msg['m'].substr(1) if (msg['m'].startsWith(cb.settings.exec)) { msg['X-Spam'] = true } else { return msg } if (func == 'spanks') { cb.chatNotice('Total Spanks: ' + spanks, msg['user'], cb.settings.color) } if (func == 'leaderboard') { displayTop(userVotes, 3, "Added", msg['user']); displayTop(userVotes, 3, "Cancelled", msg['user']); displayTop(userVotes, 3, "Special", msg['user']); } if (msg['user'] == cb.room_slug || msg['is_mod']) { activate(func) } }); function activate(func) { if (func == 'spankson') { spankson = true notice(cb.settings.onmsg) } if (func == 'spanksoff') { spankson = false noticemsg = cb.settings.offmsg.replace('spanks', spanks) notice(noticemsg) } if (func == 'afkon') { spon = true notice(cb.settings.sponmsg) } if (func == 'afkoff') { spon = false noticemsg = cb.settings.spoffmsg.replace('spanks', spspanks) notice(noticemsg) spanks += spspanks spspanks = 0 } if (func.startsWith('spanked')) { spanked = func.split(' ')[1] if (!(isNaN(spanked))) { spanks -= spanked notice('Removed: ' + spanked + ' New Total: ' + spanks + ' Spanks') } } if (func.startsWith('addspanks')) { spanked = func.split(' ')[1] if (!(isNaN(spanked))) { spanks += parseInt(spanked) notice('Added: ' + spanked + ' New Total: ' + spanks + ' Spanks') } } if (func.startsWith('timed')) { time = parseInt(func.split(' ')[2]) func = func.split(' ')[1] if (!(isNaN(time))) { timeron = true timer(func) } } if (func == 'total') { notice('Times used: ' + addtotal + ' Add Spanks, ' + subtotal + ' Sub Spanks, ' + sptotal + ' Special Spanks') } if (func == 'Leaderboard') { displayTop(userVotes, 3, "Added", ''); displayTop(userVotes, 3, "Cancelled", ''); displayTop(userVotes, 3, "Special", ''); } } function notice(msg) { cb.chatNotice(msg, '', cb.settings.color) } function timer(func) { time -- if (time > 0) { notice(time + ' Minutes Remaining until ' + func) cb.setTimeout(function() {timer(func)}, 60 * 1000) } else { activate(func) } } cb.onTip(function(tip) { let tipper = tip['from_user'] let total = tip['amount'] if (spankson || spon) { if (spankson) { if (total == cb.settings.addtip) { addtotal ++ addVote(tipper, "Added") spanks += parseInt(cb.settings.amt) tipmessage(cb.settings.addcolor, cb.settings.inc, cb.settings.addmsg, tipper, total) } if (total == cb.settings.subtip) { subtotal ++ addVote(tipper, "Cancelled") spanks -= cb.settings.amt if (spanks < 0) { if (spon) { notice('Please wait for ' + cb.room_slug + ' to end the Special Deal to start deducting spanks.') spanks = 0 } else { spanks = 0 notice('Negative Spanks have been Disabled, Total Set to 0') } } tipmessage(cb.settings.subcolor, cb.settings.inc, cb.settings.submsg, tipper, total) } } if (spon) { if (total == cb.settings.sptip) { sptotal ++ addVote(tipper, "Special") spspanks += parseInt(cb.settings.amt) tipmessage(cb.settings.addcolor, cb.settings.inc, cb.settings.spmsg, tipper, total) } } } }); function tipmessage(colors, str, msg, tipper, total) { colorchange(colors, str) messagefix(msg, tipper, total) cb.chatNotice(tipmsg, '', noticecolor) } function colorchange(colors, str) { color = colors.split(' ') value = (' ') len = color.length for (let i = 0; i < len; i ++) { if (spanks >= value[i]) { noticecolor = color[i] } } } function messagefix(msg, tipper, total) { tipmsg = msg tipmsg = tipmsg.replace('tipper', tipper) tipmsg = tipmsg.replace('total', total) tipmsg = tipmsg.replace('spanks', spanks) } userVotes = { 'dummy.test.object1': { "Added" : 0, "Cancelled": 0, "Special": 0 }, 'dummy.test.object2': { "Added" : 0, "Cancelled": 0, "Special": 0 }, 'dummy.test.obect3': { "Added" : 0, "Cancelled": 0, "Special": 0 }, } function addVote(user, voteType) { if (!(user in userVotes)) { userVotes[user] = { "Added": 0, "Cancelled": 0, "Special": 0 } } userVotes[user][voteType] += 1 } function displayTop(userVotes, num, type, towhom) { cb.chatNotice(type + " Spanks Leaderboard", user, cb.settings.color) var votesArr = [] for (var user in userVotes) { var o = {} o["name"] = user; o["votes"] = userVotes[user][type]; votesArr.push(o) } votesArr.sort(function(a, b) { if (a['votes'] < b['votes']) { return 1; } if (a['votes'] > b['votes']) { return -1 } return 0; }) // Display top votes for (let i=0; i<num; i++) { let name = votesArr[i]['name']; let voteCount = votesArr[i]['votes']; cb.chatNotice(name + ": " + voteCount * cb.settings.amt + ' Spanks', towhom); } } var userEntranceMessages = { "darkse7en81": {"has_entered": false, "msg": "Do we have clearance Clarence? Darkse7en81 is coming in for a unscheduled landing!"}, "lenot35": {"has_entered": false, "msg": "Who started the fire? Because The Hot Gaul Firefighter has shown up to bust us!"}, "dndgf": {"has_entered": false, "msg": "Everyone roll a D20 to make a Will Saving Throw. The Topless Halfing has just failed their Sneak Check."}, "hankw_au2": {"has_entered": false, "msg": "Its Hank the Tank, 24 Frames of Hank ... what? ok. I apologise for the False Announcement its Just Hank!"}, "itssuprmario": {"has_entered": false, "msg": "Its a him Mario, the Mistachiod Maruader of Mischief and Mayhem."}, "perforated_bovine": {"has_entered": false, "msg": "Holy Cow, quickly everyone hide the naughty bits, someone has awoken the mythic bovine from his slumber"} } cb.onEnter(function(user) { var userName = user['user']; if (userName in userEntranceMessages && !userEntranceMessages[userName]['has_entered']) { userEntranceMessages[userName]['has_entered'] = true; notice(userEntranceMessages[userName]['msg']); } })
© Copyright Chaturbate 2011- 2025. All Rights Reserved.