// Bonk Board (Moonwater, 2026-10-15 night stream): the palms' coconuts say "coconut|bonk|NAME" on the island's mind // chat when they land on someone's head; this keeps the tally and shows the top five as hover text. Counts live in // linkset data ("b:NAME"), so they survive resets and re-rezzing from inventory. Touch: your own count. The owner's // touch offers a reset. Also counts the island's three hidden things (secret.lsl) and names whoever finds all three. // For the achievers (a friend's Bartle note, 10-14). Claude Opus 5.5 (Tessel). integer ISLAND = -735101; integer MENU; integer menuListen; integer count(string name) { return (integer)llLinksetDataRead("b:" + name); } string short(string name) // "tesselwright Resident" -> "tesselwright" { if (llGetSubString(name, -9, -1) == " Resident") return llGetSubString(name, 0, -10); return name; } show() { list keys = llLinksetDataFindKeys("^b:", 0, 0); list rows = []; integer total = 0; integer i; for (i = 0; i < llGetListLength(keys); ++i) { string k = llList2String(keys, i); integer n = (integer)llLinksetDataRead(k); total += n; rows += [n, llGetSubString(k, 2, -1)]; } rows = llListSortStrided(rows, 2, 0, FALSE); string t = "🥥 BONK BOARD 🥥\n"; if (rows == []) t += "nobody yet. bump a palm!"; for (i = 0; i < 5 && i * 2 < llGetListLength(rows); ++i) t += "\n" + (string)(i + 1) + ". " + llList2String(rows, i * 2 + 1) + " " + (string)llList2Integer(rows, i * 2); if (total) t += "\n\n" + (string)total + " bonk" + llList2String(["s", ""], total == 1) + " so far"; llSetText(t, <1.0, 0.86, 0.55>, 1.0); } string leader() { list keys = llLinksetDataFindKeys("^b:", 0, 0); string best = ""; integer most = 0; integer i; for (i = 0; i < llGetListLength(keys); ++i) { integer n = (integer)llLinksetDataRead(llList2String(keys, i)); if (n > most) { most = n; best = llGetSubString(llList2String(keys, i), 2, -1); } } return best; } default { state_entry() { llListen(ISLAND, "", NULL_KEY, ""); MENU = -1 - (integer)llFrand(1e8); show(); } on_rez(integer p) { llResetScript(); } listen(integer ch, string name, key id, string msg) { if (ch == MENU) { llListenRemove(menuListen); if (msg == "Not me" && id == llGetOwner()) { // my own testing (10-28: 20 bonks while fixing the palms) shouldn't sit among visitors' scores llLinksetDataDelete("b:" + short(llKey2Name(llGetOwner()))); show(); return; } if (msg == "Reset" && id == llGetOwner()) { list keys = llLinksetDataFindKeys("^[bse]:", 0, 0); integer i; for (i = 0; i < llGetListLength(keys); ++i) llLinksetDataDelete(llList2String(keys, i)); show(); } return; } if (llGetOwnerKey(id) != llGetOwner()) return; if (llSubStringIndex(msg, "secret|") == 0) { // the island's hidden things (secret.lsl): a bit per secret in "s:NAME"; all three = an explorer list m = llParseStringKeepNulls(msg, ["|"], []); string finder = short(llList2String(m, 2)); integer mask = (integer)llLinksetDataRead("s:" + finder) | (1 << (llList2Integer(m, 1) - 1)); llLinksetDataWrite("s:" + finder, (string)mask); if (mask == 7 && llLinksetDataRead("e:" + finder) == "") { llLinksetDataWrite("e:" + finder, "1"); show(); llWhisper(0, finder + " found all three of Moonwater's hidden things!"); } return; } // Cleo (10-29): now and then a golden coconut falls, worth 5 ("coconut|gold|NAME") integer worth = 1; if (llSubStringIndex(msg, "coconut|gold|") == 0) worth = 5; else if (llSubStringIndex(msg, "coconut|bonk|") != 0) return; string who = short(llGetSubString(msg, 13, -1)); if (who == "") return; string before = leader(); llLinksetDataWrite("b:" + who, (string)(count(who) + worth)); show(); if (worth > 1) llWhisper(0, "A golden coconut! +5 for " + who); if (before != who && leader() == who) llWhisper(0, who + " takes the lead on the Bonk Board!"); } touch_start(integer n) { key av = llDetectedKey(0); string who = short(llDetectedName(0)); integer c = count(who); if (c) llRegionSayTo(av, 0, "You've been bonked " + (string)c + " time" + llList2String(["s", ""], c == 1) + ". Bump a palm for more."); else llRegionSayTo(av, 0, "No bonks yet! Walk into a palm and stand under it."); if (av == llGetOwner()) { llListenRemove(menuListen); menuListen = llListen(MENU, "", av, ""); llDialog(av, "Bonk Board", ["Not me", "Reset", "Cancel"], MENU); llSetTimerEvent(60); } } timer() { llListenRemove(menuListen); llSetTimerEvent(0); } }