Apps Home
|
Create an App
Errors
Author:
877_cash_now
Description
Source Code
Launch App
Current Users
Created by:
877_Cash_Now
var loopCount = 0; var cancelTimeoutId = 0; var timeoutLength = 2000; function directUserNoticeLoop() { cb.log('log count: ' + loopCount.toString()); cancelTimeoutId = cb.setTimeout(directUserNoticeLoop, timeoutLength); loopCount += 1; } cb.onMessage(function(message) { const m = message.m; if (m.startsWith('!cbapps')) { const fields = m.split(' ') const command = fields[1]; const params = fields[2] switch(command){ // !cbapps startloop // start loop for direct user notice case 'startloop': cancelTimeoutId = cb.setTimeout(directUserNoticeLoop, timeoutLength); break; // !cbapps stoploop // stops previous direct user notice loop case 'stoploop': cb.cancelTimeout(cancelTimeoutId); break; // !cbapps settimeoutlength time_in_ms case 'settimeoutlength': timeoutLength = parseInt(params); notice("Set length to " + timeoutLength + "ms"); break; default: help(); break; } } })
© Copyright Freesexcam 2011- 2024. All Rights Reserved.