// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Push-your-luck point game // Not compiled or tested in-world // Setup: Enter roll or bank. Rolling1 loses the current unbanked score; other faces add points. 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. Local imaginary points only: no money, purchases, rewards, accounts or persistent leaderboard. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; integer roundPoints; integer banked; integer turns; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } start() { roundPoints=0; banked=0; turns=0; } string view() { return "Unbanked "+(string)roundPoints+" | banked "+(string)banked+" | rolls "+(string)turns; } show() { llOwnerSay(view()); if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llTextBox(llGetOwner(),"Enter roll or bank. Rolling1 loses the current unbanked score; other faces add points. 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=="roll") { integer die=1+(integer)llFrand(6.0); ++turns; llOwnerSay("Rolled "+(string)die); if(die==1)roundPoints=0; else if(roundPoints<10000)roundPoints+=die; } else if(s=="bank") { if(banked+roundPoints<=1000000) { banked+=roundPoints; roundPoints=0; } } } show(); } timer() { close(); } }