Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

script to list contents of a prim

robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
01-31-2009 19:48
What i would like to see is a script that can list the contents of a prim (line by line in chat)

for extra fun it would help if the script could

1 not list any scripts in the prim
2 where %item% exists and %item%_t or %item%_i exists list on a single line
%item%_t:%item%;%item%_i
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-31-2009 21:31
See http://lslwiki.net/lslwiki/wakka.php?wakka=llGetInventoryName. You ought to get some ideas about how to write what you want there.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
01-31-2009 22:42
You mean something like this?

/54/a4/301355/1.html
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
okay the tree i want exists
02-01-2009 10:06
Would somebody help me find the tree i want in the forest?
I can barely hold a complier by the correct end
Taff Nouvelle
Virtual Business Owners
Join date: 4 Sep 2006
Posts: 216
02-01-2009 10:08
have a look at a free give all inventory items script, that has basically what you need in it.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-01-2009 12:42
From: robertltux McCallen
Would somebody help me find the tree i want in the forest?
I can barely hold a complier by the correct end


Are you looking for a tree or an intricate wood carving?
You asked for a function that would return a list of inventory that matches a mask, The tree is there and carved into planks for you. Now glue it back together in the shape you want :)
The Wiki is the glue you need, have fun.
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
maybe if i could talk to a carpenter??
02-01-2009 13:13
the wiki function DOES NOT WORK AS SHOWN

a direct cut and paste of the function into a new script will not compile the linked posting just about throws the whole lumber department of Lowes at me and does not seem to address a simple listing of the contents of a prim

maybe if you wouldn't mind you could walk me through a working script??
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-01-2009 13:41
Did you try the script I posted above, it is a working script and is documented. give it a try, and as it says, try adding and removing inventory and watch chat, from that and reading the code you will see the basic operation, and can the create your own handlers in default state to get the reports you need.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-01-2009 13:46
Take a look at the example at http://lslwiki.net/lslwiki/wakka.php?wakka=ExampleGetNewInventoryName . It's aimed in a slightly different direction than you are, but I think you'll get the idea by reading through it. With a little pruning to customize it, you'll be able to write what you want.
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
02-01-2009 14:05
From: Very Keynes
Did you try the script I posted above, it is a working script and is documented. give it a try, and as it says, try adding and removing inventory and watch chat, from that and reading the code you will see the basic operation, and can the create your own handlers in default state to get the reports you need.



I got the script and it does do what i need but i need some help isolating the function that lists the inventory from the rest of the circus
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-01-2009 14:13
Ok great, if you want to make an attempt at what you need or give a fuller description we can then build on it. You don't need to Extract anything from the function library as such, rather treat it as an include file and use the function calls in your code, rather than cutting chunks out of the library code.
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
02-01-2009 14:49
From: Very Keynes
Ok great, if you want to make an attempt at what you need or give a fuller description we can then build on it. You don't need to Extract anything from the function library as such, rather treat it as an include file and use the function calls in your code, rather than cutting chunks out of the library code.

okay as it stands the output from the script gives me

Crystal Mystics: Listing Inventory = sm.Cystal Mystic Fountain of Youth and Tree of Wisdom, med.Cystal Mystic Fountain of Youth and Tree of Wisdom, Fairy Flower Fountain_t, FAIRY FLOWER FOUNTAIN, Fairy Bird bath_t, Fairy Bird Bath, Earth Fountain_t, Earth Fountain BOXED, default_ps, Cystal Mystic Fountain of Youth and Tree of Wisdom, Crystal Mystic Magic Goblet, CMFOY and TOW_t, CMFOY and TOW sm_t, CM Goblet, _JEVN_SUI, _JEVN_S3, _JEVN_S2, _JEVN_S1, _JEVN_QB, _JEVN_PS, _items, _inventory list, _config_ps, _config

what i need to land up with is each item on a separate line and exclude any items beginning in _ if you look at the list there is an item fairy bird bath and an item fairy bird bath_t items like this if possible need to be on a single line separated by a ;

the script as it stands saves me a lot of retyping

just as a reference this is where the output would land up

#price ; texture name ; item name ; item info object; description ; group price; category; limited; info type
100;Earth Fountain_t;Earth Fountain BOXED;;Fountain with Spinning Earth;
500;CMFOY and TOW_t;Cystal Mystic Fountain of Youth and Tree of Wisdom;;Fountain of Youth large;
100;CMFOY and TOW sm_t;sm.Cystal Mystic Fountain of Youth and Tree of Wisdom;;Fountain of Youth small;
300;CMFOY and TOW sm_t;med.Cystal Mystic Fountain of Youth and Tree of Wisdom;;Fountain of Youth Medium;
50;Fairy Flower Fountain_t;FAIRY FLOWER FOUNTAIN;;Fairy Fountain;
50;Fairy Bird bath_t;Fairy Bird Bath;;Fairy Bird bath;
250;CM Goblet;Crystal Mystic Magic Goblet;;CM Magic Goblet;

it would be cool if this ended up as a jevn server addon
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-01-2009 15:15
Ok I realise this will possibly be out of your depth for now, but the output you are looking for is perfect for another of my libraries, take a look at /54/4a/290413/1.html

and follow the documentation link. It is 1:15am here so I beter get some sleep, but will look at your stuff tomorrow and try give you a test script. As for Jevin, when I finish my DanceMaster project I will have a look at building a vendor that does what you need, I may be able to use it myself.