Apps Home
|
Create an App
Vote_sexyhotwifeporn1
Author:
artisteerotique
Description
Source Code
Launch App
Current Users
Created by:
Artisteerotique
//Vote_sexyhotwifeporn //Author: sexyhotwifeporn //var var votes_A = 0; var tokens_A = 0; var votes_B = 0; var tokens_B = 0; var tokens_random = 0; var total_random = 0; cb.settings_choices = [ {name:"name_A", type:"str", minLength:1, maxLength:50, label:"Name of model A:", required:true, default:"A"}, {name:"name_B", type:"str", minLength:1, maxLength:50, label:"Name of model B:", required:true, default:"B"}, {name:"vote_costs", type:"int", minValue:1, default:148, label:"One vote costs:"}, {name:"votes_win", type:"int", default:15, label:"Number of votes to win:"}, {name:"award_description", type:"str", minLength:1, maxLength:70, label:"Award description:", required:true}, {name:"random_vote_costs", type:"int", default:0, label:"Random vote costs(0 to deactivate):"} ]; //handlers cb.onTip(function(tip){ var amount = tip["amount"]; var msg = tip["message"].toLowerCase(); var nameA = cb.settings.name_A.toLowerCase(); var nameB = cb.settings.name_B.toLowerCase(); var costs = cb.settings.vote_costs; var rand_costs = cb.settings.random_vote_costs; if (amount >= costs){ var votes = Math.floor(amount / costs); var rest = amount % costs; if (msg == nameA){ votes_A = votes_A + votes; tokens_A = tokens_A + amount; if(rand_costs > 0){ tokens_random = tokens_random + rest; } }else if (msg == nameB){ votes_B = votes_B + votes; tokens_B = tokens_B + amount; if(rand_costs > 0){ tokens_random = tokens_random + rest; } }else{ cb.chatNotice("Sorry your tip message was incorrect!\nPlease write " + nameA + " or " + nameB + " into your tip message to vote.",tip["from_user"]); } }else if(rand_costs > 0){ tokens_random = tokens_random + amount; total_random = total_random + amount; } nameA = cb.settings.name_A; nameB = cb.settings.name_B; while(rand_costs > 0 && tokens_random >= rand_costs){ var random = Math.floor((Math.random()*2)+1); //1 or 2 if(random == 1){ votes_A++; cb.chatNotice("Random vote goal was reached!\nVote goes to " + nameA + "!!","","#FAAC58","#2E2EFE","bold"); }else if(random == 2){ votes_B++; cb.chatNotice("Random vote goal was reached!\nVote goes to " + nameB + "!!","","#FAAC58","#2E2EFE","bold"); } tokens_random = tokens_random - rand_costs; } if(votes_A >= cb.settings.votes_win){ cb.chatNotice("Contest is over!!\nCongratulations " + nameA + " you have won!!\n"+ nameA + ": (" + votes_A + "/" + cb.settings.votes_win + ") and a total of " + tokens_A + " tokens.\n" + nameB + ": (" + votes_B + "/" + cb.settings.votes_win + ") and a total of " + tokens_B + " tokens.","","#FFFF00","#FF0000","bold"); reset(); } if(votes_B >= cb.settings.votes_win){ cb.chatNotice("Contest is over!!\nCongratulations " + nameB + " you have won!!\n"+ nameB + ": (" + votes_B + "/" + cb.settings.votes_win + ") and a total of " + tokens_B + " tokens.\n" + nameA + ": (" + votes_A + "/" + cb.settings.votes_win + ") and a total of " + tokens_A + " tokens.","","#FFFF00","#FF0000","bold"); reset(); } cb.drawPanel(); }); cb.onDrawPanel(function(user){ var nameA = cb.settings.name_A; var nameB = cb.settings.name_B; var costs = cb.settings.vote_costs; var rand_costs = cb.settings.random_vote_costs; if(rand_costs > 0){ return{ "template": "3_rows_11_21_31", "row1_value": "Random vote goal (Total): " + tokens_random + " / " + rand_costs + " (" + total_random + ")", "row2_value": nameA + "'s votes (one vote " + costs + " tokens): " + votes_A + " / " + cb.settings.votes_win + " (" + tokens_A + ")", "row3_value": nameB + "'s votes (one vote " + costs + " tokens): " + votes_B + " / " + cb.settings.votes_win + " (" + tokens_B + ")" }; }else if(rand_costs == 0){ return{ "template": "3_rows_11_21_31", "row1_value": "Award: " + cb.settings.award_description, "row2_value": nameA + "'s votes (one vote " + costs + " tokens): " + votes_A + " / " + cb.settings.votes_win + " (" + tokens_A + ")", "row3_value": nameB + "'s votes (one vote " + costs + " tokens): " + votes_B + " / " + cb.settings.votes_win + " (" + tokens_B + ")" }; } }); cb.onEnter(function(user){ cb.chatNotice("Contest Award:\n" + cb.settings.award_description, user["user"],"#81F781","#2E2EFE","bold"); cb.chatNotice("One vote costs " + cb.settings.vote_costs + ".\nPlease write " + cb.settings.name_A + " or " + cb.settings.name_B + " into your tip message to vote.",user["user"],"#81F781","#2E2EFE","bold"); }); //functions function reset(){ votes_A = 0; tokens_A = 0; votes_B = 0; tokens_B = 0; tokens_random = 0; total_random = 0; cb.drawPanel(); } function printAward(){ cb.chatNotice("Contest Award:\n" + cb.settings.award_description,"","#81F781","#2E2EFE","bold"); cb.setTimeout(printAward, 300000); } function init(){ cb.drawPanel(); if(cb.settings.random_vote_costs > 0){ cb.setTimeout(printAward, 5000); } } init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.