Apps Home
|
Create an App
vnr-vote
Author:
wicklow
Description
Source Code
Launch App
Current Users
Created by:
Wicklow
var CurrentSetting = 0; var TotalTips = 0; var LastTipper = null; var TipAmount = 0; var VotesForModelOne = 0; var VotesForModelTwo = 0; cb.settings_choices = [ {name:'Goal', type:'int', minValue:1, label:'Show Goal', defaultValue:1000}, {name:'Stipulation', type:'str', minLength:1, label:'Goal Stipulation', defaultValue: 'Who Gets #Doxy First?'}, {name:'ModelOne', type:'str', minLength:1, label:'Model One Name', defaultValue:'Violet'}, {name:'ModelTwo', type:'str', minLength:1, label:'Model Two Name', defaultValue:'Riley'}, ]; var ModelOne = cb.settings.ModelOne; var ModelTwo = cb.settings.ModelTwo; var Goal = cb.settings.Goal; var Stipulation = cb.settings.Stipulation; cb.onTip(function (tip) { TipAmount = parseInt(tip['amount']); TotalTips += TipAmount; LastTipper = tip['from_user']; if ( 0 == TipAmount % 10 ) { VotesForModelOne += 1; cb.chatNotice(" A vote has been placed for " + ModelOne + " Remember end you tip with a 0 for " + ModelOne + " and a 5 for " + ModelTwo + "! ", "", '#410856', '#FFFFFF'); } else if ( 0 == TipAmount % 5 ) { VotesForModelTwo += 1; cb.chatNotice(" A vote has been placed for " + ModelTwo + " Remember end you tip with a 0 for " + ModelOne + " and a 5 for " + ModelTwo + "! ", "", '#410856', '#FFFFFF'); } else { cb.chatNotice(" Thank You " + LastTipper + "! ", "", '#410856', '#FFFFFF'); } cb.drawPanel(); }); cb.onDrawPanel(function(user) { if ( TotalTips == 0 ) { return { 'template': '3_rows_12_22_31', 'row1_label': ModelOne, 'row1_value': VotesForModelOne, 'row2_label': ModelTwo, 'row2_value': VotesForModelTwo, 'row3_value': 'Lets get this party started!', }; } else if ( TotalTips >= Goal ) { if ( VotesForModelOne > VotesForModelTwo ) { return { 'template': '3_rows_11_21_31', 'row1_value': ' ', 'row2_value': 'WINNER: ' + ModelOne + '!', 'row3_value': ' ', }; } else { return { 'template': '3_rows_11_21_31', 'row1_value': ' ', 'row2_value': 'WINNER: ' + ModelOne + '!', 'row3_value': ' ', }; } } else { return { 'template': '3_rows_of_labels', 'row1_label': ModelOne, 'row1_value': VotesForModelOne, 'row2_label': ModelTwo, 'row2_value': VotesForModelTwo, 'row3_label': 'Tips: ', 'row3_value': TotalTips + ' / ' + Goal, }; } }); function init() { cb.changeRoomSubject( Stipulation + ' Vote with tips ending in 0 for ' + ModelOne + '! Vote with tips ending in 5 for ' + ModelTwo + '! // Goal: ' + Goal ); cb.chatNotice( Stipulation + ' Vote with tips ending in 0 for ' + ModelOne + '! Vote with tips ending in 5 for ' + ModelTwo + '! // Goal: ' + Goal, "", '#410856', '#FFFFFF'); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.