Apps Home
|
Create an App
tip 1 to chat
Author:
mikejc59
Description
Source Code
Launch App
Current Users
Created by:
Mikejc59
var settings = [ { name : 'Announcement', type : 'str', minLength: 1, maxLength: 255, default: "Start chat with me _ Requires one time tip of 2 tokens!" }, { name : 'Approval Message', type : 'str', minLength: 1, maxLength: 255, default: "Thanks for the tip - Let's chat!" }, { name : 'Not Enough Message', type : 'str', minLength: 1, maxLength: 255, default: "Thanks for the tip, but it's not quite enough. Two tokens is minimum :(" }, { name : 'Ignored Message', type : 'str', minLength: 1, maxLength: 255, default: "If you can't tip at least 2 tokens Let me chat with guys my paying members!" }, { name : 'Minimum tip amount', type : 'int', minValue: 1, default: 1 } ]; cb.settings_choices = [].concat( settings ); var users = []; cb.onTip( function(tip) { var user = tip["user"]; if ( (typeof(users[user]) == "undefined") || (users[user] == null) ) { users[user] = { Total: 0 } } users[user].Total += tip["amount"]; if (users[user].Total >= cb.settings["Minimum tip amount"]) { cb.chatNotice(cb.settings["Approval Message"], user); } else { cb.chatNotice(cb.settings["Not Enough Message"], user); } } ); cb.onMessage( function(msg) { var ignore = true; var user = msg["user"]; if ( (typeof(users[user]) != "undefined") && (users[user] != null) ) { if (users[user].Total >= cb.settings["Minimum tip amount"]) ignore = false; } if (ignore) { msg["X-Spam"] = true; cb.chatNotice(cb.settings["Ignored Message"], user); } return msg; } )
© Copyright Freesexcam 2011- 2024. All Rights Reserved.