// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Three-station factory model // Not compiled or tested in-world // Setup: Enter add to queue a job or step to advance one pipeline tick. Owner-touch initializes; enter reset to restart. Text input closes after90seconds. // Stop / restore: Close or ignore the text box, or remove the script. It changes no world objects, avatar state or inventory. // Notes: Original bounded, manually stepped educational toy. Not a calibrated simulator, real-world control system, or live scientific measurement. Each tick completes station3, shifts stages, then loads one queued job. It creates no objects and controls no equipment. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; list pending; list stations; integer nextId; integer complete; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } start() { pending=[]; stations=[0,0,0]; nextId=1; complete=0; } string view() { return "Waiting "+llList2CSV(pending)+" | stations "+llList2CSV(stations)+" | complete "+(string)complete; } show() { llOwnerSay(view()); if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),"Enter add to queue a job or step to advance one pipeline tick. Type reset to restart.",channel); llSetTimerEvent(90.0); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; close(); start(); show(); } listen(integer incomingChannel,string name,key id,string s) { if(!handle||incomingChannel!=channel||id!=llGetOwner())return; s=llToLower(llStringTrim(s,STRING_TRIM)); if(s=="reset")start(); else { if(s=="add") { if(llGetListLength(pending)<8&&nextId<1000)pending+=[nextId++]; } else if(s=="step") { if(llList2Integer(stations,2))++complete; integer first=0; if(llGetListLength(pending)) { first=llList2Integer(pending,0); pending=llDeleteSubList(pending,0,0); } stations=[first,llList2Integer(stations,0),llList2Integer(stations,1)]; } } show(); } timer() { close(); } }