Refrigerator?
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
09-09-2006 19:33
Huh? what? you're making a refrigerator in SL?
Okay, I have over 22,000 items in my inventory, and this list just keeps growing. Among the bazillion "Objects" in my inventory, I have hundreds of the weird little freebie drinks and hamburgers, hotdogs, corndogs, pizza, popsicles, icream cones.. and yes.... beer. MOst of them are usually scripted with a little animation that periodically makes the wearer "drink/.eat" the item. A few weeks ago, I threw an impromptu "tailgate party" off the end of my airship in a public sandbox. I was frustrated by the need to set out a coke vending machine to give out cokes.. and well.. I was hand-delivering burgers, etc. So the idea began to germinate that I needed a "cooler", a custom vendor where people could grab their own.
Well the cooler project grew, as I began thinking about decorating my home space.. so I modelled a refigerator and began hacking together my own script solution for the vending function. The concept was to use popup dialog menus, to allow the person using the fridge to select a single item, rather than being forced to "buy" the X00 freebie items that I eventually plan to stock the fridge with.
Here's the code I've bashed together so far (it took me two days to figure out that llDetectedKey won't work twice in the same script, so I made a string).
[EDIT: Code removed.. a final version of the code will probably be posted in the Script Library.. when I get it working the way I want, thanks to everyone who commented, and thank to those who read it and gave it a thought, even if you didn't comment... it all helped move me forward and off the "scripter's block".]
Well I got the basic select and vend functions working.. and the menus seem to be working fine. Had no problems having the item delivered once I solved that llDetectedKey voodoo...
But then someone suggested to me that I might set it up so that other people could put items in my fridge, or that I could sell the finished fridge without contents, and allow people to stock their own fridges... and then have the menus created "on the fly".
Frankly, *THAT* kind of coding is a bit above my head (a few fathoms above).... so I'm turning to you all.
Anyone have any suggestions for improving this code?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-10-2006 02:44
It's hard to do with your menu/sub-menu structure, but still doable.
The nicest way to automate it would be to generate a list of the items in the inventory (effectively the ones stored in the fridge). If there are more than 12 you need to add some next and maybe back buttons into the list too.
llGetInventoryNumber(INVENTORY_OBJECT); will let you find the number of things in the fridge.
llGetInventoryName(INVENTORY_OBJECT, i); will let you collect the names to add to your list for display to find in the fridge.
llGetListLength will let you find the length of the list, llListInsertList will let you insert prev and next buttons into the list if it's more than 12 elements long.
If you want to keep the menu/sub-menu system you need to do something a bit different. On way would be a notecard with drinks, food etc. in different cards or different sections of the card. Another would be to stick a tag on your inventory so you'd have food_hamburger, food_hot dog, drink_coke etc. Read the names parse for the _ assign to the different lists. This would also let you have dynamically assigned main menu categories too, but would be a bit more of a pain to set up.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
My Thoughts
09-10-2006 04:10
I'd use a note card driven system to build the menu's. I think you could probably use one of the 'standard' menu builder systems for this idea. Unfortunately I cant think of any the names of the top of my head So heres my attempt : integer CHANNEL = 42; // dialog channel
// There can be up to 12 options per menu, so try to subdivide large menus. // Menu items are listed in threes, starting with the bottom row and working up, // so it's 1, 2, 3 along the bottom, // then 4, 5, 6 on the next row, etc... just like the 10-key number pad.
string notecardName = "Contents List"; integer lineCounter; key dataRequestID;
integer first; integer pagesize = 8;
list MENU_MAIN = ["Food", "Drink"];
list MENU_FOOD; list FOOD_LIST;
list MENU_DRINK; list DRINK_LIST;
list choices; integer len; integer i;
integer Listening = 0;
UpdateListen(key id) { CancelListen(); Listening = llListen(CHANNEL,"",id,""); llSetTimerEvent(20); }
CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); }
ShowMainMenu(key userkey) { choices = MENU_MAIN; if(userkey == llGetOwner()) choices += ["Restock"]; // The dialog text llDialog(userkey, "\n What can I get you?", choices, CHANNEL); UpdateListen(userkey); }
ShowFoodMenu(key userkey) { choices = ["MAINMENU"]; // Now add the items len = llGetListLength( MENU_FOOD ); if(first > 0) choices += "Prev"; if(len > (first + pagesize)) { choices += "Next"; //llSay(0,"Adding Next Button " + (string)len + " " + (string)first); } for(i = 0;i < pagesize;i++) { string strname = llList2String(MENU_FOOD,(i+first)); if( llStringLength(strname) > 0) { choices += strname; } } // finally show the dialog llDialog(userkey, "\n What food can I get you?", choices, CHANNEL); UpdateListen(userkey); }
ShowDrinkMenu(key userkey) { choices = ["MAINMENU"]; // Now add the items len = llGetListLength( MENU_DRINK ); if(first > 0) choices += "Prev"; if(len > (first + pagesize)) { choices += "Next"; //llSay(0,"Adding Next Button " + (string)len + " " + (string)first); } for(i = 0;i < pagesize;i++) { string strname = llList2String(MENU_DRINK,(i+first)); if( llStringLength(strname) > 0) { choices += strname; } } // finally show the dialog llDialog(userkey, "\n What drink can I get you?", choices, CHANNEL); UpdateListen(userkey); }
GiveItem(key id, string name, string description, string itemname) { llSay(0, name + " grabs a " + description + " from the fridge."); llGiveInventory(id,itemname); }
default { state_entry() { state ReadNoteCard; } on_rez(integer num) { llResetScript(); } }
state Running { state_entry() { llSay(0,"Fridge fully stocked!"); } on_rez(integer num) { llResetScript(); } touch_start(integer total_number) { key userkey = llDetectedKey(0); ShowMainMenu(userkey); } listen(integer channel, string name, key id, string message) { CancelListen(); // verify dialog choice // present main menu on request to go back integer foodID = llListFindList(MENU_FOOD, [message]); integer drinkID = llListFindList(MENU_DRINK, [message]); if ("MAINMENU" == message) { ShowMainMenu(id) ; } else if ("Food" == message) { first = 0; ShowFoodMenu(id); } else if ("Drink" == message) { first = 0; ShowDrinkMenu(id); } else if("Restock" == message) { llResetScript();; } else if (foodID != -1) { string item = llList2String(FOOD_LIST,foodID); GiveItem(id,name,message,item); } else if (drinkID != -1) { string item = llList2String(DRINK_LIST,foodID); GiveItem(id,name,message, item); } } timer() { CancelListen(); }
}
//-------------------------- state ReadNoteCard { on_rez(integer num) { llResetScript(); } state_entry() { lineCounter = 0; integer itemtype = llGetInventoryType(notecardName); if(INVENTORY_NOTECARD == itemtype) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10); } else { llOwnerSay("Error - Fridge Contents list notecard missing!"); state Running; }
} dataserver(key queryid, string data) { //Check to make sure this is the request we are making. //Remember that when data comes back from the dataserver, //it goes to *all* scripts in your prim. //So you have to make sure this is the data you want, and //not data coming from some other script. if (dataRequestID) { llSetTimerEvent(0); //If we haven't reached the end of the file if (data != EOF) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10);
lineCounter += 1; // Each line is of the form // Type,name,object // FOOD,Hot Dog,Hot dog // DRINK,Can Of Coke,coke can if(llGetSubString(data, 0,0) != ";") { list ldata = llParseString2List(data, [","], [""]); string type = llList2String(ldata, 0); string desc = llList2String(ldata, 1); string item = llList2String(ldata, 2); integer itemtype = llGetInventoryType(item); //llOwnerSay((string)itemtype + " " + data); if(INVENTORY_OBJECT == itemtype) { if("FOOD" == type) { MENU_FOOD = (MENU_FOOD = []) + MENU_FOOD + desc; FOOD_LIST = (FOOD_LIST = []) + FOOD_LIST + item; } else if("DRINK" == type) { MENU_DRINK = (MENU_DRINK = []) + MENU_DRINK + desc; DRINK_LIST = (DRINK_LIST = []) + DRINK_LIST + item; } else { llOwnerSay("Error - Unknown type " + data); } } else { llOwnerSay("Error - " + desc + " (" + item + ") Out of Stock."); } } } else { llSetTimerEvent(0); state Running; } } } timer() { // The notecard read failed so abort llSetTimerEvent(0); llOwnerSay("Error reading Data.Aborting."); state Running; } }
The notecard would be something like this: ; Fridge Contents ; FOOD,Hot Dog,Hot Dog DRINK,Beer,Beer DRINK,Rum,Pirates Rum
Use ;'s as comment lines Although this is explicitly a fridge the same Idea could be applied to almost anything
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
09-10-2006 06:39
Yeah, like I said, on the surface, the suggestion sounded really neat, but the accomplishment just kept looking more and more and more complex. I think I'll just live with the "manual stocking" process... and see if there's a way to make it moddable by the end user.
I have a script that reads a notecard and uses a comma deliniated db... so I need to get into that code and see how that parsing works, and see if I can figure out how to apply that... because a "shopping list" seems like the easiest solution outside of just copying the else-if and button a million times.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
09-10-2006 07:55
Missed your post while editing mine or I'd have made it a reply rather than an edit!
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
09-10-2006 10:57
Newgate... THANK YOU!
This is probably the exact solution I was going to be working on, but just couldn't find the energy to get started on. I can only think of a couple of minor tweaks I'd want to make to this at this point.. it's so close to what I wanted already tho.
One question.. is there any way to have the main menu populated by the different first lines in the Contents list? Probably not, but I'm curious. I'd like to make it bonehead-simpel to add a new class when a class gets overloaded.. like "drinks 2" or "sodas" or "desserts"
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
Creature Feep Detected!!!
09-11-2006 01:14
From: Winter Ventura Newgate... THANK YOU!
This is probably the exact solution I was going to be working on, but just couldn't find the energy to get started on. I can only think of a couple of minor tweaks I'd want to make to this at this point.. it's so close to what I wanted already tho.
One question.. is there any way to have the main menu populated by the different first lines in the Contents list? Probably not, but I'm curious. I'd like to make it bonehead-simpel to add a new class when a class gets overloaded.. like "drinks 2" or "sodas" or "desserts" Dont see why not. You could use a seperate list to hold keywords and populate the main menu from it. Again the 12 button rule applies. Populating the sub list(s) becomes more interesting as we now need to track the content type. Either a seperate list for type, a strided list, some form of prefix handler or maybe (pause for dramatic effect)A fixed maximum number of subtypes with each being controlled/handled by a seperate child script? Limiting the number of allowed types to 12 would be the easy way out, single screen main menu and 'only' requires 25 (GULP) lists. I'm not sure of the efficiency of such a system though ( Strife? ) although I think it would be far quicker than iterating a single list each time. Out of interest what would you change? ((Always wanting to improve anything I do.))
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
An Idea....
09-11-2006 01:26
Not had a chance to try this but I think it should work ok for smallish lists.... integer CHANNEL = 42; // dialog channel
// There can be up to 12 options per menu, so try to subdivide large menus. // Menu items are listed in threes, starting with the bottom row and working up, // so it's 1, 2, 3 along the bottom, // then 4, 5, 6 on the next row, etc... just like the 10-key number pad.
string notecardName = "Contents List"; integer lineCounter; key dataRequestID;
integer first; integer pagesize = 8; // The main Menu - Dynamically Built list MENU_MAIN; list MENU_DESC; // Total Lists list TEXT; list OBJECTS; list TYPES; // Working List list CURRENT_MENU; list CURRENT_ITEMS; string currentText;
integer mainEntries; integer MAXMENU = 11; // Need to be able to Restock
list choices; integer len; integer i;
integer Listening = 0;
UpdateListen(key id) { CancelListen(); Listening = llListen(CHANNEL,"",id,""); llSetTimerEvent(20); }
CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); }
integer GetMenuType(string name) { integer selected = llListFindList(MENU_MAIN, [name]); return selected; }
AddMenu(string name, string desc) { integer selected = GetMenuType(name); if(-1 == selected) { if(mainEntries < MAXMENU) { MENU_MAIN = (MENU_MAIN = []) + MENU_MAIN + name; MENU_DESC = (MENU_DESC = []) + MENU_DESC + desc; mainEntries = llGetListLength( MENU_MAIN ); } else { llOwnerSay("Error - To many Menu Types!"); } } else { llOwnerSay("Warning - Duplicate Menu Entry - " + name); } }
BuildWorkingLists(string type) { integer max = llGetListLength( TEXT ); integer menutype = GetMenuType(type); if(menutype > -1) { CURRENT_MENU = []; CURRENT_ITEMS = []; currentText = llList2String(MENU_DESC, menutype); for(i = 0;i <= max; i++) { string types = llList2String(TYPES, i); if(types == type) { string text = llList2String(TEXT, i); string object = llList2String(OBJECTS, i); CURRENT_MENU = (CURRENT_MENU = []) + CURRENT_MENU + text; CURRENT_ITEMS = (CURRENT_ITEMS = []) + CURRENT_ITEMS + object; } } } }
ShowMainMenu(key userkey) { choices = MENU_MAIN; if(userkey == llGetOwner()) choices += ["Restock"]; // The dialog text llDialog(userkey, "\n What can I get you?", choices, CHANNEL); UpdateListen(userkey); }
ShowFoodMenu(key userkey) { choices = ["MAINMENU"]; // Now add the items len = llGetListLength( CURRENT_MENU ); if(first > 0) choices += "Prev"; if(len > (first + pagesize)) { choices += "Next"; //llSay(0,"Adding Next Button " + (string)len + " " + (string)first); } for(i = 0;i < pagesize;i++) { string strname = llList2String(CURRENT_MENU,(i+first)); if( llStringLength(strname) > 0) { choices += strname; } } // finally show the dialog llDialog(userkey, "\n What " + currentText + " can I get you?", choices, CHANNEL); UpdateListen(userkey); }
GiveItem(key id, string name, string description, string itemname) { llSay(0, name + " grabs a " + description + " from the fridge."); llGiveInventory(id,itemname); }
default { state_entry() { state ReadNoteCard; } on_rez(integer num) { llResetScript(); } }
state Running { state_entry() { llSay(0,"Fridge fully stocked!"); } on_rez(integer num) { llResetScript(); } touch_start(integer total_number) { key userkey = llDetectedKey(0); ShowMainMenu(userkey); } listen(integer channel, string name, key id, string message) { CancelListen(); // verify dialog choice // present main menu on request to go back if ("MAINMENU" == message) { ShowMainMenu(id); } else if("Prev" == message) { first -= pagesize; ShowFoodMenu(id); } else if("Next" == message) { first += pagesize; ShowFoodMenu(id); } else if("Restock" == message) { llResetScript(); } else { integer MainMenu = GetMenuType(message); if(MainMenu != -1) { BuildWorkingLists(message); ShowFoodMenu(id); } else { integer foodID = llListFindList(CURRENT_MENU, [message]); if(foodID != -1) { string item = llList2String(CURRENT_ITEMS,foodID); GiveItem(id,name,message,item); } } } } timer() { CancelListen(); }
}
//-------------------------- state ReadNoteCard { on_rez(integer num) { llResetScript(); } state_entry() { lineCounter = 0; integer itemtype = llGetInventoryType(notecardName); if(INVENTORY_NOTECARD == itemtype) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10); } else { llOwnerSay("Error - Fridge Contents list notecard missing!"); state Running; }
} dataserver(key queryid, string data) { //Check to make sure this is the request we are making. //Remember that when data comes back from the dataserver, //it goes to *all* scripts in your prim. //So you have to make sure this is the data you want, and //not data coming from some other script. if (dataRequestID) { llSetTimerEvent(0); //If we haven't reached the end of the file if (data != EOF) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10);
lineCounter += 1; // Each line is of the form // Type,name,object // MENU,FOOD,food // MENU,HOTDRINK,beverage // MENU,DRINK,cold drink // FOOD,Hot Dog,Hot dog // HOTDRINK,Earl Grey Tea,tea // DRINK,Can Of Coke,coke can if(llGetSubString(data, 0,0) != ";") { list ldata = llParseString2List(data, [","], [""]); string type = llList2String(ldata, 0); string desc = llList2String(ldata, 1); string item = llList2String(ldata, 2); integer itemtype = llGetInventoryType(item); //llOwnerSay((string)itemtype + " " + data); if(INVENTORY_OBJECT == itemtype) { if("MENU" == type) { AddMenu(desc,item); } else { integer foodType = GetMenuType(type); if(foodType != -1) { TEXT = (TEXT = []) + TEXT + desc; OBJECTS = (OBJECTS = []) + OBJECTS + item; TYPES = (TYPES = []) + TYPES + type; } else { llOwnerSay("Error - Unknown type " + data); } } } else { llOwnerSay("Error - " + desc + " (" + item + ") Out of Stock."); } } } else { llSetTimerEvent(0); state Running; } } } timer() { // The notecard read failed so abort llSetTimerEvent(0); llOwnerSay("Error reading Data.Aborting."); state Running; } }
The notecard now needs a new section / format ; Define Menu / Content Types MENU,Food,food MENU,Hot Drinks,hot beverage MENU,Cold Drinks,cold beverage
And the actual entries MUST have a type that matches one of the defined MENU items. ; Content Entries Food,Hot Dog,hot dog Hot Drinks,Earl grey Tea,earlgrey Cold Drinks,Beer,tankard of beer
Like I said before this is pretty generic and could be adapted to almost any content vendor with a little bit of thought.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
Ooops.
09-11-2006 10:09
From: Winter Ventura Newgate... THANK YOU!
This is probably the exact solution I was going to be working on, but just couldn't find the energy to get started on. I can only think of a couple of minor tweaks I'd want to make to this at this point.. it's so close to what I wanted already tho.
One question.. is there any way to have the main menu populated by the different first lines in the Contents list? Probably not, but I'm curious. I'd like to make it bonehead-simpel to add a new class when a class gets overloaded.. like "drinks 2" or "sodas" or "desserts" Just noticed that in my haste to show off I managed to forget to put the prev and next handlers in!!! Will work for 11 items or less... boy is my face red! Corrected code integer CHANNEL = 42; // dialog channel
// There can be up to 12 options per menu, so try to subdivide large menus. // Menu items are listed in threes, starting with the bottom row and working up, // so it's 1, 2, 3 along the bottom, // then 4, 5, 6 on the next row, etc... just like the 10-key number pad.
string notecardName = "Contents List"; integer lineCounter; key dataRequestID;
integer first; integer pagesize = 8;
list MENU_MAIN = ["Food", "Drink"];
list MENU_FOOD; list FOOD_LIST;
list MENU_DRINK; list DRINK_LIST;
list choices; integer len; integer i;
integer Listening = 0;
integer ShowType; integer ShowFood = 1; integer ShowDrink = 2;
UpdateListen(key id) { CancelListen(); Listening = llListen(CHANNEL,"",id,""); llSetTimerEvent(20); }
CancelListen() { if(Listening > 0) llListenRemove(Listening); Listening = 0; llSetTimerEvent(0); }
ShowMainMenu(key userkey) { choices = MENU_MAIN; if(userkey == llGetOwner()) choices += ["Restock"]; // The dialog text llDialog(userkey, "\n What can I get you?", choices, CHANNEL); UpdateListen(userkey); }
ShowFoodMenu(key userkey) { choices = ["MAINMENU"]; // Now add the items len = llGetListLength( MENU_FOOD ); if(first > 0) choices += "Prev"; if(len > (first + pagesize)) { choices += "Next"; //llSay(0,"Adding Next Button " + (string)len + " " + (string)first); } for(i = 0;i < pagesize;i++) { string strname = llList2String(MENU_FOOD,(i+first)); if( llStringLength(strname) > 0) { choices += strname; } } // finally show the dialog llDialog(userkey, "\n What food can I get you?", choices, CHANNEL); UpdateListen(userkey); }
ShowDrinkMenu(key userkey) { choices = ["MAINMENU"]; // Now add the items len = llGetListLength( MENU_DRINK ); if(first > 0) choices += "Prev"; if(len > (first + pagesize)) { choices += "Next"; //llSay(0,"Adding Next Button " + (string)len + " " + (string)first); } for(i = 0;i < pagesize;i++) { string strname = llList2String(MENU_DRINK,(i+first)); if( llStringLength(strname) > 0) { choices += strname; } } // finally show the dialog llDialog(userkey, "\n What drink can I get you?", choices, CHANNEL); UpdateListen(userkey); }
GiveItem(key id, string name, string description, string itemname) { llSay(0, name + " grabs a " + description + " from the fridge."); llGiveInventory(id,itemname); }
default { state_entry() { state ReadNoteCard; } on_rez(integer num) { llResetScript(); } }
state Running { state_entry() { llSay(0,"Fridge fully stocked!"); } on_rez(integer num) { llResetScript(); } touch_start(integer total_number) { key userkey = llDetectedKey(0); ShowMainMenu(userkey); } listen(integer channel, string name, key id, string message) { CancelListen(); // verify dialog choice // present main menu on request to go back integer foodID = llListFindList(MENU_FOOD, [message]); integer drinkID = llListFindList(MENU_DRINK, [message]); if ("MAINMENU" == message) { ShowType = 0; ShowMainMenu(id) ; } else if ("Food" == message) { ShowType = ShowFood; first = 0; ShowFoodMenu(id); } else if ("Drink" == message) { ShowType = ShowDrink; first = 0; ShowDrinkMenu(id); } else if("Restock" == message) { llResetScript();; } else if("Prev" == message) { first -= pagesize; if(ShowFood==ShowType) ShowFoodMenu(id); else if(ShowDrink==ShowType) ShowDrinkMenu(id); } else if("Next" == message) { first += pagesize; if(ShowFood==ShowType) ShowFoodMenu(id); else if(ShowDrink==ShowType) ShowDrinkMenu(id); } else if (foodID != -1) { string item = llList2String(FOOD_LIST,foodID); GiveItem(id,name,message,item); } else if (drinkID != -1) { string item = llList2String(DRINK_LIST,foodID); GiveItem(id,name,message, item); } } timer() { CancelListen(); }
}
//-------------------------- state ReadNoteCard { on_rez(integer num) { llResetScript(); } state_entry() { lineCounter = 0; integer itemtype = llGetInventoryType(notecardName); if(INVENTORY_NOTECARD == itemtype) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10); } else { llOwnerSay("Error - Fridge Contents list notecard missing!"); state Running; }
} dataserver(key queryid, string data) { //Check to make sure this is the request we are making. //Remember that when data comes back from the dataserver, //it goes to *all* scripts in your prim. //So you have to make sure this is the data you want, and //not data coming from some other script. if (dataRequestID) { llSetTimerEvent(0); //If we haven't reached the end of the file if (data != EOF) { dataRequestID = llGetNotecardLine(notecardName, lineCounter); llSetTimerEvent(10);
lineCounter += 1; // Each line is of the form // Type,name,object // FOOD,Hot Dog,Hot dog // DRINK,Can Of Coke,coke can if(llGetSubString(data, 0,0) != ";") { list ldata = llParseString2List(data, [","], [""]); string type = llList2String(ldata, 0); string desc = llList2String(ldata, 1); string item = llList2String(ldata, 2); integer itemtype = llGetInventoryType(item); //llOwnerSay((string)itemtype + " " + data); if(INVENTORY_OBJECT == itemtype) { if("FOOD" == type) { MENU_FOOD = (MENU_FOOD = []) + MENU_FOOD + desc; FOOD_LIST = (FOOD_LIST = []) + FOOD_LIST + item; } else if("DRINK" == type) { MENU_DRINK = (MENU_DRINK = []) + MENU_DRINK + desc; DRINK_LIST = (DRINK_LIST = []) + DRINK_LIST + item; } else { llOwnerSay("Error - Unknown type " + data); } } else { llOwnerSay("Error - " + desc + " (" + item + ") Out of Stock."); } } } else { llSetTimerEvent(0); state Running; } } } timer() { // The notecard read failed so abort llSetTimerEvent(0); llOwnerSay("Error reading Data.Aborting."); state Running; } }
|