Dumping information into Notecards - SLUniverse Forums
 
Navigation » SLUniverse Forums > Development Discussion and Support > Scripting » Dumping information into Notecards


Scripting Discuss scripting for SL and other platforms

Sponsor:
Vengeance Studio
Reply
 
LinkBack Thread Tools Display Modes
Old 05-11-2009, 09:23 PM   #1 (permalink)
Junior Member
Doing everything that makes a $L... and a few more... for waay too long
 
Join Date: May 2009
Posts: 14
My Mood:
Business: Jewell Designs
Question Dumping information into Notecards

Is there a way to dump information out of a script and into a notecard? I think it would be helpful for a few people who want to retain information for long periods of time.

For example: I want to build a multi-product vendor (will sell products A, B, C, D & E) and when I touch the vendor it will hand me a notecard that says something like:

Total Sales = XXXX
Total Revenue = XXXX

Sales since last report = XXXX
Revenue since last report = XXXX

Since last report:
Product A Sales = XXXX
Product A Revenue = XXXX
...
Product E Sales = XXXX
Product E Revenue = XXXX

[Script then resets the 'since last report' info and retains Totals info]

Now I saw on another thread you can dump information into item descriptions, but I'd really like to be able to dump it into a notecard.

I understand there is an "option B" to have it email me, but to get a daily dump in an email I would want to have a "once per day timer" that works without lagging the crap out of my landlord's server.
Alison22.Jewell is offline   Reply With Quote
Old 05-11-2009, 09:31 PM   #2 (permalink)
bunneh extraordinaire
 
Fox Stirling's Avatar
Can't sleep, furries will eat me..
 
Join Date: Sep 2007
Location: At home of course! Don't be silly.
Posts: 1,104
My Mood:
SL Join Date: 08/16/2004
Business: Stirling Tech
Send a message via AIM to Fox Stirling
Unfortunately no, this is something a lot of us have been asking for, for years. If you need to store information like that, and produce reports, the best bet (IMO) is to use an external database and send the data via http requests. There are a few examples available on the wiki, and here I think. If you want to take this route and are having a hard time finding the info on it, ping me in world and I'll send you some lsl and php examples to make it all work. (I should probably post those up here at some point if no one else has..)
Fox Stirling is offline   Reply With Quote
Old 05-11-2009, 09:39 PM   #3 (permalink)
Backroom Bureaucrat
 
Gigs's Avatar
Is it wicked not to care?
 
Join Date: Jul 2007
Posts: 4,975

Awards: 1
Thread Title of the Week 
Notecards are assets, and assets are immutable.

When you save a notecard, it actually means there's now two copies of the notecard on the server.

Linden Lab does not want to allow automated creation of assets.

The reason you can store stuff in an item description... it's because the item is not an asset until someone takes it back into their inventory.
__________________
-
-
"It is the paramount duty of governments and of politicians to secure the wellbeing of the community under the case in the present, and not to run risks overmuch for the future" - JM Keynes
Gigs is offline   Reply With Quote
1 User Agreed:
Old 05-11-2009, 10:59 PM   #4 (permalink)
Junior Member
Doing everything that makes a $L... and a few more... for waay too long
 
Join Date: May 2009
Posts: 14
My Mood:
Business: Jewell Designs
Yeah I was never looking for it to create the notecard in my inventory and update it. Much closer to "It holds all the info in itself and then when I touch it, it dumps it into a note and gives me the note".

Side thought: Could you potentially do this with multiple scripts and get an info feed from in an IM?

VendorScript registers sale of ProductA and tells ProductAScript "Sale event". ProductAScript then basically does "Sales = Sales +1; Revenue = Revenue + ProductAPrice" (It can get the prices from the Config Notecard).
...
...
Owner touches Vendor and chooses menu option "Sales Report" (instead of maybe "Reset Report" or "Not For Sale" or "Make Free")

Vendor then gets information from ProductAScript...ProductNScript and dumps into a big IM.

Does that sound like it would store all of the information or would server resets clear that information out?
Alison22.Jewell is offline   Reply With Quote
Old 05-11-2009, 11:31 PM   #5 (permalink)
bunneh extraordinaire
 
Fox Stirling's Avatar
Can't sleep, furries will eat me..
 
Join Date: Sep 2007
Location: At home of course! Don't be silly.
Posts: 1,104
My Mood:
SL Join Date: 08/16/2004
Business: Stirling Tech
Send a message via AIM to Fox Stirling
Quote:
Originally Posted by Alison22.Jewell View Post
Yeah I was never looking for it to create the notecard in my inventory and update it. Much closer to "It holds all the info in itself and then when I touch it, it dumps it into a note and gives me the note".

Side thought: Could you potentially do this with multiple scripts and get an info feed from in an IM?

VendorScript registers sale of ProductA and tells ProductAScript "Sale event". ProductAScript then basically does "Sales = Sales +1; Revenue = Revenue + ProductAPrice" (It can get the prices from the Config Notecard).
...
...
Owner touches Vendor and chooses menu option "Sales Report" (instead of maybe "Reset Report" or "Not For Sale" or "Make Free")

Vendor then gets information from ProductAScript...ProductNScript and dumps into a big IM.

Does that sound like it would store all of the information or would server resets clear that information out?

A server reset would most likely clear that out.. If you're only looking to track small amounts of data, like number of sales and total revenue, you can just update the object's description with each sale. If you're looking to track individual items, the external db method is pretty much your only solution aside from e-mails or ims with manual tracking.
Fox Stirling is offline   Reply With Quote
Old 05-12-2009, 02:13 AM   #6 (permalink)
The Purple
 
