Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

should I? use notecard reading code to set channels.

BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
06-21-2007 07:18
Recently i have written a number of scripts, mostly just tests and tinkering, that use communications and listen(), therefore i find I need to use different channels for different instances of the devices to avoid conflicts.
With some projects this means changing at least one global reference in numerous files.
I have been considering adding a kind of notecard reader, so that i can change the channel once in the notecard.
Is this the correct line of thought to persue?
Can anyone think of any security ramifications in exposing this information in a notecard?
Has this been used elsewhere successfully? (so I can have a look at it's implementation).
What is the most concise and error catching logic to use? (how should I write the notecard reader function for minimum code and maximum foolproofness.)?

Comments and suggestions please.

[edit]
I just had a discussion in-world about how scripts store their state/variable when they are taken into inv... i didnt realise this before. It makes my question kind of moot knowing this.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
06-21-2007 09:19
Notecards work well for channel and other configuration settings. There are several examples posted here in the Script Library.

Additional you could simply use the Objects Description field for the channel if that is the only config setting you plan to use.
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
06-21-2007 09:43
I initially considered the description field, but because it's publicly viewable it might pose problems if someone wanted to eavesdrop or interfere, or if the end-user deletes/alters it.
Good point though.

I have looked through the notecard code available. and most of them seem to consume quite a few lines of code, I am curious if anyone has a less verbose, and more arcane, version of the same logic? Is there a "tiny code" faction in these forums? There always is. :]
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
06-21-2007 09:49
Reading a notecard takes quite a few lines of code, there is no way around that.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
06-21-2007 14:11
From: BETLOG Hax
I initially considered the description field, but because it's publicly viewable it might pose problems if someone wanted to eavesdrop or interfere, or if the end-user deletes/alters it.
Good point though.

I have looked through the notecard code available. and most of them seem to consume quite a few lines of code, I am curious if anyone has a less verbose, and more arcane, version of the same logic? Is there a "tiny code" faction in these forums? There always is. :]


You could put your notecard code in a separate script once, then have that script respond to a link request for the channel from other scripts in the same object. That may help keep your 'functional' scripts less bloated?