// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Retry with increasing delay // Not compiled or tested in-world // Setup: Put in a spare prim you own. Touch to start. The simulated operation fails twice, then succeeds on attempt three. // Stop / restore: Disable or remove the script. It only reports to its owner and does not change prim properties. Reset clears its temporary state. // Notes: No network requests are made. Replace only the simulated success check when adapting; cap attempts and handle permanent failures separately. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Owner-only calculation; no scene changes. integer running; integer attempt; float delay; float due; default { touch_start(integer detectedCount) { if (llDetectedKey(0) != llGetOwner()) return; if (running) { llOwnerSay("Retry sequence active."); return; } running = TRUE; attempt = 0; delay = 1.0; due = llGetTime()+delay; llSetTimerEvent(0.25); } changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); } timer() { if (!running || llGetTime() < due) return; ++attempt; integer success = (attempt >= 3); if (success || attempt >= 4) { llOwnerSay("Finished on attempt " + (string)attempt + "; success=" + (string)success); running = FALSE; llSetTimerEvent(0.0); return; } delay *= 2.0; due = llGetTime()+delay; llOwnerSay("Simulated failure; retry in " + (string)delay + " seconds."); } }