Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Cleaning out my note pad & found some questions to ask...

Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
12-21-2005 12:17
Is there any way to call a note card that is located in an object by its UUID, edit it and then save it back to that object? My guess is that this is not possible. I could possibly get a copy... I am thinking of a personal note maker. I have seen "answering Machines" and "Memo Pads" that record your chat and do some other fancy stuff, but all I want is to open a note card, write and then hit save. I don't want to edit an object and then double click on the note to do this. I could also keep a note card in my inventory and do a quick search... Just wondering if it is possible?

Can an item be renamed or have it's description changed as it is or after it has been dropped onto an object? Possibly add the creators name and the current date? Maybe read the first few lines once it is dropped and then rename?

Is there a way to drop an item (note card) onto an object and have it replace a note card that is already in its inventory. Think of keeping the latest version of something in an object. I don't want to rename it or delete the old versions. I know that if I drop something with the same name it is renamed with a number at the end. That would be ok if when I click the object I get the "newest" note card or script or whatever.

Last one that I have not gotten around to... I am looking for a dirty little script that will detect a key, but can be turned on and off by me via chat (I know I know nobody likes chat) Private chat is fine. I am sure this is easy, but I keep forgetting to try it. I am assuming someone has this already, but I did not find it with a quick search of the forums.

Thanks,

Sydney
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
12-21-2005 12:45
1) No, you cannot get a script to write to a notecard...though it would be nice.

2) You can rename an object with an llSetObjectName. I've actually found this function quite useful several times--especially in making my object vendors user friendly for set-up.

3) To have an object read only the latest version of a notecard that is always named the same...just:

CODE

string readnote = llGetInventoryName(INVENTORY_NOTECARD, llGetInventoryNumber(INVENTORY_NOTECARD));


4)

CODE


integer handle;

default
{
state_entry()
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
on_rez(integer params)
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
if(message == "say key") llSay(0, (string)llGetKey());
if(message == "say owner key")llSay(0, (string)id);
}
}
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
12-21-2005 13:43
Kenn... You Rock!


From: Kenn Nilsson
1) No, you cannot get a script to write to a notecard...though it would be nice. <--- understood. What about opening a note card via UUID no matter where it is located?

2) You can rename an object with an llSetObjectName. I've actually found this function quite useful several times--especially in making my object vendors user friendly for set-up. <--- Oh NEAT! I will have to play with this a little.

3) To have an object read only the latest version of a notecard that is always named the same...just: <--- OK I get this but how do I deal with the fact that dropping a note card on an oject that already has a note card with that name will rename the new card to notecard 1? (at least I think it does) It looks like you are grabbing the latest one in the list with llGetInventoryNumber? So as long as I have all note cards that are just appended with a number I should be fine?

CODE

string readnote = llGetInventoryName(INVENTORY_NOTECARD, llGetInventoryNumber(INVENTORY_NOTECARD));


4) Thank you! I will give this a go when I get home!

CODE


integer handle;

default
{
state_entry()
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
on_rez(integer params)
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
if(message == "say key") llSay(0, (string)llGetKey());
if(message == "say owner key")llSay(0, (string)id);
}
}
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
12-21-2005 14:03
After looking at this in my head I see it will give me the objects key and the owners key. What I am going for is the person who clicks the object. I am wanting to then save that to the description of the object to be pulled by another script. I am wanting to set this and then turn it off so it is no being reset everytime it is clicked.

Example application--- "Who's online board in a club" Each employee or boss could switch on the listener, the emplyee clicks and sets the indicator to their key. The listener is turned off untill needed again. Still like your script though Would be great used in the Santa Server 1.0 :)

From: Kenn Nilsson


4)

CODE


integer handle;

default
{
state_entry()
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
on_rez(integer params)
{
llListenRemove(handle);
handle = llListen(99, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
if(message == "say key") llSay(0, (string)llGetKey());
if(message == "say owner key")llSay(0, (string)id);
}
}
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
12-21-2005 17:26
1) I'm really not quite qualified to give you the best answer to your return question on notecards...but it's my understanding that so long as you have the key of something in SL, it can be utilized from nearly anywhere...

