Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Giving Out Linden Dollars

Taylor Bracken
Registered User
Join date: 26 Apr 2007
Posts: 42
05-15-2007 10:24
Hi there -

I'd like to "pay" people to take a survey.

Is there a good example script you know of that would pay someone to take a survey, or even send them the money using RSSXML at a later time?

thanks - TB
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
05-15-2007 12:52
A couple things:

-The script/object giving money must be owned by the person the funds are coming from.
-llGiveMoney() is the function you want to use here.
-Remember you can't give out money without giving the script 'permission' to debit your account first. Use llRequestPermissions() to do this.

Here's a hastily written & untested example:

CODE
list choices = ["red", "yellow", "blue"];
integer redcount = 0;
integer bluecount = 0;
integer yellowcount = 0;
integer handle;

default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
llSetText("Click me to begin the survey!",<1,1,1>,1);
}

touch_start(integer num_detected)
{
llDialog(llDetectedKey(0),"What is your favorite color?", choices, 5);
llGiveMoney(llDetectedKey(0),1);
handle = llListen(5,"",llDetectedKey(0),"");
llSetTimerEvent(30);
}

listen(integer channel, string name, key id, string message)
{
if (message == "red") {redcount++;}
if (message == "blue") {bluecount++;}
if (message == "yellow") {yellowcount++;}
if (message == "red" || message == "blue" || message == "yellow")
{
llInstantMessage(id, "Thank you for completing our survey! Here's L$10!");
llGiveMoney(id, 10);
llListenRemove(handle);
}
}

timer()
{
llWhisper(0,"Your choices have timed out. Please click again to retry the survey!");
llListenRemove(handle);
}

}
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.
Taylor Bracken
Registered User
Join date: 26 Apr 2007
Posts: 42
05-15-2007 13:07
Thanks! TB