No _vti
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
<Project name="Configuration_Notecard_Reader" guid="D8A393AA-6C00-1014-B904-200204C60A89">
|
||||
<Object name="Object" guid="D8A39498-6C00-1014-B904-200204C60A89">
|
||||
<Script name="Configuration_Notecard_Reader_1.lsl" guid="D8A3C8A2-6C00-1014-B904-200204C60A89">
|
||||
</Script>
|
||||
<Script name="Configuration_Notecard_Reader_2.lsl" guid="D8A3DEAA-6C00-1014-B904-200204C60A89">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
@@ -1,25 +0,0 @@
|
||||
// :CATEGORY:Notecard Reader
|
||||
// :NAME:Configuration_Notecard_Reader
|
||||
// :AUTHOR:Dedric Mauriac
|
||||
// :CREATED:2011-01-22 12:16:49.847
|
||||
// :EDITED:2013-09-18 15:38:51
|
||||
// :ID:201
|
||||
// :NUM:274
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// * Create a script
|
||||
// * Read each line of a note card
|
||||
// * Skip over comments
|
||||
// * Skip blank lines
|
||||
// * Notify the owner of the lines with unknown settings
|
||||
// o Unknown setting name
|
||||
// o Missing delimiter (equal sign)
|
||||
// * Notify the owner of missing configuration note card
|
||||
// * Detect when the notecard has been changed
|
||||
// * Offer case-insensitive settings
|
||||
// * Trim white-space from name/value settings
|
||||
// * Initialize with default values
|
||||
// * Detect that the name of the configuration file is a notecard
|
||||
// * Detect that you have reached the end of the file
|
||||
// :CODE:
|
||||
@@ -1,130 +0,0 @@
|
||||
// :CATEGORY:Notecard Reader
|
||||
// :NAME:Configuration_Notecard_Reader
|
||||
// :AUTHOR:Dedric Mauriac
|
||||
// :CREATED:2011-01-22 12:16:49.847
|
||||
// :EDITED:2013-09-18 15:38:51
|
||||
// :ID:201
|
||||
// :NUM:275
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// The script.
|
||||
// :CODE:
|
||||
integer line;
|
||||
|
||||
string configurationFile = "Application.Config";
|
||||
|
||||
key readLineId;
|
||||
|
||||
string AvatarName;
|
||||
|
||||
string FavoriteColor;
|
||||
|
||||
|
||||
|
||||
init()
|
||||
|
||||
{
|
||||
|
||||
// reset configuration values to default
|
||||
|
||||
AvatarName = "Unknown";
|
||||
|
||||
FavoriteColor = "None";
|
||||
|
||||
|
||||
|
||||
// make sure the file exists and is a notecard
|
||||
|
||||
if(llGetInventoryType(configurationFile) != INVENTORY_NOTECARD)
|
||||
|
||||
{
|
||||
|
||||
// notify owner of missing file
|
||||
|
||||
llOwnerSay("Missing inventory notecard: " + configurationFile);
|
||||
|
||||
return; // don't do anything else
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// initialize to start reading from first line
|
||||
|
||||
line = 0;
|
||||
|
||||
|
||||
|
||||
// read the first line
|
||||
|
||||
readLineId = llGetNotecardLine(configurationFile, line++);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
processConfiguration(string data)
|
||||
|
||||
{
|
||||
|
||||
// if we are at the end of the file
|
||||
|
||||
if(data == EOF)
|
||||
|
||||
{
|
||||
|
||||
// notify the owner
|
||||
|
||||
llOwnerSay("We are done reading the configuration");
|
||||
|
||||
|
||||
|
||||
// notify what was read
|
||||
|
||||
llOwnerSay("The avatar name is: " + AvatarName);
|
||||
|
||||
llOwnerSay("The favorite color is: " + FavoriteColor);
|
||||
|
||||
|
||||
|
||||
// do not do anything else
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if we are not working with a blank line
|
||||
|
||||
if(data != "")
|
||||
|
||||
{
|
||||
|
||||
// if the line does not begin with a comment
|
||||
|
||||
if(llSubStringIndex(data, "#") != 0)
|
||||
|
||||
{
|
||||
|
||||
// find first equal sign
|
||||
|
||||
integer i = llSubStringIndex(data, "=");
|
||||
|
||||
|
||||
|
||||
// if line contains equal sign
|
||||
|
||||
if(i != -1)
|
||||
|
||||
{
|
||||
|
||||
// get name of name/value pair
|
||||
|
||||
string name = llGetSubString(data, 0, i - 1);
|
||||
|
||||
|
||||
|
||||
// get value of name/value pair
|
||||
|
||||
Reference in New Issue
Block a user