Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Maximum length of script?

Zeppi Schlegel
Registered User
Join date: 20 Nov 2003
Posts: 50
07-11-2004 09:07
I'm about 40 lines away from full-service ATMs, and all of a sudden I can't paste my entire script into the script window.

Did I miss the documentation that explains that there is a 32k limit on script source?

Zep
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
07-11-2004 09:12
You're mad! :D
You're not supposed to code like that in LSL. You should use many scripts where each one does a certain function. Considering that a script can only have 16k of memory to work with, I'm very surprised you expect such a bloated system to work right. What on earth are you doing, an ATM should be fairly simple, not a huge and overly complicated system. KISS :)
Zeppi Schlegel
Registered User
Join date: 20 Nov 2003
Posts: 50
07-11-2004 09:21
My script handles voice-activated commands and secure communications (both email and XML-RPC) to and from my webserver. I challenge you to make something like this simple. :)

And probably close to half of my code is documentation. Seeing as I can't split functionality off into different source files for the sake of readable code, I use nice fat comments to make the delimitation clear.

And yes I've split some off into seperate objects but the link message code takes space too - sometimes it's just best to keep it all together for sake of my poor brain going over it later.

Are you suggesting I make my code less secure? Or less readable?

And along similar lines, do you bank with GOM? :D Know what I mean?

Zep
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
07-11-2004 09:55
From: someone

My script handles voice-activated commands

How... beta... of you :)
Listeners cause lag and are a bit insecure. Most people these days are busy avoiding them. You want security and effiency, build your interface with prims and use llMessageLinked.

From: someone

and secure communications (both email and XML-RPC) to and from my webserver.

Security != Complexity. Very often, the case is that a more complex system will also be more vulnerable... case in point, MS Windows lol :)

From: someone

I challenge you to make something like this simple. :)

Hmm, let's see, no offense but before there was a GOM I was already one of SL's most proficient scripters, and rather busy teaching the current generation of scripters how to be proficient...
How much will you pay me for a better ATM? I've always loved it when people tell me something cant be done! Especially those times when I was already busy doing it. I must warn you however, that I am quite fond of optimization :)

From: someone

And probably close to half of my code is documentation.

Simple solution, run your code through a comment stripper before dumping it into the production ATMs.

From: someone

Seeing as I can't split functionality off into different source files for the sake of readable code

Surely you must be joking. Modular code IS readable code. Monolithic code isnt ;)

From: someone

And yes I've split some off into seperate objects but the link message code takes space too - sometimes it's just best to keep it all together for sake of my poor brain going over it later.

Separate object? You know you can use linkmessage to communicate with scripts in the same object, right.


From: someone

Are you suggesting I make my code less secure?

What on earth are you using for encryption?
My personal opinion is that people who worry too much about security are paranoid.

From: someone

Or less readable?

Uh, is anyone going to read it?

From: someone

And along similar lines, do you bank with GOM? :D

I have deposited some L$ in the past and will soon dump all my money there... considering that I usually rank 20-25 in net worth, I would say that I have a vested interest in having it work right :)

From: someone
Know what I mean?

No :)

Anyway, if you expect anything to be documented in SL, you must be new here :)
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
07-11-2004 10:01
OMG ZEPPI = TEH FL4mx00r3d LOLOLOLOLOLOLOLOL!11!11!

ZEPEE R != TEH COOL LOLOLOLOLOLOL!!!11!11!!!1ONE pw3ned
_____________________
Touche.
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-11-2004 10:49
From: someone
Hmm, let's see, no offense but before there was a GOM I was already one of SL's most proficient scripters
Eggy you just this past week figured out the 'event paradigm' that is LSL. I would still not rate you as one of the most proficient scripters I know.

I have built extremely large projects that were large because that was the only way to do them. There are projects that simply can not be split more than they are. And I know other scripters with other projects that they put on hold or canceled completely because script space was too limited. And I have been splitting my scripts and using link messages since ~ April 2003, so yes, I think I know how to do it.

I have commented my code because *I* plan on reading it later, and sometimes it helps to know WTF I was thinking when I wrote some code. Especially if it is mission critical code that can't have bugs.

Get off your high horse.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
07-11-2004 10:57
...woah dude. I made that mistake once, except I made it with an account set up as a prank. But, hot dman...
_____________________
Touche.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
07-11-2004 10:58
Heh, you're Zeppi? You've got to be kidding me.
Thank you very much for the personal attack. I would hardly call having made a mistake in a 5 minute script not knowing how to use events.
I had dealt with event queueing problems in the past you know :p
And after being forced to work with your code for 6 months, I think I am rather qualified to say that you make mistakes as well. It's only human, and considering I asked Catherine Omega and Lee Linden about that tiny bit of code and they couldnt answer me, I think there are pleeenty of humans here.
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
07-11-2004 11:30
When I developed my Touring Hot Air Balloon, I started with a single monolithic script. However, as I added more and more features, I was forced to rethink how I was going to design my system to work efficiently, and not be burdened by script size limitations.

