Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Group Updatable Library Index

Padraig Stygian
The thin mick
Join date: 15 Aug 2004
Posts: 111
11-06-2005 01:08
I have noticed that there are several group-owned repositories of information throughout SL, and that most of them use one prim per notecard to dispense infomation, so that each group member can contribute. However, since one can stick notecards on other notecards, it seems silly not to have a single group-updatable index.

This is a dirty, dirty hackjob of just that sort of system. If anyone wants to write a cleaner one, please do.


Er... This is version 1.3. This one actually does what it's supposed to, as far as I can tell, and it also generates a new pseudo-random channel when it resets, so more than one can be set in a 20m^2 space, without them setting each other off.

CODE

string notecard;
key user;
integer gChannel;
integer handle;
default
{
state_entry()
{
notecard = llGetInventoryName(INVENTORY_NOTECARD, 0);
gChannel = llFloor(llFrand(999999));
}
touch_start(integer total_number)
{
user = llDetectedKey(0);
if(llSameGroup(user))
{
handle = llListen(gChannel,"",user,"");
llSetTimerEvent(30);
llDialog(user, "Welcome to the Treve Scribery filing system. This listen will expire in 30 seconds.",["Read", "Write"],gChannel);
}
else
{
llGiveInventory(user, notecard);
}
}
timer()
{
llSetTimerEvent(0);
llListenRemove(handle);
llAllowInventoryDrop(FALSE);
llDialog(user, "Time expired. Please touch the system again if you are not finished using it.",[],gChannel);
}
listen(integer channel, string name, key id, string message)
{
if (message == "Read")
{
llSetTimerEvent(0);
llGiveInventory(user, notecard);
}
else if (message == "Write")
{
llDialog(user, "Please drop the new index into the contents of this scroll rack. An index is a single notecard _containing_ all the notecards that should be filed under this heading.",[],gChannel);
llSetTimerEvent(60);
llAllowInventoryDrop(TRUE);
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY || CHANGED_ALLOWED_DROP)
{
llRemoveInventory(notecard);
llAllowInventoryDrop(FALSE);
llResetScript();
}
}
}
_____________________
(You): Aww! My pants won't rez! Does this texture look okay on me?

Incidental Radio :: Because nothing is by design
Now featuring Torley-tastic technomusic!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
discussion thread
11-09-2005 10:38
/54/3a/70734/1.html
_____________________
i've got nothing. ;)