Chalice Yao's Avatar
Kinda at work. Somewhat.
 
Join Date: Dec 2007
Location: Somewhere purple, Germany
Posts: 3,538
My Mood:
The main issue why they are not implementing being able to write into a notecard is pretty much potential asset abuse. Using hundreds of objects, even if the function had a delay, you'd be able to rapidly write data to the asset servers en masse, even more so that you can already do with objects and sim edges. It would be very very ebil. Sadly :<
__________________
"Have you ever noticed that anybody driving slower than you is an idiot, and anyone going faster than you is a maniac?" - George Carlin
Chalice Yao is offline   Reply With Quote
Old 02-12-2010, 04:31 AM   #7 (permalink)
Junior Member
 
Madpeter Zond's Avatar
Networked systems coder
 
Join Date: Feb 2010
Posts: 21
My Mood:
Note: you can write to notecard via a bot and then have the bot remove the old notecard from the object and replace it with the new one. <_< but a SQL database would give to access to so much more detail.
__________________
Quote:
Topic: Griefer Groups Claim Moles in the JLU
more interesting from a sociological standpoint than it is worrisome from a security standpoint.
I believe it's due partially to people not understanding the incredible levels of security the League maintains
I lol'd when I read this, I do hope its not fake.
Madpeter Zond is offline   Reply With Quote
Old 02-12-2010, 04:44 AM   #8 (permalink)
Jack of a few Trades
 
WarKirby Magojiro's Avatar
Happles!
 
Join Date: Sep 2007
Location: Glasgow, Scotland
Posts: 3,261
My Mood:
SLShopper Ads: 1
SL Join Date: 14/10/2006
Business: MagoTek Industries
nostalgia attack D:

I miss fox
__________________
Quote:
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

-Robert A. Heinlein
WarKirby Magojiro is offline   Reply With Quote
1 User Agreed:
Old 02-12-2010, 05:24 AM   #9 (permalink)
exp(ln(Gearhead))
 
Aodhan McDunnough's Avatar
 
Join Date: Jun 2007
Location: Philippines
Posts: 6,394
My Mood:
SLShopper Ads: 2
SL Join Date: March 28, 2006
Business: Aodhan's Forge
Blog Entries: 2
I would much prefer the external solution (SQL database outside SL), this way at least if some rollback or other asset disaster happens your data is still safe.

I'm ok with not being able to write notes for the simple matter that given the ability, people WILL abuse it, as they have done just about everything else that's abusable.
Aodhan McDunnough is offline   Reply With Quote
Old 02-12-2010, 07:36 AM   #10 (permalink)
Not as dumb as I look
 
Rolig Loon's Avatar
More coffee, please
 
Join Date: Sep 2009
Location: In a TP
Posts: 30
SL Join Date: March 2007
You can't write to a notecard, but you can certainly write to variuos fields in a prim, like its name and object description. You can also encode information in color parameters on each of its faces. Each of those changes will survive a reset, so they are as permanent as the prim is.
__________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....

Look for my work in XStreetSL at https://www.xstreetsl.com/modules.p...erchantID=65868
Rolig Loon is offline   Reply With Quote
Old 02-13-2010, 03:49 AM   #11 (permalink)
Junior Member
 
Madpeter Zond's Avatar
Networked systems coder
 
Join Date: Feb 2010
Posts: 21
My Mood:
Quote:
Originally Posted by Rolig Loon View Post
You can't write to a notecard, but you can certainly write to variuos fields in a prim, like its name and object description. You can also encode information in color parameters on each of its faces. Each of those changes will survive a reset, so they are as permanent as the prim is.
-
Note:
you can write to notecard via a bot.
writing the the name and discription is semi permanent, as a roll back or sim crash can make them incorrect.
Madpeter Zond is offline   Reply With Quote
Old 02-13-2010, 03:57 AM   #12 (permalink)
Senior Member
 
bladyblue's Avatar
Watching the pandering mob
 
Join Date: Jul 2007
Posts: 876
My Mood:
SL Join Date: February 2005
Business: CLUB SCHOOL
Send a message via MSN to bladyblue Send a message via Yahoo to bladyblue Send a message via Skype™ to bladyblue
Linden Lab really needs to put a serious team of developers on the task of developing an dynamic notecard. This item would be a better premium perk than the hobbit houses being offerred. The same notecard since 2002. Inconceivable!
__________________


http://slurl.com/secondlife/Bear/214/199/107
Join the open enrollment group CLUB JOBS for free job search.

http://drasticNCIchanges.blogspot.com/
bladyblue is offline   Reply With Quote
Old 02-13-2010, 07:51 AM   #13 (permalink)
Not as dumb as I look
 
Rolig Loon's Avatar
More coffee, please
 
Join Date: Sep 2009
Location: In a TP
Posts: 30
SL Join Date: March 2007
Quote:
Originally Posted by Madpeter Zond View Post
-
Note:
you can write to notecard via a bot.
writing the the name and discription is semi permanent, as a roll back or sim crash can make them incorrect.
That's why I said "as permanent as the prim is." Name and Description fields usually survive a sim crash or rollback, but the way to be sure is to always take a copy after you update the information in those fields. That way, the asset servers have the updated information and you can always create a new, uncorrupted copy by dragging it from Inventory. Well.... as long as SL's asset servers don't screw up ...

It's also possible to store some kinds of information in other prim attributes like prim color. With the same warning about taking a copy after updating, these too are fairly robust. In the end, the safest way to store important information is to copy it out of SL altogether. Use llHTTP* commands to communicate with an external server and keep your data in a database there. It's all a matter of how important your info is and how paranoid you are.
Rolig Loon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On