What I did was split my scripts up into 14 or so modular scripts, each one having a particular task. One script did just listens and listening security, passing along that information to other scripts via linked messages. Another handled just vehicle movement, another for automated tour routing, another for reading notecards, and so on.

I'd suggest that you rethink your design, and break up your project into several scripts by functionality. Make one script handle just communications to the outside world, one handle the main security/processing, one handle just the listen, and tie them all together with a logical Linked-Messaging system.

With large projects that involve some complexity (and especially if you want to make sure you don't lose money accidentally), I'd highly recommend that you restructure your scripts to use STATES, if you haven't already. These allow you to setup your script in logical parts, so that you don't accidentally make a mistake and drain the largest post of L$ in SL.

Many multiple scripts, linked messages, and especially the use of STATES are pretty much a requirement in any large scale project.

Hope that helps. If you, or anybody else, is interested in a class on States and Linked Messagse, I can setup a class on that this week at the University.
_____________________
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
07-11-2004 12:41
From: someone
Originally posted by Eggy Lippmann
How... beta... of you :)
Listeners cause lag and are a bit insecure. Most people these days are busy avoiding them. You want security and effiency, build your interface with prims and use llMessageLinked.


Listeners only cause lag when you use them in great numbers.

If you have a single listener script, I wouldn't worry. If you use less than 10 listeners, the performance impact is negligible.

Moreover, they are necessarily insecure. It depends on how you use them.

Unfortunately, at this time, the chat interface is the most effective UI for some tasks, like inputing values.

eg. "withdraw 500"

From: someone

Simple solution, run your code through a comment stripper before dumping it into the production ATMs.


Not a bad idea. Way back when longer variable names consumed more memory, we ran stuff through the C preprocessor.

#define Descriptive_Variable_Name X1

The same trick still applies for comments.


From: someone

What on earth are you using for encryption?
My personal opinion is that people who worry too much about security are paranoid.


I'd wager a guess that Zeppi's writing accounting code for ATMs. I'm sure GOM users would be reassured that security is an important part of the design.

Although, I am curious what Zeppi's using for encryption. As far as I know, the only 2 implementations of encryption in LSL are Adam's RSA implementation and my symmetric MD5-based encryption.

From: someone

Anyway, if you expect anything to be documented in SL, you must be new here :)
[/B]

It's not an unreasonable expectation that things should be documented.
_____________________
--
~If you lived here, you would be home by now~
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
07-11-2004 12:55
Hank Ramos said:

"If you, or anybody else, is interested in a class on States and Linked Messagse, I can setup a class on that this week at the University."

I would REALLY like a class on linked messages.

:)
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-11-2004 13:16
My apologies Eggy, I was out of line.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
07-11-2004 15:06
From: someone
Originally posted by Ama Omega
There are projects that simply can not be split more than they are. And I know other scripters with other projects that they put on hold or canceled completely because script space was too limited.


/me raises his hand.

I was writing an ONS (Like DNS, but for objects) and kept running into these problems, and the 16k limit. I had to can it.

That was the proverbial straw that pretty much made me quit logging in last year in Sept/Oct. I mean, scripting was the only thing I ever had the temerity to think I could do well in SL, and the draconian restrictions were severely impacting my ability to write what I wanted to write. :-/
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
07-11-2004 15:07
Have only Eggy and I noticed that Zeppi = Ama?
_____________________
Touche.
Pete Fats
Geek
Join date: 18 Apr 2003
Posts: 648
07-11-2004 15:26
I noticed.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-11-2004 16:29
32k limit on script source? Im suprised the script window even lets you past in 16k, seeing that's the script memory limit.

Dealing with the small amount of memory isnt reall that bad, you just have to get used to having that cap. As other's have said, and Im also endorsing this from my own experiances, scripting with modularity in mind really pays off in the long run.

If you need help, IM me in world, and if I'm not busy, I'd be happy to come over and lend a hand.

Btw, this Eggy vs. Ama thing isnt pretty, stop it before you turn the Wisdom forum into a hate fest.
==Chris
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
07-11-2004 16:33
From: someone
Originally posted by Christopher Omega
32k limit on script source? Im suprised the script window even lets you past in 16k, seeing that's the script memory limit


As you should well know from rl programming, compiled app size rarely has any noticable relationship to the amount of source code involved.

Especially if it's heavily commented, Since compilers generally ignore the comments.
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-11-2004 18:19
Geeze, the sad thing is I don't know how to say this that won't just make some of you believe it more anyways. I'm not Zeppi. My contact with Zeppi is about a 1 minute conversation in passing probably about .... 6 months ago? It was right after GOM opened and I was working on an auction house somewhere. I don't remember the sim, but at the time it was full of Candie Land group owned land. I believe the conversation was about clothes - namely that he was wearing the exact same suit I wear (oooo there is a tidbit for you consperacy theorists) which is a suit bought from Fey. It was very shortly after that I commissioned a new suit from Fey.

