Setting up OnRez vendors to hand out notecards


Setting up OnRez vendors to hand out notecards


The other day, I posted a question asking Where are the people?. I had a few people visit my shop to look around and make a few comments about why people don’t come, don’t stick around, or simply haven’t heard of me.


Peter Stindberg was one of these people and took a look at the shop early today. I was not awake yet, but he was kind enough to leave a comment on my blog.

I checked out your shop today for the first time. A problem I identify is that apart from the vendor texture no other information on the objects on sale are given (unless you take the time to visit the web storefronts). Not being an impulse buyer that I am, I pleased myself wht window shopping. Thanks for the 3 freebies I got - two from lucky chairs and one for me simply being there :-)



Some of the more interesting items you have, I have on my project list too. Sometimes you HAVE to make things yourself :-)


Note cards are one thing that I’ve noticed about the on-rez vendors. Just about every vendor system that I have worked with offers note cards when someone touches the preview panel. OnRez apparently does not. Instead, it gives you a URL for more details on their website.


I posted a feature suggestion today for the folks to look over at OnRez. In the mean time, I found a way to do it one my own. Each time someone clicks the preview panel, I shoot off an email to a server that I created in-world with the avatars key, and the name of the product all in the subject. The server pulls out the product name and checks to see if a notecard exists by that name, or a few suffixes that I usually append on the end (Hat Info, Hat (boxed) Info, Hat (boxed)_nc, Hat (voucher)_nc). If the notecard is found, it sends it off to the avatar who touched the preview panel. Otherwise it sends them a message that the information could not be found, and it sends me a message as well so I can create a new one.


This is an extreamly simple solution. I just drop a script into each of my vendors.


string lastProduct;
string notecardServer = “ac397da7-82f8-fc28-ea25-02aec84accf0@lsl.secondlife.com”;
default
{
touch_start(integer total_number)
{
integer i;
for(i = 0; i if(llGetLinkName(llDetectedLinkNumber(i)) == “Preview”)
llEmail(notecardServer, (string)llDetectedKey(i) + lastProduct, “”);
}
link_message(integer sender, integer num, string msg, key id)
{
if(num != 1140) return;
integer i = llSubStringIndex(msg, ” - “);
if(i == -1) return;
msg = llGetSubString(msg, i + 3, -1);
i = llSubStringIndex(msg, “\n”);
if(i == -1) return;
msg = llGetSubString(msg, 0, i - 1);
lastProduct = msg;
}
}


And my notecard server looks like the following:


init()
{
llOwnerSay(”My address is: ” + (string)llGetKey() + “@lsl.secondlife.com”);
llSetTimerEvent(5.0);
}
string noteCardName(string product)
{
if(llGetInventoryType(product) == INVENTORY_NOTECARD)
return product;
if(llGetInventoryType(product + ” Info”) == INVENTORY_NOTECARD)
return product + ” Info”;
if(llGetInventoryType(product + “_nc”) == INVENTORY_NOTECARD)
return product + “_nc”;
if(llGetInventoryType(product + ” (boxed)_nc”) == INVENTORY_NOTECARD)
return product + ” (boxed)_nc”;
if(llGetInventoryType(product + ” (voucher)_nc”) == INVENTORY_NOTECARD)
return product + ” (voucher)_nc”;
return “”;
}
default
{
state_entry()
{
init();
}
on_rez(integer start_param)
{
init();
}
touch_start(integer total_number)
{
init();
}
timer()
{
llGetNextEmail(”", “”);
}
email(string time, string address, string subj, string message, integer num_left)
{
key avatarId = (key)llGetSubString(subj, 0, 35);
string product = llGetSubString(subj, 36, -1);

string noteCard = noteCardName(product);

if(noteCard != “”)
{
llGiveInventory(avatarId, noteCard);
return;
}

llInstantMessage(llGetOwner(), “Notecard not found for ” + product);
llInstantMessage(avatarId, “A notecard was not found for this item.”);
}
}

Woodbridge (83, 81) - Jan 27, 2008 (309 days ago) by Dedric Mauriac

Tags for this Snapshot

0 01 1 1140 2008 22 3 35 36 5 ac397da782f8fc28ea2502aec84accf0lsl address apparently append avatar avatarid avatars awake blockquote blockquotei blog blogspot boxed br buyer cards chairs checked checks clicks comment comments create created day dedricmauriac default details drop early email end exists extreamly feature folks found freebies hand hat heard hrefhttp identify impulse info information init integer interesting inventorynotecard inworld item items key kind lastproduct leave linkmessage list lldetectedkey lldetectedlinknumber llemail llgetinventorytype llgetkey llgetlinkname llgetnextemail llgetowner llgetsubstring llgiveinventory llinstantmessage llownersay llsettimerevent llsubstringindex lsl lucky make message msg n nc note notecard notecardname notecards notecardserver noticed num numleft objects offers onrez p panel people peter pleased posted preview problem product project pulls question return sale script secondlife sender sends server setting shoot shop shopping simple simply solution startparam stateentry stick stindberg storefronts string subj subject suffixes suggestion system texture thing things time timer today totalnumber touched touches touchstart url vendor vendors visit voucher web website wherearethepeople wht window woodbridge wordpress worked xmp

Leave a Comment

You're not logged in. If you want to post a comment, please log in.