3) Yes...I'm just grabbing the last notecard in inventory...and since they number up...the newest will always be the last in inventory...I like tryin' to make any inventory-grab non-specific to name...makes things easier.

Ahhhh...gotcha Sydney...in the case of a club, it would probably be best to simply save the key within the script internally...

CODE


integer getkey;
integer handle;

key employeekey;



touch_start(integer number)
{
if(llDetectedKey(0) == llGetOwner())
{
llListenRemove(handle);
llListen(99, "", llGetOwner(),"");
llDialog(llGetOwner(), "Please Select an Option: ", ["Get Key", "Off"], 99);
llSetTimerEvent(15);
}
if(getkey = 1)
{
employeekey = llDetectedKey(0);
llInstantMessage(llGetOwner(0), "Your employee " + llKey2Name(employeekey) + " has registered with employee board " + llGetName());
}
}
listen(integer channel, string name, key id, string message)
{
llSetTimerEvent(0);
llListenRemove(handle);
if(message == "Get Key")
{
getkey = 1;
llInstantMessage(id, "Board will now capture the key of the next person to touch it.");
}
if(message == "Off")
{
getkey = 0;
llInstantMessage(id, "Board will no longer capture avatar keys.");
}
}
timer()
{
llListenRemove(handle);
llSetTimerEvent(0);
llInstantMessage(llGetOwner(), "You have not made a selection within the required time-limit. If you wish to make a selection, please bring up a new dialog box.");
}



I'm just writin' all this stuff quick and dirty while replying to you...if you want somethin' that's nice and clean and works well, contact me in game.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
12-21-2005 18:11
Hi Kenn-

Ok #3 - You have there a llGetInventory... I am needing a llGiveInventory. I want the newest "note" to be handed to the owner of the object when clicked. I tried this:

CODE
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD, llGetInventoryNumber(INVENTORY_NOTECARD)));


But I get this error message: "TEST 1.0: Unable to give inventory: No item named ''
I am sure it is silly, but looking at the wiki I can't seem to find my mistake...

From: Kenn Nilsson
1) I'm really not quite qualified to give you the best answer to your return question on notecards...but it's my understanding that so long as you have the key of something in SL, it can be utilized from nearly anywhere... Understood. After reading some more I don't think this is an option.

3) Yes...I'm just grabbing the last notecard in inventory...and since they number up...the newest will always be the last in inventory...I like tryin' to make any inventory-grab non-specific to name...makes things easier. PERFECT. This will work if I can get it to give the newest note card and allow me, the owner, to drop that altered card back in. Would be nice to delete the oldest after it reaches so many...

Ahhhh...gotcha Sydney...in the case of a club, it would probably be best to simply save the key within the script internally... Oh yet another nice script... I will shoot you an IM in SL and give you more detail. The example was just that.. an example. ;)

CODE


integer getkey;
integer handle;

key employeekey;



touch_start(integer number)
{
if(llDetectedKey(0) == llGetOwner())
{
llListenRemove(handle);
llListen(99, "", llGetOwner(),"");
llDialog(llGetOwner(), "Please Select an Option: ", ["Get Key", "Off"], 99);
llSetTimerEvent(15);
}
if(getkey = 1)
{
employeekey = llDetectedKey(0);
llInstantMessage(llGetOwner(0), "Your employee " + llKey2Name(employeekey) + " has registered with employee board " + llGetName());
}
}
listen(integer channel, string name, key id, string message)
{
llSetTimerEvent(0);
llListenRemove(handle);
if(message == "Get Key")
{
getkey = 1;
llInstantMessage(id, "Board will now capture the key of the next person to touch it.");
}
if(message == "Off")
{
getkey = 0;
llInstantMessage(id, "Board will no longer capture avatar keys.");
}
}
timer()
{
llListenRemove(handle);
llSetTimerEvent(0);
llInstantMessage(llGetOwner(), "You have not made a selection within the required time-limit. If you wish to make a selection, please bring up a new dialog box.");
}



I'm just writin' all this stuff quick and dirty while replying to you...if you want somethin' that's nice and clean and works well, contact me in game.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
12-21-2005 20:42
Hmmm...lemme check things out in game for you...
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.