I am not Zeppi. I defended his side too strongly, for myself and for him I am sure. I apologize to all involved.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Zeppi Schlegel
Registered User
Join date: 20 Nov 2003
Posts: 50
07-11-2004 18:22
From: someone
Originally posted by Hank Ramos
Many multiple scripts, linked messages, and especially the use of STATES are pretty much a requirement in any large scale project.


Thanks Hank. :) This is the type of constructive criticism I was looking for.

Just so we're on the same wavelengths here, I design and build mid to large-scale software systems for a living. A 900 line script is, in my books, very much small scale. :)

Regardless, the script uses about 7 or 8 states and is all in all, quite simple. The most complicated part is building and validating the secure messages that are passed between it and my web server.

I've split the email functionality off into a seperate script, but it looks like I'm going to have to split it even further. Too bad too - it was pretty close.

And stripping comments out is just not an option. :) I'm a software engineer. If I can't read my own code, what good am I?

Zep
Zeppi Schlegel
Registered User
Join date: 20 Nov 2003
Posts: 50
07-11-2004 18:26
From: someone
Originally posted by Ama Omega
My contact with Zeppi is about a 1 minute conversation in passing probably about .... 6 months ago? It was right after GOM opened and I was working on an auction house somewhere. I don't remember the sim, but at the time it was full of Candie Land group owned land. I believe the conversation was about clothes - namely that he was wearing the exact same suit I wear (oooo there is a tidbit for you consperacy theorists) which is a suit bought from Fey. It was very shortly after that I commissioned a new suit from Fey.


Geez, now that you mention that, I remember it! How are you? I got me a new suit from Fey too - I really hope it's not the same. :P

From: someone
I am not Zeppi. I defended his side too strongly, for myself and for him I am sure. I apologize to all involved.


You don't have to apologize for not being me. I apologize enough for being me.

Zep
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-11-2004 18:28
Am I the only one that has noticed that Darwin is contributing absolutely nothing productive to this thread and therefore should not be participating?

From: someone
Originally posted by Darwin Appleby
OMG ZEPPI = TEH FL4mx00r3d LOLOLOLOLOLOLOLOL!11!11!

ZEPEE R != TEH COOL LOLOLOLOLOLOL!!!11!11!!!1ONE pw3ned


From: someone
Originally posted by Darwin Appleby
...woah dude. I made that mistake once, except I made it with an account set up as a prank. But, hot dman...


From: someone
Originally posted by Darwin Appleby
Have only Eggy and I noticed that Zeppi = Ama?
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-11-2004 18:34
From: someone
Originally posted by Grim Lupis
As you should well know from rl programming, compiled app size rarely has any noticable relationship to the amount of source code involved.

Especially if it's heavily commented, Since compilers generally ignore the comments.


Oopsie. Silly self-taught programmer's mistake :D
Zeppi Schlegel
Registered User
Join date: 20 Nov 2003
Posts: 50
07-11-2004 18:37
From: someone
Originally posted by Francis Chung
Although, I am curious what Zeppi's using for encryption. As far as I know, the only 2 implementations of encryption in LSL are Adam's RSA implementation and my symmetric MD5-based encryption.


Actually, we're not using encryption at all, although I would love to see RSA implemented in LSL. :) I implemented MD5 myself before LL added llMD5String() but that was just silly painful...

We don't really need encryption because nothing comprising is passed around. The security of the system is based on the security of my web server and the assumption that one doesn't pass one's GOM and SL passwords around.

You can break my system if you know the format of the communications between SL and my server, and can guess a few keys (some of which change periodically) for some MD5 hashes. It is by no means bullet-proof, but for our purposes it's just fine.

And although I appreciate the association, I am not Ama. :)

Zep
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-11-2004 18:46
So wait, you're saying Zeppi and Ama are the same person? Of course! It all makes sense now! :rolleyes:

Also, Eggy, I just want to reiterate what I told you yesterday -- I know nowhere near as much about anything as people give me credit for. :)
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
07-11-2004 19:07
Hey Chris, chill my friend. :) I think the constructive posts are still manageable over my babbeling.

And Ama, why'd you say this?

"And I have been splitting my scripts and using link messages since ~ April 2003, so yes, I think I know how to do it.

I have commented my code because *I* plan on reading it later, and sometimes it helps to know WTF I was thinking when I wrote some code. Especially if it is mission critical code that can't have bugs."

Maybe I'm stupid, but it sounds like you're talking directly for Zeppi. I mean, he said ZEPPI didn't know how to make linked messages... and then you say "Yes, I do!" Wait, you're not Zeppi... I think.
_____________________
Touche.
1 2