Apps Home
|
Create an App
RomanoSins - Keep It Going
Author:
romanosinz
Description
Source Code
Launch App
Current Users
Created by:
Romanosinz
function checkJar() { // if totalTip exceeds some limit, you can perform some actions here if (totalTip >= cb.settings.goal) { bigTip = 0; bigTipper = '--'; cb.chatNotice(`Goal of ${cb.settings.goal} tokens reached! Starting a new goal...`); totalTip = 0; // reset totalTip } for (let [username, amount] of topTipper.entries()) { if (amount > bigTip) { bigTip = amount; bigTipper = `${username}(${amount})`; } } cb.setTimeout(checkJar, reduceTJ); // re-run the check in 'reduceTJ' milliseconds } function printStats(user) { let running = ((Date.now() - startApp) / 1000); let minutes = Math.floor(running / 60); let hours = Math.floor(minutes / 60); minutes %= 60; let runningStr = `${hours} hrs. ${minutes} mins.`; let stats = `*** Keep It Going App - Stats ***\n App Started At: ${new Date(startApp).toLocaleString()}\n Current Running Time: ${runningStr}\n Total Tips: ${totalTip}\n Biggest Tip: ${bigTip} by ${bigTipper}`; cb.chatNotice(stats, user); } cb.onTip(function(tip) { totalTip += tip.amount; // increase totalTip by the tipped amount // update the topTipper map if (topTipper.has(tip.from_user)) { topTipper.set(tip.from_user, topTipper.get(tip.from_user) + tip.amount); } else { topTipper.set(tip.from_user, tip.amount); } checkJar(); // call checkJar on every tip });
© Copyright Freesexcam 2011- 2024. All Rights Reserved.