|
Robertt Goodliffe
Registered User
Join date: 1 Jan 2006
Posts: 16
|
12-19-2006 12:34
Here is a simple script that gives out money to who ever touches the object. the object then destroys itself.
default { state_entry() { llRequestPermissions(LLGetOwner(),PERMISSION_DEBIT); } touch_start(integer num_detected) { llGiveMoney(llDetectedKey(0),1); llDie(); } }
How would I modify this script so that no matter who owns the object it still gives money from MY FUNDS. so for example I give the object to Joe Blogs rezes the object touches and receives $1 from me. Is it possible or do I have to have a secondary object owned by me that gives out the money that the first object talks to, if so how would i script that?
Thanking you for your help.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-19-2006 12:43
You cant. llGiveMoney will only take funds from its owner.
You could possibly set it up such that the giver object registers its owner with your server that then paid the owner the same amount that they had paid out? Would require secure comms and careful handling.
BRAIN DEAD NEWGY!!!! The obvious way is to post the request back to another object that you do still own and get it to pay out. Woudl still need careful set up.
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
12-19-2006 12:48
You could use HTTPRequest()/XMLRPC or email communication to connect back to a server object that gives money to the person.
There'd likely be a bit of delay in doing that though.
|
|
Robertt Goodliffe
Registered User
Join date: 1 Jan 2006
Posts: 16
|
So it would have to be a secondary object.
12-19-2006 12:55
Ok so i think i would have to set up a second object.
So how would i do that?
I figure the owner of the object touches it and obviously this iniatiates communication to the secondary object owned by myself, sending the owners key. I dont know how to communicate between seperate objects. The seconday object gets the message with the Key and then pays the person the appropriate amount.
Where my scripting knowledge ends is with the Sending of the message to the secondary object and the listen commands required in the secondary object?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-19-2006 12:55
Personally I'd use email, I dont really have a handle on the HTTP and RPC stuff yet. The end user touched the giver object that captures their key and emails the server to pay them. You can even use the 20 second email delay to prevent someone from over using the giver. bare bones ideas here Giver Script key ServerID = "ddc6266b-7d80-7e1f-27c9-b1705a1c1d30"; // key of server prim string SecretCode = "Soemthing you can use to Identify yourself";
default { state_entry() { llSetColor(<1.0,1.0,1.0>,ALL_SIDES); } on_rez(integer number) { llResetScript(); }
touch_start(integer total_number) { llSetColor(<0.75,0.0,0.0>,ALL_SIDES); llSay(0,"Contacting Server Please wait"); llEmail(ServerID + "@lsl.secondlife.com",SecretCode,(string)llDetectedKey(0)); llSetColor(<1.0,1.0,1.0>,ALL_SIDES); } }
Server Script string SecretCode = "Soemthing you can use to Identify yourself"; integer amount = 1;
default { state_entry() { llSetTimerEvent(0); llRequestPermissions(llGetOwner() , PERMISSION_DEBIT ); //Ask my owner for permission to give money and assume it suceeds key objid = llGetKey(); string strid = (string)objid; llSay(0, "Pay Server -" + strid); llSetTimerEvent(10); // poll for emails (yes, that is a retarded way on an event-based system) } timer() { llGetNextEmail("", ""); // check for email with any subject/sender } email(string time, string address, string subj, string message, integer num_left) { if(subj == SecretCode) { // Strip of Preamble added by SL message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1); key id = (key)message; llGiveMoney(id,amount); } } }
One thing to remember, the server cannot be rerezzed or its ID will change and all existing givers will stop being able to pay out. Could add a menu to the payer to allow you to set up amounts etc.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-19-2006 13:26
From: Jacques Groshomme You could use HTTPRequest()/XMLRPC or email communication to connect back to a server object that gives money to the person.
There'd likely be a bit of delay in doing that though. Sorry You posted while I was re-editing after realsing how bloody stupid my idea was.
|