Apps Home
|
Create an App
Pocas Love Jar
Author:
sexypokeahontas
Description
Source Code
Launch App
Current Users
Created by:
Sexypokeahontas
/// <reference path="~/Scripts/Chaturbate.js" /> // Globals var TotalTips = 0; var LastTip = "-- (0)"; function Init() { /// <summary>This Method is the Main Method of the App</summary> cb.settings_choices = [{name : 'UpdateSubject', type : 'choice', choice1 : 'Yes', choice2 : 'No', defaultValue : 'No', label : "Update Subject On Tip"}, {name : 'RoomTitle', type : 'str', minLength : 1, maxLength : 255, label : "Room Title", defaultValue : "Welcome to " + cb.room_slug + "'s Room", required : false}, {name : 'RoomMessage', type : 'str', minLength : 1, maxLength : 255, label : "Room Message", defaultValue : "Thanks To All Tippers", required : false}, {name : 'RequestPrice', type : 'int', minValue : 0, required : false}]; cb.onTip( OnTip ); cb.onMessage( OnMessage ); cb.onDrawPanel( OnDraw ); cb.drawPanel(); cb.changeRoomSubject(cb.settings.RoomTitle); } function OnTip( tip ) { /// <summary>Appens after every tip</summary> var amount = parseInt( tip["amount"] ); var user = tip["from_user"]; TotalTips += amount; LastTip = user + " (" + amount + ")"; if ( amount == cb.settings.RequestPrice ) { cb.chatNotice( "Do you have a request?", user ); } if ( cb.settings.UpdateSubject == 'Yes' ) { cb.changeRoomSubject( cb.settings.RoomTitle + "[ Last love from: " + LastTip + " ]" ); } cb.drawPanel(); } function OnMessage( msg ) { /// <summary></summary> if ( msg['user'] == cb.room_slug ) { if ( msg["u"] == "!reset" ) { TotalTips = 0; LastTip = "-- (0)"; } } } function OnDraw( user ) { var mess = ( cb.settings.RequestPrice > 0 ) ? cb.settings.RequestPrice + " if you have a request for Poca" : cb.settings.RoomMessage; if ( TotalTips == 0 ) { return { 'template': '3_rows_11_21_31', 'row1_value': 'Pocas love jar is emtpy :(', 'row2_value': 'last love from: ' + LastTip, 'row3_value': mess }; } else { return { 'template': '3_rows_11_21_31', 'row1_value': 'Pocas love jar contains' + TotalTips + ( ( TotalTips == 1 ) ? " Token" : " Tokens" ), 'row2_value': 'last love from: ' + LastTip, 'row3_value': mess }; } } Init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.