Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I need some help

Stephen Arnold
Easy Real Estate - Owner
Join date: 17 Nov 2006
Posts: 16
11-18-2006 09:40
Hello, my name is Stephen Arnold and I am sort of new to the scripting world of Second Life... I have a teeny tiny bit of knowledge but I need some help... Here are some thing that I need...

1) I need someone to "Tutor" me for scripting... I have all these great Ideas in my head but I some help learning how to make the scripts

2) I need someone to help me make a good donation script... So that instead of giving the owner the money that is donated making so that the Creator gets the lindens... (I need it for my church in Second Life and I want to give the boxes away... But I cannot just give them the box and let them get the lindens)

And I think that is about all for now...

Any help is much appreceated...

Signed, Stephen Arnold
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
11-18-2006 09:57
Stephen,
First, WELCOME TO SL SCRIPTING!

2. You might try joining the TEAZERS group. They have various scripting classes several times each day.
3. You should also check out the scripts WIKI, and the examples in the library:

http://www.lslwiki.com/lslwiki/wakka.php?wakka=HomePage

4. As for your specific goal, a search on TIPJAR and DONATION will take you to this thread:
/15/66/127049/1.html
which has a script already written for you. Just add a tithing box and drop the script in. YOu might want to spend some time reading the script to see how it works. there are some places you might want to customize.

5. Finally, payment in SL is a Little tricky. Everything belongs to someone by name. and you can't modify who gets money. (prevents abuse and fraud schemes). So here's my advice:
Create a new, free, single purpose ALT Avitar to place the jars and collect the money. All the funds go to the ALT-so they don't mingle with your money. Then log in and PAY from the alt to your church. If the ALT is also a member of the church's group, more complicated arrangements can be made, but this will get you started.
Raeyan Aldrich
Registered User
Join date: 14 Oct 2006
Posts: 44
11-20-2006 21:44
this should do it, just drop the script in, rez a box yourself and pick it back up. that box is the one you want to distribute for people to set up. make sure to give them the ability to copy it.

CODE

integer gotkey = FALSE;
key sendto;
string churchname = "Set Church Name Here"; //set this to the name of your church

default
{
on_rez(integer rezint) {
if(!gotkey){
sendto = llGetOwner();
llOwnerSay("Got your key, take this object back into your inventory and begin distribution.");
} else {
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
}
}
money(key giver, integer amount) {
llSay(0, "Thank you for donating to " + churchname + "! Add a message here."); // add a message to this line, "God be with you" or something to that extent if you like.
llGiveMoney(sendto, amount);
}
run_time_permissions(integer perm) {
if(perm & PERMISSION_DEBIT){
llOwnerSay(churchname + " donation box online!");
llSetText(churchname + " donation box.\nRight click and choose pay to make a dontaion.",<255,255,255>,1.0)
} else {
llOwnerSay("Must have debit permission to use the donation box. Please rez a new one and give permission.");
llDie();
}
}
touch_start(integer num_detected)
{
llSay(0, "To make a donation: Right click this box and choose pay.");
}
}
Stephen Arnold
Easy Real Estate - Owner
Join date: 17 Nov 2006
Posts: 16
11-25-2006 07:40
Hmm... Thanks for the tips and scripts
_____________________
Stephen Arnold
Founder/CEO
Easy Real Estate

"Making your Second Life a little Easier -- Easy Real Estate"
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-25-2006 08:05
Actually the script as posted wont work
You never set gotkey so it will get the owner each time.

CODE

key sendto = NULL_KEY;
string churchname = "Set Church Name Here"; //set this to the name of your church
string message = "God be with you"; // a message or something to that extent if you like.


GetKey()
{
if(sendto == NULL_KEY)
{
sendto = llGetOwner();
llOwnerSay("Got your key, take this object back into your inventory and begin distribution.");
}
else
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT );
}
}

default
{
state_entry()
{
GetKey();
}

on_rez(integer rezint)
{
GetKey();
}
money(key giver, integer amount)
{
llSay(0, "Thank you for donating to " + churchname + ", " + message);
llGiveMoney(sendto, amount);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
llOwnerSay(churchname + " donation box online!");
llSetText(churchname + " donation box.\nRight click and choose pay to make a dontaion.",<255,255,255>,1.0);
}
else
{
llOwnerSay("Must have debit permission to use the donation box. Please rez a new one and give permission.");
llDie();
}
}
touch_start(integer num_detected)
{
llSay(0, "To make a donation: Right click this box and choose pay.");
}
}
Janka Werribee
Scripter Wannabe
Join date: 28 Oct 2006
Posts: 64
12-11-2006 01:20
A newbie here, but a question:

If you do llGetOwner on rez, does not that mean that if someone else but the creator rezzes the box, they get the lindens? I understood the idea was to forward the L$ to the original creator, regardless of who pays the box, not to take lindens from the owner of the box... I might be confused though! :)
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-11-2006 01:34
From: Janka Werribee
A newbie here, but a question:

If you do llGetOwner on rez, does not that mean that if someone else but the creator rezzes the box, they get the lindens? I understood the idea was to forward the L$ to the original creator, regardless of who pays the box, not to take lindens from the owner of the box... I might be confused though! :)



You are correct which is why I check to see if the sendto variable has a value of NULL_KEY before assigning it the owner key.
Janka Werribee
Scripter Wannabe
Join date: 28 Oct 2006
Posts: 64
12-11-2006 01:51
Ah, right, I see it now. Thanks!
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-11-2006 02:09
From: Janka Werribee
Ah, right, I see it now. Thanks!


Actually I relooked at the code after rereading your question and it is confusing as to why we are debiting the owner.
The pay event will pay the owner the money and so we have to then debit the owner to forward the money on. This could easily be rewritten to only pay a percentage on, which is the basis of a commission script.
Jazz Smalls
Registered User
Join date: 18 Jan 2007
Posts: 1
Thanks
02-06-2007 13:34
This helped me out......
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
llGetOwner
02-06-2007 23:44
llGetOwner is only done once, after that, the owner is "stored" somewhere in some dark dusty server off in a dark corner somewhere in SF. To force a new llGetOwner() to be done, you reset the script when it's rezzed, so that it re-reads who the owner is. for example:

on_rez (integer number)
{
llResetScript();
}

will force the script to actually read again who the owner is...

but.. as far as sending L's to the original creator of the tip jar, why not just use llGetCreator(), which always returns the original creator of the object, and send the L's there.