// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Color-channel mixing quiz // Not compiled or tested in-world // Setup: Owner-touch. Answer with RG, RB, or GB. // Stop / restore: Stop responding and the listener closes after 90 seconds, or remove/disable the script. Owner-touch restarts the exercise. // Notes: Owner-only local exercise; no prizes, visitor records, network service, or persistent scores. A simple idealized additive-light lesson, not pigment mixing or a color-management measurement. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } ask(string prompt) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),prompt,channel); llSetTimerEvent(90.0); } list names=["yellow","magenta","cyan"]; list pairs=["rg","rb","gb"]; integer choice; start() { choice=(integer)llFrand(3.0); ask("Which two additive RGB channels make "+llList2String(names,choice)+"? Enter RG, RB, or GB."); } answer(string s) { s=llToLower(s); if(llListFindList(pairs,[s])<0) { ask("Use RG, RB, or GB."); return; } close(); if(s==llList2String(pairs,choice))llOwnerSay("Correct."); else llOwnerSay("This pair is "+llToUpper(llList2String(pairs,choice))+"."); } default { touch_start(integer count) { if(llDetectedKey(0)!=llGetOwner())return; close(); start(); } listen(integer ch,string name,key id,string message) { if(!handle||ch!=channel||id!=llGetOwner())return; answer(llStringTrim(message,STRING_TRIM)); } timer() { close(); llOwnerSay("Exercise paused. Touch to restart."); } changed(integer change) { if(change&CHANGED_OWNER)llResetScript(); } }