(Not-Quite) Notecard Generation
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-17-2006 01:21
I know notecard generation is wanted by tons and tons and tons of scripters. So, I have already asked LL about it ( /139/2e/127998/1.html), and it has been acknowledged as a possibility! Here is my proposal, draft #1: From: someone This has ALREADY BEEN ACLNOWLEDGED AS A POSSIBILITY BY LL! See /139/2e/127998/1.html. We all want to generate notecards from LSL. Why? Automatically generated notecard content. Quick-save a log or debug info without spamming chat. Save script state as a configuration notecard for after reset or new scripts/objects. Most requests for notecard generation are shot down because LL understandably doesn't want tons and tons of database assets created by scripts. So here is one that doesn't have that problem. When you create a new notecard in the current system, no actual asset is created until you add some characters and hit the 'Save' button. If an LSL script could send notecard text directly to a client WITHOUT creating an asset, it would allow the user to get a screen of text, and no database entries would be created until the user manually hit the 'Save' button. This creates a nice user interface for displaying stand-alone info to the user and eliminates the step of having to copy-paste-edit everything from the chat window. Here is my idea for the specification: llSendAgentNotecardData(key id, string name, string description, string contents) id - The UUID of the agent to which to send the proposed notecard (must be in same sim as this object). name - The name the notecard will have in the user's inventory if the user hits 'Save'. description - The description for the proposed notecard (the UI allows this to be changed in an open notecard, so it is only a useful suggestion to the user). contents - The text contents of the notecard. The user is free to change this before hitting the 'Save' button. Your feedback is appreciated. I want to revise it and create a solid feature proposal for voting in one week.
|
|
Nargus Asturias
Registered User
Join date: 16 Sep 2005
Posts: 499
|
09-17-2006 05:22
that sound good!  No scripter would want tons and tons of notecard window on their client either  Um...I believe this ability should need permission though. Last thing I want is another way to generate spam 
_____________________
Nargus Asturias, aka, StreamWarrior Blue Eastern Water Dragon Brown-skinned Utahraptor from an Old Time
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
09-17-2006 12:47
While this is a step in the right direction, I'd like the ability for my scripts to write to a notecard that it can then later read itself. Why? Massive data. Take a lottery for example, how many people enter? Hundreds? Lets go with that. How much memory does a UUID take up? About 150 bytes. Add script size and a little overhead for variables and a script can store a whopping 82 entries (the 83rd caused a memory heap overflow in the script I made and citing as an example).
82! And I wanted to get HUNDREDS if not THOUSANDS of people to play.*
I had to resort to storing 50 names and ticket numbers and emailing them to myself where I would pick them up, copy, log in, go to my object, open it, open the notecard, scroll to the bottom, and paste. This is a waste of my energy, the script should be able to save those names to some kind of permenent storage accessible by itself or another script.
*It is a powerball style lottery. If you'd like to buy a ticket, IM me inworld and I can give you a landmark. Tickets are L$2.
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
Store your lottery outside SL.
09-17-2006 14:31
If you want a huge database of people involved in a lottery, there really is no option other than storing it outside SL.
Your script can use HTTP to store the data and initiate an RPC to query it.
A notecard with thousands of entries would take insanely long to go through. LSL is not SQL.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-17-2006 14:35
Indeed. The problem is that LL has said they will NOT supply a function for creating a notecard automatically. While they are supposedly investigating the possibility of some other kind of persistant storage for scripts, this would I'd think be a happy alternative in the meantime, and would also do more than allow persistent storage: it would allow you to give nice, packaged, but dynamically generated info to other people. It would allow the same kind of thing being done by copy/paste from e-mail or chat, but without some of the steps (especially when you are giving info to another user and don't want to have to tell them to copy everything from their chat window, etc.).
While you might not be able to do it without a LITTLE manual intervention (dragging the notecard into the object), this reduces the steps greatly and eliminates the, "tricky," steps for less experienced users who just want to click, drag, and drop.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-17-2006 14:38
From: Argent Stonecutter If you want a huge database of people involved in a lottery, there really is no option other than storing it outside SL.
Your script can use HTTP to store the data and initiate an RPC to query it.
A notecard with thousands of entries would take insanely long to go through. LSL is not SQL. Yeah. I think there is actually a limit on notecard length anyway. Hmm. Well, not entirely sure. You'd likely want to break the data up into several notecards in any case. Actually, though, you may not HAVE to go through the whole notecard or notecards in this case. All you have to do is get the length (of each), generate a random number, and read the correct line. It is probably a little off-subject anyhow. I agree that this application is better done with an external database.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-17-2006 14:42
From: Nargus Asturias Um...I believe this ability should need permission though. Last thing I want is another way to generate spam  Well, I'm not sure it IS another way to generate SPAM. It isn't really any different from the way scripts can currently give notecards; rather, it just allows the text that notecard gives you to be dynamic rather than static. However, I think mute should work the same way it does for people/objects that try to give you notecards and other content.
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
09-17-2006 16:27
From: Hewee Zetkin Actually, though, you may not HAVE to go through the whole notecard or notecards in this case. All you have to do is get the length (of each), generate a random number, and read the correct line. It is probably a little off-subject anyhow. I agree that this application is better done with an external database. No, wrong kind of lottery, not "one winner of al entrants," it's PowerBall. Chose three numbers from this list: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16. Now choose another number from this list: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16. Ok, now, 4000 other people do it too. Now I select some numbers (same list), hm.... 5, 14, 7 and 14. (or have my script do it) Now anyone with these numbers wins (order doesn't matter for the frist 3 numbers). It doesn't MATTER how big my notecard is, I have to check EVERY entry anyway. From: Hewee Zetkin Yeah. I think there is actually a limit on notecard length anyway. ...then I check multiple notecards with the same winning numbers... From: Argent Stonecutter If you want a huge database of people involved in a lottery, there really is no option other than storing it outside SL.
Your script can use HTTP to store the data and initiate an RPC to query it.
A notecard with thousands of entries would take insanely long to go through. LSL is not SQL. Thing is, I don't know jack about creating a database OUTSIDE of SL. I looked into XML-RPC at the time I wrote the script and went, "WTF? I have to write--in C++ --a separate program to parce this? And find a way to run it on my computer?" (my PC is a set up as a sever, not that it servers much). Even with HTTPRequest, I STILL have to write a program in some language I barely understand* to do what I want in a way that I don't understand either (I never did anything in C++ past terminal screens of data, stored to a file or not, the one class that DID deal with the program accessing a SQL database no one in the entire class got to work, h3ll, only 6 people (3 groups) turned in ANYTHING and I was one of those 6. Our program DID NOT DO SH!T and I wasn't even the one writing it because I was so far beyond "Lost"  . Heck, the XML-RPC at the time dealt with LSL sending an email which I had to somehow pick up with my server side script. Ha, like my server has email... Now if you'd like to write the server-side program FOR me, I'd be delighted. I'll pay you in a percentage of the proceeds of the lottery--which btw, has yet to have a drawing. *C++ is the language I understand best (sans Flash ActionScript and LSL).
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
09-17-2006 20:49
From: Draco18s Majestic Thing is, I don't know jack about creating a database OUTSIDE of SL. Then you'll have the opportunity to learn something new! (but for god's sake not in C++, there's zillions of better languages. Hell, you'd be better off in Fortran.)
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-18-2006 02:23
Anyway, I believe this remains a bit offtopic. Perhaps you can discuss your particular problem in the Scripting Tips forum, eh?
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
09-18-2006 06:28
From: Argent Stonecutter Then you'll have the opportunity to learn something new!
(but for god's sake not in C++, there's zillions of better languages. Hell, you'd be better off in Fortran.) Yes, I know C++ isn't the best language for it, but then, the class I had that minory dealt with (a.k.a. "Final project that no one turned in"  was instruction in 7 languages at once. Most people were learning 6 of them (C, C++, Java, Perl, Bash, and two others). And while I'd LOVE to learn it, I'd need someone to teach me, as everything I've seen that "shows" how to do it shows me how to do a VERY specific thing that ISN'T what I want (and less teaching and more "here's a program"  . And sorry for the off-topicness.
|
|
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
|
Why not use LlSetObjectDesc function?
09-18-2006 15:15
A easy way to store up to 127 charaters (don't know if your limited to the ascii char set) of data is to use the LlSetObjectDesc function. Use with the LlGiveInventory function it should work for most sundries.
|
|
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
|
Another trick to store values
09-18-2006 18:42
Another trick that scripters are using is making an invisble cube and storing values using llSetPrimitiveParams on each side of the prim to store values as colors.
|
|
Thomas Sadoul
Registered User
Join date: 1 Aug 2006
Posts: 1
|
10-27-2006 07:57
Thanks Heewee. I haven't been scripting here very long but can already see how useful this would be. In my current project, being able to display a browswer window in a HUD would be the perfect answer as the data does not need to be persistent in world or visible to anybody else, but in the event that the option is needed to save the data, this would be perfect. Either option would get me out of the predicament I'm in 
|
|
Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
|
10-27-2006 09:22
I'm not even sure we need the ability to programmatically create a notecard. Just having the ability to write to an existing one would be a phenomenal improvement. I can't think of any sim resource or business interest on the part of Linden Labs that would be adversely affected by the ability not to create new notecards programmatically, but simply to programmatically alter the contents of an existing one. It would provide something we currently lack in our scripting environment: persistent data that can survive a script reset.
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
10-27-2006 14:17
From: Kalel Venkman I'm not even sure we need the ability to programmatically create a notecard. Just having the ability to write to an existing one would be a phenomenal improvement. Problem wiht that is that everytime a change is made to a notecard it creates a new one. :-\
|