I've been scripting for a couple weeks now and am sorta slowly working through examples and common tasks people do...in order to 'learn by doing'.
My last little project was to create an object that holds several animations, and then to be able to type in a command to cause friend's avatars nearby to be able to perform those animations.
For example...I might have the following animations loaded into my object which I then 'attach': dance1, jumpUpandDown, stompfeet, bow
So, if I was surrounded by 4 friends....I could cause my device to have one friend perform dance1, another friend perform jumpUpandDown, another do stompfeet, and another bow.
I guess the idea here is to be 'remote controlling' my friend's avatars.
So far I was able to get a simple version of this script to work (Yay for me!

However, now I'm sorta going back through and finding better ways to do things.
My question is this:
What is the best way to animate another person's avatar with an animation in the object you are wearing....and to do so with multiple avatars...so...for example...you might use a command-line interface to type something like this:
/90 "Bob Odets" dance1 <--- Cause Bob Odets to begin to animate the dance1 animation that I have in my object.
So far, in my script in its 'primitive' form I've been using a sensor to detect avatars in my immediate area, then using llDetectedName to retrieve their names and compare those names to my friends...to make sure that I don't attempt to animate anyone who wasn't intended, then use llDetectedKey to retrieve the avatars key and feed that to llRequestPermissions to get permissions to animate that avatar.
So, right now, my script can't animate others based on a command-line specification...only those that are within the sensor distance and those that I hard-code in the script.
I'm wondering if there is a better, or more efficient way to do this?
The hard part for me was figuring out how to get the target avatars key in order to request their permissions....and then on top of that...figuring out how to tell Second Life exactly WHICH avatar was my target.
So any advice, pointers, or help in those areas would be greatly appreciated. Thanks!