Apps Home
|
Create an App
timertesting
Author:
tok124
Description
Source Code
Launch App
Current Users
Created by:
Tok124
let mytime; let test = 0; cb.onMessage(msg => { let message = msg.m.split(' '); switch(message[0]) { case"/timer": test = parseInt(message[1] * 60000); if(test > 0) { timer(test); } break; default: break; } }); function timer(time) { time = time-1000; cb.setTimeout(timer, 1000); msConversion(time); } cb.onDrawPanel(user => { return { 'template': '3_rows_of_labels', 'row1_label': 'Timer :', 'row1_value': mytime, 'row2_label': 'Highest Tip:', 'row2_value': user['user'], 'row3_label': 'Latest Tip Received:', 'row3_value': '0' }; }); function msConversion(millis) { let sec = Math.floor(millis / 1000); let hrs = Math.floor(sec / 3600); sec -= hrs * 3600; let min = Math.floor(sec / 60); sec -= min * 60; sec = '' + sec; sec = ('00' + sec).substring(sec.length); if (hrs > 0) { min = '' + min; min = ('00' + min).substring(min.length); return hrs + ":" + min + ":" + sec; } else { mytime = min + ":" + sec; cb.sendNotice(mytime); } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.