so what is a Storage Cube?
It is a simple, though not simplistic, data storage device that acts as a small, multi user, multi table database to store and retrieve information, and uses chat channels to interact with users or other objects.
to try it out:
Create a cube, or any other shape for that matter.
Set the object description to show the default operating Channels, in the format, NetCh, PubCh, OutCh.
Where:
NetCh is the network channel your Objects will talk on.
PubCh is the Channel that Avatars will talk on.
OutCh is The channel used in response to a command on the PubCh.
example: -123, 99, 0
will listen for commands from other objects on -123 and will reply on -123
will listen for commands from Avatars or objects on /99 and will respond in open Chat.
NOTE: if either NetCh or PubCh are set to 0, no listen will be created for that channel.
Drop this script into the cube (or object).
The forums are refusing to accept code from me, yet again, so please use this link to get the code. I will update here later if I can.
http://docs.google.com/Doc?id=d79kx35_94f6c2sndd
The Following commands are supported:
new( table, column list )
Example: /99 New(test, col1, col2, col3)
will create a table called "test" with 3 columns called "col1", "col2" and "col3" respectively.
You may create as many tables as you wish to in a single cube so one cube can store data for several objects.
ins( table, data list )
Example: //ins(test, a,b,c)
will inset the values a, b and c into columns "col1", "col2" and "col3" respectively.
find(table, condition list)
Example: find(test, col1, ==, a)
will find and return the row number of the first row that contains "a" as the value of "col1".
get( table[, row#])
Will return a CSV list of the data in the specified Row.
Example: get(test, 1) will return "a, b, c"
if no row number is specified it returns all data including the column names one row at a time.
del( table[, row#] )
Example //del(test, 1)
will delete row 1 from the table.
Note: If the Row Number is omitted this command deletes the entire table.
put( table, row#, data list)
will replace the contents of the specified row with the data
Example: put(test, 1, A, B, C)
will replace Row 1.
cat
will dump the Index List to the Output in the format:
start, table name, cols, rows, length
and is provided for information only, the index may not be directly manipulated.
for more extensive documentation see:
http://docs.google.com/Doc?id=d79kx35_26df2pbbd8