Distribution server??
|
|
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
|
09-02-2007 03:07
I had somebody make me a few scripts awhile ago; one was for a vending machine that vended soda for 2L, 1L went to the owner of the machine, and 1L went to me. The other was for a kind of...counting server, which would display how many sodas were sold from the collective vending machines. And the last was a script that'd make it so when the owner is holding the soda, every few seconds their AV would take a sip. After a couple dozen sips, the AV would automatically throw out the soda, and would have to buy another. I meant to be able to sell the machines themselves for people to put up in their shops (hence 1L to the owner 1L to me), but I forgot to ask for a distribution server script! I clearly can't sell the machines without one, I'd have to give the sodas they vend trans rights so the buyers can receive them, and copy rights so the machine wouldn't run out, which wouldn't be too smart since once someone buys a soda, they'd never have to buy another again, and could also distribute them themselves! I could always just fill every machine with a large amount of sodas, but that'd be highly impractical. I can't find anyone to make the script for me, and I have no idea whatsoever how to make it myself. So, can anyone show me how??
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
09-02-2007 09:16
How to make one:
--Create a 'client' in the soda-vending machine that, when a soda is purchased, sends a request to a server.
--Create a server that, when it receives a request, sends a soda in inventory to the purchasing customer.
Why can't you find these scripts widely available? Because they're "advanced" scripts that are often the key components to networked vendor systems that sell for L$1000+.
Some vendors use an llEmail to communicate with their servers. Other vendors use XML-RPC to communicate with their servers (better). The flow is relatively easy:
--rez vendor and receive inventory list from sever. --allow customer to choose product through buttons. --on money(), check if amount is appropriate and send purchase req. to server --Send product from server to customer.
I've got a nice, really low-lag networked vendor script that I could customize to your needs and get to you--but it would cost you.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
|
09-02-2007 14:21
From: Kenn Nilsson I've got a nice, really low-lag networked vendor script that I could customize to your needs and get to you--but it would cost you.
Well, thanks for the guideline, but I really have no idea how to do any of that, so it seems buying the script would be my only option. Where can I find a script that would work, or how much you want for yours?
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-02-2007 18:19
But this kinda seems like overkill. The item being vended is a L$2 drink, not an L$5000 skin, so I'd be pretty tempted to "cheap out" on the solution. The easiest approach might be to just sell the product with the copy/trans drinks as separate items in the box, with instructions to change their perms before loading them into the machine's contents--the machine owner should have a vested interest in complying. Eventually, full perm copies will "leak out," but maybe by then it won't matter that much, and unless they do something spectacularly better than the freebie Coke cans, they may not circulate widely anyway.
The drinks themselves should probably llDie on a timer--they might already (the "throwing out" bit). For something of serious value, this doesn't really protect the item, but again, this is a L$2 drink at stake.
On the other hand, the "counting server" must already be getting messages (by llEmail, I'd guess) from each of the vending machines. Managing that part is the trickiest bit about setting up a vendor network, so if that's already done, maybe the vending approach isn't such a huge step to take. (I think there's at least one llEmail-based networked vendor script in the Library; but I've always written my own, so can't vouch for its completeness or reliability.)
|
|
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
|
09-02-2007 18:56
Like I said before, its entirely possible for me to just fill the machines with a large amount for sodas that are no mod, no copy, trans. It'd be a pain though because if these things take off, I'd spend all day refilling the machines manually. And yes, the sodas do llDie, after I think it was 50 sips, the soda llDies and the can object is thrown onto the floor in front of you as a temporary object
|
|
Ilmira Yesheyev
Registered User
Join date: 8 Dec 2006
Posts: 40
|
09-02-2007 19:16
This si a simple Client /server distribution I found in world. It may or may not suit your needs, but may be a starting point for you. Server Code: // Distributed item giver (I made it to use with my store landmarks, since I kept having to update multiple vendors) // You do not need to change anything in this script, just put your items in the server prim that you want handed out when the "giver" prim is touched. // // NOTE: THE UUID OF THE SERVER MUST NEVER CHANGE! If it does you'll need to update ALL the child scripts. This means you can NEVER pickup the server prim. // A simple way to move the server is to right-click the prim, and select "wear", "right hand", // proceed to teleport or fly to your new location, right-click the prim again and select "DROP", // (NOT DETACH! if you detach it will move into your inventory and the unique UUID will be lost) // // Lasivian Leandros
string gServerKey = ""; list inventory_types = [INVENTORY_BODYPART,INVENTORY_CLOTHING,INVENTORY_LANDMARK,INVENTORY_NOTECARD,INVENTORY_OBJECT,INVENTORY_SCRIPT,INVENTORY_SOUND,INVENTORY_TEXTURE]; integer j; integer k; integer type; integer typecount; string objectname;
default { on_rez(integer i) { llResetScript(); } state_entry() { gServerKey = llGetKey(); llSetObjectDesc(gServerKey); llSetText(llGetObjectName() + "\n Key: "+ gServerKey,<0,1,0>,1.0); llSetTimerEvent(2.5); // I would not speed this up beyond one e-mail check per 2.5 seconds, it's laggy enough as it is. }
touch_start(integer total_number) { gServerKey = llGetKey(); llSetText(llGetObjectName() + "\n Key: "+ gServerKey,<0,1,0>,1.0); llInstantMessage(llDetectedKey(0), "Update Server Key is: " + gServerKey); } email(string time, string address, string subj, string message, integer num_left) { key target = subj; // This allows you to test the system without getting all the junk it's setup to give ouy if (target == llGetOwner()) { llOwnerSay("Touch received on a client prim from you."); //return; // If you want to get copies of the given items yourself uncomment this line } integer total_number = 1; //gMessageList = llParseString2List(message, ["\n", "Object-Name: ", " Update", " System"], []);//Break up the content of the e-mail. integer i; for (i=0;i<total_number;i++) { integer inventory_count = llGetListLength(inventory_types); string myname = llGetScriptName(); for (j=0; j<inventory_count;j++) { type = llList2Integer(inventory_types,j); // get the next inventory type from the list typecount = llGetInventoryNumber(type); // how many of that kind of inventory is in the box? if (typecount > 0) { for (k=0; k<typecount;k++) { objectname = llGetInventoryName(type,k); if (objectname != myname) // don't give self out so the user doesn't get fifty thousand copies. { llGiveInventory(target,objectname); } } } } } } timer() { llGetNextEmail("", ""); // check for email with any subject/sender } }
Client Code: //This half the the setup is dead simple, it just sends the key of the person that touched the prim this script is in off to the server, which then distributes the items inside it.
string gTargetKey = ""; // Update this with the UUID of your server prim. //string gTargetKey = "b041bc00-3d6a-41f7-f65d-81aa36093fca"; //uncomment out this line to see how it should work if you're having trouble with your own.
default { touch_start(integer total_number) { llEmail(gTargetKey + "@lsl.secondlife.com", llDetectedKey(0), "");
|
|
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
|
09-02-2007 20:51
Thanks, it looks like it'd mostly work, except for the vendor side. It looks like just touching the machine would send the toucher the soda for free, instead of paying first.
|
|
woofbag Fudo
Registered User
Join date: 3 Aug 2006
Posts: 31
|
09-03-2007 15:58
How would I make it so you have to pay the clirnt first before it distributes the soda?
|
|
Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
|
09-03-2007 17:50
I found this script it could be helpfull its a simple vendor you could tweak it to sell the can //Title: Vendor to Sell to Only One Person //Date: 01-28-2004 04:38 PM //Version: 1.0.0 //Scripter: Ama Omega // string name = "Nameofpersonbuying"; integer price = 10; // adjust accordingly string item = "nameofitem"; default { state_entry() { llRequestPermissions( llGetOwner(), PERMISSION_DEBIT ); } run_time_permissions(integer perms) { if (perms & PERMISSION_DEBIT) state run; } } state run { money(key id, integer amount) { if (llKey2Name(id) == name) { if (amount != price) { llWhisper(0,"Sorry! The price is $" + (string)price); llGiveMoney(id,amount); } else { llGiveInventory(id,item); llInstantMessage(llGetOwner(),name + " bought their item."  ; state sold; } } else { llWhisper(0,"Sorry I'm only selling this to " + name); llGiveMoney(id,amount); } } } Its only to be sold to one person but you can tweak it easily and take what you need from it
|
|
Steve Crowley
Registered User
Join date: 29 Jun 2006
Posts: 14
|
Is this so hard?
11-09-2007 09:48
Hi, still after a set of scripts for this ?
Let me know, Perhaps I can help you out some...
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
11-10-2007 03:50
I have enough soda cans (that never die...) to choke a dancing cow from my freebie days. I highly doubt people will pay (even as little as 2L) to receive a product that has such a short life, and gillions of pop vendors out there give you a never dying can of pop for free. Harder then selling a time limited can of pop will be selling the vending system to people who'll only make $1L per sale. Perhaps you're planning to give away the system, and make your money via the sales split, but even at that, I (personally, and this is just me) would have no interest in such an item because never dying cans of pop are everywhere. Also, I'd be sure inform the buyer that their can of pop is not permant, or you'll get IM's from angry customers who cannot find the can of pop they just bought, or be miffed that the can of pop was time limited at the very least. I'm not trying to discourage you, quite the opposite... I credit your intent to be a content creator and encourage you to continue to do so. However, I just wanted to inform you of the reality that this paticular venture will (most likely) not make you very much money, and you run the risk of people being angry that they're not getting the product for an indefinate period of time. 
|