Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetRemoteScriptAccessPin / llRemoteLoadScriptPin Question

Burnman Bedlam
Business Person
Join date: 28 Jan 2006
Posts: 1,080
06-20-2006 10:11
Does anyone have a basic example of a *working* use of llSetRemoteScriptAccessPin & llRemoteLoadScriptPin? I spent a couple of hours last night trying to figure out why my stupid sphere accused me of illegally trying to load a script into my cube. Yes... the error message said "illegally". After a good chuckle, I resumed banging my head on my desk.

I know I am most likely missing something rediculously obvious, so any help would be appreciative. I know I am not providing much information here, but I am at work and unable to access my SL viewer.
_____________________
Burnman Bedlam
http://theburnman.com


Not happy about Linden Labs purchase of XStreet (formerly SLX) and OnRez. Will this mean LL will ban resident run online shoping outlets in favor of their own?
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
06-20-2006 10:27
This is for two or more objects - 1st goes in all ( possibly except root prim )

Second goes in the root where you keep the script you want to distribute

( I use something similar when updating a large linked object with a common script )

CODE


//
// Set the pin and delete the script
//

integer pin = 123456789;

default
{
state_entry()
{
llSetRemoteScriptAccessPin( pin );
llRemoveInventory ( llGetScriptName() );
}
}


//
// 2nd script
// loads scrpt into all linked prims
//

string script_name = "a script" ;
integer pin = 123456789 ;
integer start_param = 0;

default
{
state_entry()
{
integer idx = 2;
for ( idx = 2;idx <= llGetNumberOfPrims() ; idx++ )
{
llRemoteLoadScriptPin( llGetLinkKey( idx ),
script_name,
pin,
TRUE,
start_param);
}
}
}



Uncompiled so excuse the syntaxes
_____________________
Maker of quality Gadgets
Caligari Designs Store
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
06-20-2006 10:29
From: Burnman Bedlam
I know I am most likely missing something rediculously obvious, so any help would be appreciative.

It's possible you're trying to load script into a child prim of a set, that doesn't actually have the PIN active? (because say, the script setting the PIN is located in another prim)

as far as basic usage goes, this works for me:

llSetRemoteScriptAccessPin( update_pin );

in script placed in target prim then:

llRemoteLoadScriptPin( update_client, "script", update_pin, TRUE, 0 );

in the updating script. update_client is UUID of target prim, "script" is name of script to upload, update_pin is an integer that is the same in both scripts...
Burnman Bedlam
Business Person
Join date: 28 Jan 2006
Posts: 1,080
06-20-2006 12:31
Thank you both, I think I see where I pooched it up :)

I'll give it a shot when I get home. :D
_____________________
Burnman Bedlam
http://theburnman.com


Not happy about Linden Labs purchase of XStreet (formerly SLX) and OnRez. Will this mean LL will ban resident run online shoping outlets in favor of their own?
Burnman Bedlam
Business Person
Join date: 28 Jan 2006
Posts: 1,080
06-20-2006 17:22
Nope... still no luck. It's rather odd, if I create 2 unlinked prims, I can get one to pass a script to the other. But when I try to add the same exact code to my existing project... I get the following error:

From: someone
Object: Task Object trying to illegally load script onto task BVS: Test Sphere!


What the heck is THAT about?? lol

It works with fresh prims, but for some reason, the exact same code doesn't work when I try to add it to my project. I am positive I have the right key for the receiving prim, I am positive that the pin is the same in both scripts... and yet... illegally loading?
_____________________
Burnman Bedlam
http://theburnman.com


Not happy about Linden Labs purchase of XStreet (formerly SLX) and OnRez. Will this mean LL will ban resident run online shoping outlets in favor of their own?
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
06-20-2006 17:41
From: Burnman Bedlam
It works with fresh prims, but for some reason, the exact same code doesn't work when I try to add it to my project. I am positive I have the right key for the receiving prim, I am positive that the pin is the same in both scripts... and yet... illegally loading?

I've just tested this procedure with two prims linked in a set, and it worked both ways for me (updater in root and the prim to be updated being a child, as well as the other way around) ... i got the exact error while trying it again, but this time with PIN in destination prim reset back to 0. So suspect this may be a mis-match of PINs after all? ^^;;
Burnman Bedlam
Business Person
Join date: 28 Jan 2006
Posts: 1,080
06-20-2006 17:55
From: Joannah Cramer
I've just tested this procedure with two prims linked in a set, and it worked both ways for me (updater in root and the prim to be updated being a child, as well as the other way around) ... i got the exact error while trying it again, but this time with PIN in destination prim reset back to 0. So suspect this may be a mis-match of PINs after all? ^^;;


Ah yes... I found the error. When I copied and pasted the pin from the test prims I had success with, I missed a number. I told you it would be something simple. :)

Thank you much for your help! :D
_____________________
Burnman Bedlam
http://theburnman.com


Not happy about Linden Labs purchase of XStreet (formerly SLX) and OnRez. Will this mean LL will ban resident run online shoping outlets in favor of their own?