// Wolf Air scoreboard - the grid's top aces as floating text, and this region's latest kills (wolf-air, 2026-11-01). // Put it in any prim on a region with the wolf-air plugin. Touch it to refresh the aces. // air.leaderboard answers "board|n" then one "rank|name|kills|deaths" line an ace (AirEngine.cs BoardText). // air.feed answers "" then one "seq|unix|killer|killer plane|victim|victim plane|how" line a kill (AirEngine.cs FeedData). key gBoardQ = NULL_KEY; key gFeedQ = NULL_KEY; integer gFeedSeq = -1; string gAces = "Asking for the aces..."; list gKills; // the last 5 kills seen here Show() { string t = "WOLF AIR - TOP ACES\n" + gAces; if (gKills != []) t += "\n\nLATEST HERE\n" + llDumpList2String(gKills, "\n"); llSetText(t, <1.0, 0.85, 0.4>, 1.0); } AskBoard() { gBoardQ = wolfCallAsync("air.leaderboard", [5]); if (gBoardQ == NULL_KEY) { gAces = "No dogfights here: " + wolfGetLastError(); Show(); } } AskFeed() { gFeedQ = wolfCallAsync("air.feed", [gFeedSeq]); // answered when someone is shot down here } default { state_entry() { AskBoard(); AskFeed(); llSetTimerEvent(600.0); Show(); } on_rez(integer p) { llResetScript(); } touch_start(integer n) { AskBoard(); } timer() { AskBoard(); if (gFeedQ == NULL_KEY) AskFeed(); } dataserver(key q, string data) { if (q == gBoardQ) { gBoardQ = NULL_KEY; if (llGetSubString(data, 0, 5) == "error:") { gAces = llGetSubString(data, 6, -1); Show(); return; } list lines = llParseString2List(data, ["\n"], []); gAces = ""; integer i; for (i = 1; i < llGetListLength(lines); ++i) { list f = llParseStringKeepNulls(llList2String(lines, i), ["|"], []); gAces += llList2String(f, 0) + ". " + llList2String(f, 1) + " - " + llList2String(f, 2) + " kills\n"; } if (gAces == "") gAces = "Nobody has shot anyone down yet."; Show(); } else if (q == gFeedQ) { gFeedQ = NULL_KEY; if (llGetSubString(data, 0, 5) == "error:") return; list lines = llParseString2List(data, ["\n"], []); integer i; for (i = 1; i < llGetListLength(lines); ++i) { list f = llParseStringKeepNulls(llList2String(lines, i), ["|"], []); if ((integer)llList2String(f, 0) > gFeedSeq || gFeedSeq == -1) { string who = llList2String(f, 2); if (who == "") who = "(nobody)"; gKills += [who + " downed " + llList2String(f, 4) + " (" + llList2String(f, 6) + ")"]; } } if (llGetListLength(gKills) > 5) gKills = llList2List(gKills, -5, -1); gFeedSeq = (integer)llList2String(lines, 0); Show(); AskFeed(); } } }