Apps Home
|
Create an App
Spanking_Counter_No_Notice
Author:
inmateha871
Description
Source Code
Launch App
Current Users
Created by:
Inmateha871
/* Clever discipline application for Chaturbate.com. Are you an online Master or Mistress (BDSM) in need of dishing out some discipline? Or are you simply into self spankings? Look no further. This spanking application was designed to deliver spankings. There are currently two ways that spankings can be issued. First there's the timer, set when launching the app. This controls how often spankings are issued. There's a number of viewers "multiplier", which is also configurable. The number of spankings issued, each time, is equal to the multiplier times the number of viewers. The higher the number of viewers, the great number of spankings. So, it promotes viewers to stick around and watch. Second, there's the Tip option. Any tip, above a configurable amount, will trigger a spanking to be issued. Make sure to set this high, as it does not count towards the timer. This app can be used for discipline purposes, but it's mostly designed for people who like to give and/or receive spankings. Feel free to post comments on how I can make this app better. Implement Ideas: Hand, Hairbrush, Wooden Paddle, Leather Paddle, Leather Strap, Leather Belt, Switch, Cane, Wooden Spoon, Lexan Rod, Toy Paddle, Lexan Spoon, Bathbrush, Leather Tawse, Ruler, Slipper, Shoe, Flogger, Whip, Riding Crop Position Ideas: Standing up, Kneeling, On all-fours, One leg up on chair, Bent over chair, Laying on bed (or floor), Diaper pos (laying on back, legs up), Bent over a chair, Bending over, Touching Toes (spanking between legs) Known Issues: The number of viewers is calculated when logged in users enter/leave the room. It does not include anonymous viewers. It will not be 100% accurate. */ cb.settings_choices = [ {name:'cooldownMin', type:'int', defaultValue:"20", label: "Time between spankings in minutes"}, {name:'multiplier', type:'str', defaultValue:"1", label: "Spankings Multiplier\n(Spanking Issued = # of Users * Multiplier)"}, {name:'tipMin', type:'int', defaultValue:"10", label: "Minimum tip (tokens) to trigger an immediate spanking"}, {name:'implement1', type:'str', defaultValue:"hand", label: "Implement 1, such as hand"}, {name:'implement2', type:'str', required: false, defaultValue:"brush", label: "Implement 2, such as brush"}, {name:'implement3', type:'str', required: false, defaultValue:"belt", label: "Implement 3, such as belt"}, {name:'implement4', type:'str', required: false, defaultValue:"wooden spoon", label: "Implement 4, such as wooden spoon"}, {name:'implement5', type:'str', required: false, defaultValue:"paddle", label: "Implement 5, such as paddle"}, {name:'pos1', type:'str', defaultValue:"while standing", label: "Position 1, such as while standing"}, {name:'pos2', type:'str', required: false, defaultValue:"while bent over a chair", label: "Position 2, such as while bent over a chair"}, {name:'pos3', type:'str', required: false, defaultValue:"on all-fours", label: "Position 3, such as on all-fours"}, {name:'pos4', type:'str', required: false, defaultValue:"diaper pos (laying on back, legs up)", label: "Position 4, such as diaper pos"}, {name:'pos5', type:'str', required: false, defaultValue:"bent over a chair", label: "Position 5, such as bent over a chair"} ]; var numImplements = 5; var numPoss = 5; var implementsArray = []; var possArray = []; var implement = ''; var pos = ''; var lastImplement = ''; var lastPos = ''; var timeoutMin = 20; var timeoutSec = 20 * 60; var multiplier = 1; var tipMin = 10; var tipAmount = 0; var tippedTotal = 0; var numWatchers = 1; var numUsers = 1; var numSpankings = 0; var totalSpankings = 0; var rowText = ''; var noticeBackgroundColor = '#ffffff'; var noticeTextColor = '#8B0000'; function sanitize(str) { if (str == null) return ''; return str.replace(/[^a-zA-Z 0-9]+/g, '') } function inArray(str, arry) { for (var i = 0; i < arry.length; i++) { if (arry[i] === str) return true } return false } function arrayToString(arry) { var out = ''; for (var i = 0; i < arry.length; i++) { out += arry[i]; if (i < (arry.length - 1)) out += ', ' } return out } function shuffle(o) { for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min } function getRandomArrayVal(arry, exclude, cnt){ if (!cnt) cnt = 0; var randVal = arry[Math.floor(Math.random()*arry.length)]; if (randVal === exclude) { cnt = cnt + 1; if (cnt > 10) { return randVal; } else { return getRandomArrayVal(arry, exclude, cnt); } } else { return randVal; } } var spankingTimer = function() { issueSpanking(); cb.setTimeout(spankingTimer, timeoutSec * 1000); } function issueSpanking() { cb.log('issueSpanking'); implement = getRandomArrayVal(implementsArray, lastImplement); cb.log('implement: ' + implement); pos = getRandomArrayVal(possArray, lastPos); cb.log('pos: ' + pos); numSpankings = Math.floor(multiplier * numWatchers); cb.log('numSpankings: ' + numSpankings); totalSpankings = totalSpankings + numSpankings; cb.log('totalSpankings: ' + totalSpankings); cb.drawPanel(); spankingNotice(); lastImplement = implement; lastPos = pos; } function spankingNotice() { var lang_the_or_your = (implement == 'hand' || implement == 'brush') ? 'your' : 'the'; cb.chatNotice( "SPANK-O-APP - TIME FOR SPANKINGS!\n" + "Calculating: " + multiplier + " (multiplier) x " + numWatchers + " (Viewers)\n" + numSpankings + " spankings with " + lang_the_or_your + " " + implement + ', ' + pos + "!" + "", '', noticeBackgroundColor, noticeTextColor ); } function shamelessKeywords() { var keywords = ['spankings', 'spanko', 'spank', 'canning', 'ass', 'paddle', 'paddel', 'domination', 'dominatrix', 'master', 'mistress', 'bdsm', 'anal', 'asshole', 'ass', 'cum', 'cock', 'pussy', 'games', 'fun', 'squirt', 'dildo', 'tokenkeno', 'uncut', 'naked', 'horny', 'bigdick', 'young', 'hairy', 'hard', '18', 'fun', 'chat']; } cb.onEnter(function (user) { numWatchers++; numUsers = 0; // parseInt($('*[data-tab="users"] .usercount')); if (numUsers > numWatchers) numWatchers = numUsers; }); cb.onLeave(function(user) { numWatchers--; }); cb.onTip(function (tip) { cb.log(tip); tipAmount = parseInt(tip['amount']); tippedTotal += tipAmount; if (cb.settings.tipMin > 0 && tipAmount > cb.settings.tipMin) { tippedTotal += parseInt(tip.amount) cb.chatNotice("Thank you " + tip.from_user + "! Total Tips Received: " + tippedTotal + ' Tokens', '', noticeBackgroundColor, '#008000'); issueSpanking(); } }); cb.onDrawPanel(function(user) { cb.log("on drawPanel"); return { 'template': '3_rows_of_labels', 'row1_label': 'Spankings Issued Every:', 'row1_value': '' + timeoutMin + ' Minutes!', 'row2_label': 'Total Spankings Issued: ', 'row2_value': totalSpankings, 'row3_label': 'Total Tips Received: ', 'row3_value': tippedTotal }; }); function init() { // Setup config for Spanking Implements implementsArray = []; var implementVal = ''; for (var i = 1; i <= numImplements; i++) { implementVal = eval('cb.settings.implement' + i); if (implementVal !== '' && inArray(implementVal, implementsArray) !== true) { implementsArray.push(implementVal); } } cb.log(implementsArray); // Setup config for Spanking Poss possArray = []; var posVal = ''; for (var i = 1; i <= numPoss; i++) { posVal = eval('cb.settings.pos' + i); if (posVal !== '' && inArray(posVal, possArray) !== true) { possArray.push(posVal); } } cb.log(possArray); // Timeout and Multiplier if (cb.settings.cooldownMin > 0) { timeoutSec = Math.round(parseInt(cb.settings.cooldownMin) * 60); timeoutMin = Math.round(parseInt(cb.settings.cooldownMin) * 1); } else { timeoutSec = 20 * 60; timeoutMin = 20; } cb.log('timeoutSec: ' + timeoutSec); cb.log('timeoutMin: ' + timeoutMin); if (cb.settings.multiplier > 0) { multiplier = parseFloat(cb.settings.multiplier); } else { multiplier = 1; } cb.log('multiplier: ' + multiplier); // tipMin if (cb.settings.tipMin > 0) { tipMin = parseInt(cb.settings.tipMin); } // Startup Timer if (timeoutSec && timeoutSec >= 1) { cb.setTimeout(spankingTimer, timeoutSec * 1000); } // Start Panel cb.drawPanel(); issueSpanking(); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.