Apps Home
|
My Uploads
|
Create an App
test_panel2
Author:
philwhelp
Description
Source Code
Launch App
Current Users
Created by:
Philwhelp
App Images
// topic settings tags = cb.settings.tags; RoomSubject = cb.settings.RoomSubject; // tippers settings var total_tipped = 0; var high_tip_username = "----"; var high_tip_amount = 0; var last_tip_username = "----"; var last_tip_amount = 0; var king_tip_username = "----"; var king_tip_amount = 0; var subject_is_set_with_0 = false; total_tippers = 0; last_time_goal_reached = "never"; cb.settings_choices = [{name:'t1',required: false, label: "----- Goal Settings -----", type:'choice', choice1:'Goal 1 (single and repeat goals)', defaultValue:'Goal 1 (single and repeat goals)'}, {name:'GoalT', label: "What type of goal?", type:'choice', choice1:'0 - single goal', choice2:'1 - single goal : repeated', choice3:'2 - Multiple Goals', defaultValue:'1 - single goal : repeated'}, {name:'GT1', label: "Goals needed for goal 1", type:'int', minValue:1, maxValue:99999, defaultValue: 1}, {name:'GA1', label: "Goal Amount for goal 1", type:'int', minValue:1, maxValue:99999, defaultValue: 1}, {name: 'GN1', label: "Goal 1 is when goals reach", type: 'str', minLength: 1, maxLength: 255}, {name:'GT2', label: "Goals needed for goal 2(exclude goals before)", type:'int', minValue:1, maxValue:99999,required: false}, {name:'GA2', label: "Goal Amount for goal 2", type:'int', minValue:1, maxValue:99999, required: false}, {name: 'GN2', label: "Goal 2 is when goals reach", type: 'str', minLength: 1, maxLength: 255, required: false}, {name:'GT3', label: "Goals needed for goal 3(exclude goals before)", type:'int', minValue:1, maxValue:99999,required: false}, {name:'GA3', label: "Goal Amount for goal 3", type:'int', minValue:1, maxValue:99999, required: false}, {name: 'GN3', label: "Goal 3 is when goals reach", type: 'str', minLength: 1, maxLength: 255, required: false}, {name:'GT4', label: "Goals needed for goal 4(exclude goals before)", type:'int', minValue:1, maxValue:99999, required: false}, {name:'GA4', label: "Goal Amount for goal 4", type:'int', minValue:1, maxValue:99999, required: false}, {name: 'GN4', label: "Goal 4 is when goals reach", type: 'str', minLength: 1, maxLength: 255, required: false}, {name:'t2', label: "----- Notice and Subject Settings -----", type:'choice', required: false}, {name: 'RoomSubject', label: "Room Subject (# = Goal).", type: 'str', minLength: 1, maxLength: 255, required: false, defaultValue: 'Welcome to my room:'}, { name: "tags", label: "Tags (#) ", type: "str", minLength: 1, maxLength: 120, required: true, defaultValue: "Lovense" }, {name:'Ntype', label: "show in notice when tipped.", type:'choice', choice1:'0 - show all goals', choice2:'1 - show only main goals', defaultValue:'0 - show all goals'}, {name:'Gtype', label: "change topic for.", type:'choice', choice1:'0 - all tips', choice2:'1 - all goals', choice3:'2 - only main goals', defaultValue:'0 - all tips'}, ]; //vars var TTG = 0; var gTot = 0; var gl = 0; var ngl = 0; Ntype = cb.settings.Ntype ? getNo(cb.settings.Ntype) : 0; Gtype = cb.settings.Gtype ? getNo(cb.settings.Gtype) : 0; GoalT = cb.settings.GoalT ? getNo(cb.settings.GoalT) : 0; reached =''; goals = []; for (i = 1; i <= 4; i++) { GT = cb.settings['GT'+i] ? cb.settings['GT'+i] : 1; GA = cb.settings['GA'+i] ? cb.settings['GA'+i] : '' ; GN = cb.settings['GN'+i] ? cb.settings['GN'+i] : '' ; if ((GN && GA) && (i == 1)) { gTot += GT; goals.push({gt : gTot, ga : GA, gn : GN});} ;} //goal set no var GSNo = 0; //goal total var Tat = 0; //goal numbers var GST = 0; var RGST = 0; function getNo(ST) { var str = ST; var res = str.match(/[0-9][0-9]{0,4}/g)[0]; return res; } function multGoal(X) { X !== "" ? X : 0; Tat += X; lst =''; lst2 =''; ngl = (gl < 0) ? gl : 0; if (goals.length === 0) {return;} GGSNo = (goals.length > GSNo) ? GSNo : GSNo-1; var mgT = goals[goals.length-1].gt; gT = goals[GGSNo].gt; gA = goals[GGSNo].ga; gN = goals[GGSNo].gn; if(Tat >= gA) {Tat -=gA; GST++;} if ((RGST < GST) && (GST < mgT)) { if ((GST == gT) && (mgT != gT)) {GSNo++; gl= 3; ngl= 3; lst ="Goal #" +GST+ " Reached its time for: ("+ gN +")"; } else if ((RGST < GST) && (mgT != GST)) {ngT = gT-GST; ngl = (gl > 2) ? gl : 2; gl = 2; lst = " Goal #" +GST+ " Reached ! " + ngT + " goals needed.for (" +gN +")"; } RGST++; if (lst) { if ((gl == 3) && (Ntype == 1)) {cb.chatNotice(lst);} else if (Ntype == 0) {cb.chatNotice(lst);} } return multGoal(0); } else if (GST+1 == gT){tTs=gA-Tat; ngl = (gl > 2) ? gl : 2; gl = 2; lst2 ="#" +GST+ " "+ tTs +" required for: #"+gT+" (" + gN +")"; } else if (mgT <= GST) { gl= 3; ngl= 3; lst = "#" +GST+ " Reached ! Thank you all its time for ("+ gN +")"; reached = "yes"; } else {ngT = gT-GST-1; tTs=gA-Tat; ngl = (gl > 1) ? gl : 1; gl = 1; lst2 = ngT + " goals and "+ tTs +" tokens are needed for (" + gN + ") "; } runTopic(); if (lst) {cb.chatNotice(lst);} } function runTopic() { if (Gtype == 1) { if (ngl > 1) { gl = 1; ngl = 1;} else if (TTG > 0) {return;} } else if (Gtype == 2) { if (ngl > 2) { gl = 1; ngl = 1;} else if (TTG > 0) {return;} } if (reached) { goal = "all goals reached! get ready for " + gN ;} else {goal = "get to goal #"+ gT +" prize (" + gN + ")";} sub = "welcome to my room: "+ goal; cb.changeRoomSubject(sub); } function tester() { TTG += 400; multGoal(TTG); } function desmsg() { if (lst2) {cb.chatNotice(lst2); cb.setTimeout(desmsg, 6000);} else {return;} } multGoal(TTG); cb.setTimeout(tester, 3000); //cb.setTimeout( desmsg, 6000);
© Copyright Chaturbate 2011- 2025. All Rights Reserved.