Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string CONFIG_CARD = ":!:Kawaii Inc.:!: Talking Teddy";
- list Sayings;
- integer NotecardLine;
- key QueryID;
- default
- {
- state_entry()
- {
- llOwnerSay("Initializing...");
- if (llGetInventoryType(CONFIG_CARD) == INVENTORY_NOTECARD)
- {
- NotecardLine = 0;
- QueryID = llGetNotecardLine( CONFIG_CARD, NotecardLine );
- }
- else
- {
- llOwnerSay("Configuration notecard missing. :'C");
- }
- }
- dataserver( key queryid, string data )
- {
- integer index;
- string name;
- string value;
- if ( queryid == QueryID )
- {
- if ( data != EOF )
- {
- if ( llGetSubString(data, 0, 0) != "#" && llStringTrim(data, STRING_TRIM) != "" )
- {
- index = llSubStringIndex(data,"%n");
- if(index != -1)
- {
- data = llDeleteSubString(data, index, 1);
- data = llInsertString(data, index, llKey2Name(llGetOwner()));
- }
- Sayings += [data];
- }
- NotecardLine++;
- QueryID = llGetNotecardLine( CONFIG_CARD, NotecardLine );
- }
- else
- {
- state Running;
- }
- }
- }
- state_exit()
- {
- llOwnerSay("Initialization Complete!");
- }
- }
- state Running
- {
- state_entry()
- {
- llSetTimerEvent(1);
- }
- changed(integer change)
- {
- if ( change & CHANGED_INVENTORY)
- {
- state default;
- }
- }
- timer()
- {
- float i = llFrand((float)llGetListLength(Sayings));
- llSetTimerEvent(12);
- llSay(0, llList2String(Sayings, (integer)i));
- }
- }
- ---------------------------------------------------
- #notecard named :!:Kawaii Inc.:!: Talking Teddy
- # :!:Kawaii Inc.:!: Talking Teddy created by Kieko Runo in partnership with Zorn Taov
- # Your Teddy is customizable. To customize simply add your sayings at the bottom of this NC. If you want your teddy to speak directly to you use %n in place of your name.
- Hi %n, Do you want to go outside and play today?
- I love you %n!
- You did great %n. Keep up the good work!
- How was your day %n?
- Psst %n i got a secret to tell you. You're the bestest friend i ever had. :D
- %n, was that your tummy i heard? Maybe we should get some pizza. :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement