Warning: session_start(): open(/var/lib/php/sessions/sess_eihjce1j9pqh6ob0u438pp1evr, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static double stefansChat_onLine_safetyDelay = 1; // seconds
static int stefansChat_onLine_lookback = 0;
static int stefansChat_onLine_firstRead = -1;
static void stefansChat_onLine(fO f) {
thread "Stefan's Chat" {
int a = stefansChat_onLine_firstRead = max(0, toInt(loadPage("http://ai1.lol/1008998/raw/n"))-stefansChat_onLine_lookback);
while licensed { pcall {
S s = loadPage("http://ai1.lol/1008998/raw/incremental?json=1&a=" + a);
if (empty(trim(s))) {
sleepSeconds(stefansChat_onLine_safetyDelay);
print("Re-polling.");
continue;
}
Map map = safeUnstructMap(s);
int n = getInt(map, 'n);
L msgs = cast get(map, 'msgs);
for (O msg : msgs)
pcallF(f, getString(msg, 'text));
a = n;
}}
}
}