• strict warning: Non-static method view::load() should not be called statically in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_field_comment::init() should be compatible with views_handler_field::init(&$view, $options) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/modules/comment/views_handler_field_comment.inc on line 49.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc on line 13.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Non-static method view::load() should not be called statically in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
  • strict warning: Non-static method view::load() should not be called statically in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /home/ordinal/ordinalmalaprop.com/engine/sites/all/modules/views/views.module on line 906.

A Useful Script - "Mass Distribution by List of Names in a Notecard"

I recently had cause to distribute a number of items to a large number of people, whose names I was in possession of a list of, but not, of course, their keys.

The appalling lack of a useful llName2Key function unfortunately makes it a little challenging to send things out, but this is a problem that I have encountered before, and the obvious course of action is to

  1. put all of the items to be sent out into a prim;
  2. add a notecard containing the list of names to which these items are to be sent;
  3. add a script which simply goes through these names, queries one of the several "name2key" databases in existence, and, should it find an appropriate key, sends the items out.

For general use I include such a script herein.

In this I included features which tell one how many lines of the names notecard remain, and an estimate of the how much time remains, as well, though this may or may not be terribly accurate.

I am aware that it could be made considerably faster by the use of subscripts to send the inventory items, but that would make for a rather poor example script; I would prefer to keep the whole affair as simple as possible, in other words, in one script that is put into one prim. The introduction of inventory-giving subscripts is left as an exercise for the keen student.


As a further note, a future script using this sort of system to be published here will be a vendor that optionally sends the item to another person - in other words, a gift-giver that allows people to purchase copy/no-trans goods for others, which will allow those who had been forced to rely upon Xstreet for this the opportunity to abandon the dratted site.

Trackback URL for this post:

Schmobag Hogfather's picture
24 Jan201004:22
Schmobag Hogfather (not verified)

Thanks Ordinal! Looking at your code inspired me to create my own name2key service that's both fast and complete, so that LSL scripts don't have to go to such lengths to make sure they can get a key. Details are at http://schmo.gridshout.com/posts/2010/jan/23/one-name2key-service-rule-t... if you'd like to take a look.

Dedric Mauriac's picture
24 Jan201011:34
Dedric Mauriac (not verified)

I've done something like this too a little over three years ago. People just paste in a list of names into a note card. It runs through each name in the list and sends any inventory to each person as it resolves their names. I originally made it to distribute a holiday message to all of my past customers.


Peter Stindberg's picture
24 Jan201011:35
Peter Stindberg (not verified)

Dear Ordinal,

thank you for this very useful script. However allow me two points of input:

1) The most complete name2key database these days is - in fact - the official SL search. However it faces two obstacles. For once only avatars who have "publish on web" checked will appear on this search. More grave is the restriction that the SL search can't be queried from within SL itself it seems (at least last time I checked). So an external relay/proxy would be needed, which could also incorporate a failsafe to query the w-hat database in case the SL search fails.

2) Inventory transactions initiated from objects are very prone to fail under a lot of circumstances as I have pointed out in my blogpost Why inventory transactions fail and what you can do about it back in November. One could think of a "Mother of all inventory transfer scripts" which would apply certain tricks to query if an avatar is receptible for inventory transactions. In the meantime, people mass-sending inventory are well advised to keep the potential failure into consideration.


Fleep Tuque's picture
29 Jan201017:32
Fleep Tuque (not verified)

Thanks Ordinal! I just used this script and it worked like a charm!