Apps Home
|
My Uploads
|
Create an App
testspankapp
Author:
dmarz_test
Description
Source Code
Launch App
Current Users
Created by:
Dmarz_Test
App Images
// // title - just peachy // author - @daisy_marz // // global variables // amount of tokens tipped var total_tipped = 0; // amount of tokens divided by 'spank_tokens' var total_spanks = 0; // amount of tokens left until the next spank var next_spank = cb.settings.spank_tokens; // length of time left for the spank timer var spanktimer_total = 0; // are timed spanks currently running? var spanktimer_running = 0; // user who tips the magic number var magic_username = null; // has the magic number been tipped? var magic_tipped = 0; // has the magic number already been tipped once? var magic_already_tipped = 0; // menu timer starts at 0 var timer_number = 0; cb.settings_choices = [ { name: 'room_title', type: 'str', minlength: '1', maxlength: '255', label: "room subject (optional)", required: false }, { name: 'spank_goal', type: 'int', minvalue: '0', defaultvalue: '100', label: "number of spanks required to reach goal (optional, set to 0 to disable)" }, { name: 'spank_tokens', type: 'int', minvalue: '1', defaultvalue: '10', label: "amount of tokens for a single spank" }, { name:'fanspank_toggle', type:'choice',choice1:'yes', choice2:'no', defaultValue: 'yes', label: "do fanclub members get double spanks?"}, { name: 'msg_color', type: 'str', label: "new spank color (default peachy pink #F590AA)", defaultvalue: '#F590AA' }, { name: 'ttl_color', type: 'str', label: "total spank color (default bruised peach #E0BFFF)", defaultvalue: '#E0BFFF' }, { name: 'timed_spank_tokens', type: 'int', minvalue: '1', defaultvalue: '66', label: "amount of tokens to start timed spanks" }, { name: 'timed_spank_time', type: 'int', minvalue: '1', defaultvalue: '5', label: "amount of time to run timed spanks (in seconds)" }, { name: 'roll_tokens', type: 'int', minvalue: '1', defaultvalue: '111', label: "amount of tokens to tip for spanks with a randomized object." }, { name: 'roll_item1', type: 'str', label: "random spank object #1"}, { name: 'roll_item2', type: 'str', label: "random spank object #2"}, { name: 'roll_item3', type: 'str', label: "random spank object #3"}, { name: 'roll_item4', type: 'str', label: "random spank object #4"}, { name: 'roll_item5', type: 'str', label: "random spank object #5"}, { name: 'magic_number', type: 'int', minvalue: '1', maxvalue: '100',label: "magic number (between 1-100)"}, { name: 'magic_minutes', type: 'int', minvalue: '1', label: "magic minutes"} ] cb.onEnter( function (user) { if (user['has_tokens']) { var notices = "you can tip " + cb.settings.spank_tokens + " to spank me!\n"; notices += "you can tip " + cb.settings.timed_spank_tokens + " for " + cb.settings.timed_spank_time + " seconds of non stop spanks!\n"; notices += "you can tip " + cb.settings.roll_tokens + " to spank me 10 times with a randomized object!\n"; notices += "if you tip the magic number, you get FREE spanks for " + cb.settings.magic_minutes + " minutes!"; cb.chatNotice("hey " + user['user'] + ", i hope you're doing just peachy.",user['user'], '', cb.settings['msg_color'],'bold'); setTimeout(function() { cb.chatNotice(notices, user['user'], '', '#FFD1E0', 'bold' ); }, 500); } }); cb.onTip( function( tip ) { // old spanks are spanks that were there previously before the tip var old_spanks = total_spanks; // current_tip is the current tip var current_tip = tip['amount']; // replaces the word member with the username of the person who tipped var member = tip['from_user'] if(parseInt(tip['amount']) == cb.settings.timed_spank_tokens) { spanktimer_total += cb.settings.timed_spank_time; if ( spanktimer_running == 1 ) { cb.sendNotice( spanktimer_total + " seconds left", '', '', '#FF73BB' ); } else { cb.sendNotice (tip['from_user'] + " tipped to start timed spanks! - " + spanktimer_total + " seconds left!",'', '#FCD2E0', '', 'bold' ); ticktock(); } } else if(parseInt(tip['amount']) == cb.settings.roll_tokens) { cb.sendNotice("choosing an object for the next 10 spanks...", '', '', cb.settings['msg_color'], 'bold'); cb.sendNotice("..........", '', '', cb.settings['msg_color'], 'bold'); cb.sendNotice(".......", '', '', cb.settings['msg_color'], 'bold'); cb.sendNotice("....", '', '', cb.settings['msg_color'], 'bold'); randomizeobject(); } else if(parseInt(tip['amount']) == cb.settings.magic_number) { if ( magic_already_tipped == 1 ) { cb.sendNotice("the magic number has already been tipped! toooo bad.", '', '', cb.settings['msg_color'],'bold'); } else if ( magic_tipped == 0 ) { magic_username = (tip['from_user']) magic_tipped = 1; magic_already_tipped = 1; cb.sendNotice(magic_username + " has tipped the magic number! they get free spanks for " + cb.settings.magic_minutes + " minutes!", '', '', cb.settings['msg_color'],'bold'); magicnumber(); } } else { total_tipped += current_tip; var new_spanks = Math.floor(current_tip / cb.settings.spank_tokens); var fan_spanks = 0; //next spank is how many tokens until the whole next spank_tokens value is met var next_spank = cb.settings.spank_tokens - ( total_tipped % cb.settings.spank_tokens ); // if ( next_spank == 0 ) // { // partial_spank_goal = partial_spank_goal + 1 // } cb.sendNotice(total_tipped + " " + new_spanks + " " + old_spanks + " " + next_spank); if (new_spanks > 0) { // if (cb.settings.fanspank_toggle == 'yes' && tip['from_user_in_fanclub'] ) if (cb.settings.fanspank_toggle == 'yes' && tip['from_user'] == 'indshadow4' ) { fan_spanks = new_spanks * 2; } // if goal + fanclub == fan club spanks do not count toward total spanks, but announced // if goal - fanclub == goal output, no special fan output at all (single spank) // if !goal + fanclub == fan club spanks count towards total spanks // if !goal - fanclub == spank output if ( new_spanks >= 2 ) { spanky = "spanks"; } else if (new_spanks == 1) { spanky = "spank"; } if ( total_spanks >= 1 ) { sparky = "spanks"; } else if (total_spanks >= 0) { sparky = "spank"; } if ( cb.settings.spank_goal != 0 ) { if (cb.settings.fanspank_toggle == 'yes' ) { if ( fan_spanks > 0 ) { total_spanks += new_spanks; cb.sendNotice( member + " tipped for " + new_spanks + ' more ' + spanky + '!', '', '', cb.settings['msg_color'], 'bold' ); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + ' towards goal!', '', '', cb.settings['ttl_color'], 'bold'); cb.sendNotice("but " + member + " is in my fan club so i actually have to do " + fan_spanks + " spanks!", '', '', '#41FA7C', 'bold'); } else { total_spanks += new_spanks; cb.sendNotice( member + " tipped for " + new_spanks + ' more ' + spanky + '!', '', '', cb.settings['msg_color'], 'bold' ); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + ' towards goal!', '', '', cb.settings['ttl_color'], 'bold'); } } else { total_spanks += new_spanks; cb.sendNotice( member + " tipped for " + new_spanks + ' more ' + spanky + '!', '', '', cb.settings['msg_color'], 'bold' ); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + ' towards goal!', '', '', cb.settings['ttl_color'], 'bold'); } if (total_spanks >= cb.settings.spank_goal) { cb.chatNotice('----------goal reached!----------', '', '', cb.settings['msg_color'], 'bold'); } } else { if (cb.settings.fanspank_toggle == 'yes' ) { if ( fan_spanks > 0 ) { total_spanks += fan_spanks; cb.sendNotice( member + " tipped for " + new_spanks + " more " + spanky + "!, but they're in my fanclub so they get " + fan_spanks + " spanks!", '', '', '#41FA7C', 'bold'); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + '!', '', '', cb.settings['ttl_color'], 'bold'); } else { total_spanks += new_spanks; cb.sendNotice( member + " tipped for " + new_spanks + ' more ' + spanky + '!', '', '', cb.settings['msg_color'], 'bold' ); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + '!', '', '', cb.settings['ttl_color'], 'bold'); } } else { total_spanks += new_spanks; cb.sendNotice( member + " tipped for " + new_spanks + ' more ' + spanky + '!', '', '', cb.settings['msg_color'], 'bold' ); cb.sendNotice('that makes ' + total_spanks + ' total ' + sparky + '!', '', '', cb.settings['ttl_color'], 'bold'); } } if ( cb.settings.spank_goal != 0 ) { if (total_spanks >= cb.settings.spank_goal) { next_spank = 'goal reached!' } } cb.drawPanel(); update_subject(); } } }); cb.onDrawPanel( function( user ) { var menu = null; if (timer_number <= 1) { menu = "tip " + cb.settings.spank_tokens + "tk to spank me!" } else if (timer_number <= 2) { menu = "tip " + cb.settings.timed_spank_tokens + "tk to start timed spanks!" } else if (timer_number <= 3) { menu = "tip " + cb.settings.roll_tokens + "tk to roll a random spank object!" } else if (timer_number <= 4) { menu = "if you tip the magic number you get FREE spanks!" } if ( cb.settings.spank_goal == 0 ) { return { "template": "image_template", "layers": [ { 'type': 'image', 'fileID': 'c464de79-4b48-411b-8522-7572603558bd'}, { 'type': 'text', 'text': 'total spanks: ' + total_spanks, 'top': 5, 'left': 5 }, { 'type': 'text', 'text': 'cost per spank: ' + cb.settings.spank_tokens, 'top': 29, 'left': 5 }, { 'type': 'text', 'text': menu , 'top': 52, 'left': 5 } ] }; } else { return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': 'c464de79-4b48-411b-8522-7572603558bd'}, { 'type': 'text', 'text': 'total spanks: ' + total_spanks + '/' + cb.settings.spank_goal, 'top': 5, 'left': 5 }, { 'type': 'text', 'text': 'cost per spank: ' + cb.settings.spank_tokens, 'top': 29, 'left': 5 }, { 'type': 'text', 'text': menu , 'top': 52, 'left': 5 } ] }; } }); cb.onMessage( function( msg ) { var message = msg['m'].split(' '); if( message[0].charAt(0) == '/' ) { msg['X-Spam'] = true; if( message[0] == "/help" ) { showhelp( msg['user'] ); } else if(message[0] == "/about") { cb.sendNotice(" :daisy_marz-peachiconleftsmall :daisy_marz-peachiconleftsmall :daisy_marz-peachiconleftsmall just peachy by @daisy_marz [version 1] :daisy_marz-peachiconrightsmall :daisy_marz-peachiconrightsmall :daisy_marz-peachiconrightsmall ", '', '', cb.settings['msg_color'], 'bold') } else if(message[0] == "/spankobjects") { showspankobjects( msg['user'] ); } } else if(msg['user'] == magic_username && magic_tipped == 1) { msg['background'] = '#FFD1E0' } return msg; }); function update_subject() { // spank_subject is what the room topic will automatically include with the optional title var spank_subject = 'spanks: ' + total_spanks if ( cb.settings.spank_goal > 0 ) { spank_subject = 'spanks: ' + total_spanks + '/' + cb.settings.spank_goal if ( total_spanks >= cb.settings.spank_goal ) { spank_subject = 'goal reached!' } } if ( cb.settings.room_title == '' ) { cb.changeRoomSubject( "tip " + cb.settings.spank_tokens + " to spank me! || " + spank_subject ); } else { cb.changeRoomSubject( cb.settings.room_title + ' || ' + spank_subject ); } } function ticktock() { //color for each spanktimer message [happens every 5 seconds] var color; spanktimer_total--; if ( spanktimer_total > 0 ) { spanktimer_running = 1; if ( spanktimer_total % 5 == 0 ) { if ( spanktimer_total >= 61 ) { color = '#BD30C9'; } else if ( spanktimer_total >= 60 ) { color = '#E663BE'; } else if ( spanktimer_total >= 55 ) { color = '#FA55A2'; } else if ( spanktimer_total >= 45 ) { color = '#FA558C'; } else if ( spanktimer_total >= 30 ) { color = '#FA82AA'; } else if ( spanktimer_total >= 15 ) { color = '#F7B0C8'; } else if ( spanktimer_total >= 6 ) { color = '#FCBDD2'; } else if ( spanktimer_total <= 5 ) { color = '#FCD2E0'; } cb.sendNotice( ":daisy_marz-peachiconleft timed spanks! " + spanktimer_total + " seconds left", '', color, '', 'bold' ); } cb.setTimeout( ticktock, 1000 ); } else { cb.sendNotice( "timed spanks over, give it a rest", '', '', '#FF73BB', 'bold'); spanktimer_running =0; } } function randomizeobject() { // items are an array showing the objects set in settings var items = new Array(cb.settings.roll_item1, cb.settings.roll_item2, cb.settings.roll_item3, cb.settings.roll_item4, cb.settings.roll_item5) //prize is choosing a random selection from 'rewards' var prize = items[Math.floor(Math.random()*items.length)]; cb.sendNotice("i have to use " + prize + " for the next 10 spanks! ouch!", '', cb.settings['ttl_color'], '', 'bold'); } function magicnumber() { var timer = cb.settings.magic_minutes * 60 * 1000; cb.sendNotice("for the next " + cb.settings.magic_minutes + " minutes, you can ask for as many spanks as you want and i will do them.", magic_username, '', '#FFD1E0', 'bold' ); cb.setTimeout(function() { magic_tipped = 0; }, timer); } function menutimer() { timer_number = timer_number + 1 if (timer_number > 4) { timer_number = 1 } cb.drawPanel(); cb.setTimeout(menutimer, 15000) } function showhelp( username ) { var notices = ' :daisy_marz-peachiconleft ----------options---------- :daisy_marz-peachiconright\n'; notices += 'tip ' + cb.settings.spank_tokens + ' to spank me!\n'; notices += 'tip ' + cb.settings.timed_spank_tokens + ' for ' + cb.settings.timed_spank_time + ' seconds of non stop spanks!\n'; notices += 'tip ' + cb.settings.roll_tokens + ' to spank me 10 times with a randomized item.\n'; notices += "if you tip the magic number, you get FREE spanks for " + cb.settings.magic_minutes + " minutes!\n" notices += 'type /spankobjects in the chat to see a list of possible items.\n'; notices += 'type /about in the chat to see app info.'; cb.sendNotice( notices, username, '#FFD1E0', '', 'bold' ); } function showspankobjects( username) { var notices = ' :daisy_marz-peachiconleft --- tip ' + cb.settings.roll_tokens + ' to spank me with one of these objects: --- :daisy_marz-peachiconright\n'; notices += ' :daisy_marz-peachiconleftsmall ' + cb.settings.roll_item1 + ' \n'; notices += ' :daisy_marz-peachiconleftsmall ' + cb.settings.roll_item2 + ' \n'; notices += ' :daisy_marz-peachiconleftsmall ' + cb.settings.roll_item3 + ' \n'; notices += ' :daisy_marz-peachiconleftsmall ' + cb.settings.roll_item4 + ' \n'; notices += ' :daisy_marz-peachiconleftsmall ' + cb.settings.roll_item5 + ' '; cb.sendNotice( notices, username, '#FFD1E0', '', 'bold' ); } function notifier() { cb.sendNotice("you can type /help in the chat to see the different ways you can bruise me.", '', '', cb.settings['msg_color'], 'bold') cb.setTimeout(notifier, 150000) } function credit() { cb.sendNotice(" :daisy_marz-peachiconleftsmall just peachy by @daisy_marz :daisy_marz-peachiconrightsmall ", '', '#FFD1E0', '', 'bold') cb.sendNotice("type /help in the chat to see the different ways you can bruise me.", '', '', cb.settings['msg_color'], 'bold') cb.setTimeout(credit, 600000) } notifier(); credit(); update_subject(); menutimer()
© Copyright Chaturbate 2011- 2025. All Rights Reserved.