Skip to content

Instantly share code, notes, and snippets.

@sl-service-account
Created January 24, 2024 00:48
Show Gist options
  • Save sl-service-account/da684a2af7cea9f6e0d090602ab56ffe to your computer and use it in GitHub Desktop.
Save sl-service-account/da684a2af7cea9f6e0d090602ab56ffe to your computer and use it in GitHub Desktop.
string NOTECARD_NAME = "notecard";
key gLineCountId;
default {
state_entry() {
// Request number of notecard lines.
gLineCountId = llGetNumberOfNotecardLines(NOTECARD_NAME);
}
dataserver(key id, string data) {
if (id != gLineCountId) { return; }
integer count = (integer)data;
integer i;
for (i = 0; i < count; ++i) {
string line = llGetNotecardLineSync(NOTECARD_NAME, i);
if (line == EOF) {
llOwnerSay("---EOF---");
}
else if (line == NAK) {
llOwnerSay("---NAK---");
}
else {
llOwnerSay(line);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment