[Opensim-users] Retrieving inventory items
Jeff1564
jefersonc at gmail.com
Sat Sep 26 16:56:42 UTC 2009
Hello folks,
I am playing with some bots here but when i try retrieve the inventory items
from the bot I just get the folders and no items bellow is an example code:
private Inventory Inventory;
private void button1_Click(object sender, EventArgs e)
{
Inventory = Client.Inventory.Store;
InventoryFolder rootFolder = Inventory.RootFolder;
List<InventoryBase> contents =
Client.Inventory.Store.GetContents(rootFolder);
foreach (InventoryBase i in contents)
{
if (i is InventoryFolder)
{
InventoryFolder folderr = (InventoryFolder)i;
List<InventoryBase> contentss =
Client.Inventory.Store.GetContents(folderr);
if (contentss.Count > 0)
{
foreach (InventoryBase ii in contentss)
{
if (ii is InventoryFolder)
{
MessageBox.Show("This is a folder: " +
ii.ToString());
}
if (ii is InventoryItem)
{
MessageBox.Show("This is an Item: " +
ii.ToString());
}
//MessageBox.Show("is > 0 " +
contentss.ToString());
}
}
//MessageBox.Show(i.ToString());
}
if (i is InventoryItem)
{
MessageBox.Show("I am an Item: " + i.ToString());
}
}
}
what am i doing wrong??? there is a trick to retrieve items??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20090926/0dd9b1b0/attachment.html>
More information about the Opensim-users
mailing list