Bots Home
|
Create an App
rh test5
Author:
rubbinh00d
Description
Source Code
Launch Bot
Current Users
Created by:
Rubbinh00d
(function(cb) { /** * @constructor * @param {Function} func * @param {number} delay */ var setTimeout = function setTimeout(func, delay) { if (!(this instanceof setTimeout)) { return new setTimeout(func, delay); // ignore jslint error warning, and Closure Compiler warning (it expects constructors to be capitalized) } var that = this; function timeout() { if (that.cancelled) { return; } func(); } cb["setTimeout"](timeout, delay < 1000 ? 1000 : delay); // cb.setTimeout doesn't like timeout values less than 1000 - it go cray cray! }; var clearTimeout = function clearTimeout(timeout) { timeout.cancelled = true; }; /** * @constructor * @param {Function} func * @param {number} delay */ var setCorrectingInterval = function setCorrectingInterval(func, delay) { // @see https://codepen.io/lavoiesl/pen/GdqDJ if (!(this instanceof setCorrectingInterval)) { return new setCorrectingInterval(func, delay); // ignore jslint error warning, and Closure Compiler warning (it expects constructors to be capitalized) } var target = (new Date().valueOf()) + delay; var that = this; function tick() { if (that.stopped) return; target += delay; func(); var new_delay = target - (new Date().valueOf()); cb["setTimeout"](tick, new_delay < 1000 ? 1000 : new_delay); // cb.setTimeout doesn't like timeout values less than 1000 - it go cray cray! }; cb["setTimeout"](tick, delay < 1000 ? 1000 : delay); // cb.setTimeout doesn't like timeout values less than 1000 - it go cray cray! }; var clearCorrectingInterval = function clearCorrectingInterval(interval) { interval.stopped = true; } function ago(value) { value = Math.floor(value / 1000); if (value < 5) return " just now"; if (value < 60) return " " + value + " seconds ago"; value = Math.floor(value / 60) if (value < 2) return " 1 minute ago"; if (value < 60) return " " + value + " minutes ago"; value = Math.floor(value / 60) if (value < 2) return " 1 hour ago"; return " " + value + " hours ago"; } var started = null; if (!started) { started = (new Date()).valueOf(); refresh(); setCorrectingInterval(refresh, 60000); } function refresh() { var now = (new Date()).valueOf(); var msg = "Started" + ago(now - started); cb["log"](msg); if (!1 && cb["limitCam_isRunning"]()) { cb["limitCam_stop"](); } cb["limitCam_start"](msg); } }(cb));
© Copyright Chaturbate 2011- 2024. All Rights Reserved.