Apps Home
|
Create an App
Hola (prueba)
Author:
tokiogirl
Description
Source Code
Launch App
Current Users
Created by:
Tokiogirl
/// <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 in " + cb.room_slug + "'s Room", required : false}, {name : 'RoomMessage', type : 'str', minLength : 1, maxLength : 255, label : "Room Message", defaultValue : "Escribe algo aca", 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 Tip: " + 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 + " for a Request" : cb.settings.RoomMessage; if ( TotalTips == 0 ) { return { 'template': '3_rows_11_21_31_', 'row1_value': 'Hi guys!', 'row2_value': 'Welcome to my room!', 'row3_value': mess }; } else { return { 'template': '3_rows_11_21_31_', 'row1_value': 'Hi guys!', 'row2_value': 'Welcome to my room!', 'row3_value': mess }; } } Init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.