Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Adding thankyou and whipser into a tip script

Salindria Thunders
Registered User
Join date: 11 Jun 2006
Posts: 29
12-06-2006 08:12
I have been trying to no avail to add a thank you whisper to a customer and another to the reciever of a tip script. Everything I have tried has come up null or basic errors. I cant figure out what to do and have found no solid examples that I can work with the existing script I have.

Script is below, but not complete in some formats due to it is not a free script.

Please forgive not posting the entire script it is a collaboration script and the other person does not want the sript public for some of the things it does. If you have an ide of how I can do this please post for me and I will try it and if it works you will be put in the split on the sale of it. Thanks Sal.

CODE

----
Removed for sale reasons
----

integer pointer=0;
key dancer;
integer take;
string dancerName;
float toDancer;
float toManager;
integer len;

default
{
state_entry()

run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
llGetNotecardLine("managers", pointer);
} else
{
llSay(0, "The owner MUST allow debit permissions for this to work.");
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}
dataserver(key id, string data)
{
if(data!=EOF)
{
managers+=(key)data;
pointer++;
llGetNotecardLine("managers", pointer);
} else
{
toDancer=(float)cutToDancer/100.0;
toManager=1.0-toDancer;
len=llGetListLength(managers);
toManager/=(float)len;
state ready;
}
}
}

state ready
{
state_entry()
{
llSetText("Tip jar - not currently in use", colour, 1.0);
}
changed(integer change)
{
if((change & CHANGED_OWNER) || (change & CHANGED_INVENTORY))
{

-------------

{
llInstantMessage(llDetectedKey(0), "This only works for dance group members with their group active!");
}
}
}

state working
{
state_entry()
{
take=0;

llSensorRepeat("", dancer, AGENT, 96, PI, 60.0);
}
touch_start(integer num)
{
if(llDetectedKey(0)==dancer ||llDetectedKey(0)==llGetOwner())
{
state ready;
}
}
state_exit()
{
integer i;
for(i=0; i<len; ++i)
{
llInstantMessage(llList2Key(managers, i), dancerName+" has just finished. She took a total of "+(string)take+" in tips.");
}
take=0;
dancer=NULL_KEY;
dancerName="";
}
money(key id, integer cash)
{
take+=cash;
integer temp=cash;
integer payManagers=llRound(temp * toManager);
integer i;
for(i=0; i<len; ++i)
{
llGiveMoney(llList2Key(managers, i), payManagers);
temp-=payManagers;
}
llGiveMoney(dancer, temp);
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
}
no_sensor()
integer cutToDancer=80; //Put in the percentage you are going to give to the dancers here. The remainder will be automatically split evenly between the people whose keys are in the managers notecard 60 is 60% to the dancers - 2 managers would get 20% each, 3 would get 6.66% each etc...

vector colour=<1.0, 1.0, 1.0>; //Set this to change the hover text colour.


list managers;
integer pointer=0;
key dancer;
integer take;
string dancerName;
float toDancer;
float toManager;
integer len;

default
{
state_entry()
{
llSetText("Tip jar - setting up", colour, 1.0);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
llGetNotecardLine("managers", pointer);
} else
{
llSay(0, "The owner MUST allow debit permissions for this to work.");
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}
dataserver(key id, string data)
{
if(data!=EOF)
{
managers+=(key)data;
pointer++;
llGetNotecardLine("managers", pointer);
} else
{
toDancer=(float)cutToDancer/100.0;
toManager=1.0-toDancer;
len=llGetListLength(managers);
toManager/=(float)len;
state ready;
}
}
}

state ready
{
state_entry()
{
llSetText("Tip jar - not currently in use", colour, 1.0);
}
changed(integer change)
{
if((change & CHANGED_OWNER) || (change & CHANGED_INVENTORY))
{
llResetScript();
}
}
touch_start(integer num)
{
if(llSameGroup(llDetectedKey(0)))
{
dancer=llDetectedKey(0);
dancerName=llDetectedName(0);
state working;
} else
{
--------------
}
}
}

state working
{
state_entry()
{
take=0;
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
llSensorRepeat("", dancer, AGENT, 96, PI, 60.0);
}
touch_start(integer num)
{
if(llDetectedKey(0)==dancer ||llDetectedKey(0)==llGetOwner())
{
state ready;
}
}
state_exit()
{
integer i;
for(i=0; i<len; ++i)
{
llInstantMessage(llList2Key(managers, i), dancerName+" has just finished. She took a total of "+(string)take+" in tips.");
}
take=0;
dancer=NULL_KEY;
dancerName="";
}
money(key id, integer cash)
{
take+=cash;
integer temp=cash;
integer payManagers=llRound(temp * toManager);
integer i;
for(i=0; i<len; ++i)
{
llGiveMoney(llList2Key(managers, i), payManagers);
temp-=payManagers;
}
llGiveMoney(dancer, temp);
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
}
no_sensor()
{
state ready;
}
}


}


Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
12-06-2006 08:42
I think you may want to edit that post - you seem to have done something odd while pasting the script in, bits of it are duplicated.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
12-06-2006 08:47
Anyway, the basic principle for thanking somebody is just an IM to the key of the person concerned. Note that this sleeps the script for two seconds, so if it needs to be responding to other things constantly (which a tip jar probably doesn't unless you're very lucky) you'd need to use a whisper, or a subscript to IM with. So something like:

CODE
money(key giver, integer amount)
{
...
llInstantMessage(giver, "Thank you for your tip of L$" + (string)amount + "!");
// or
// llWhisper(0, "Thank you for your tip, " + llKey2Name(giver) + "!");
...
// target is the recipient of the money
llGiveMoney(target, amount);
llInstantMessage(target, "You got L$" + (string)amount + " from " + llKey2Name(giver));
...
}
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
12-06-2006 14:04
Can I ask who your collaborator is?

Since the script is mine originally, even to the comments I'm kind of interested.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Salindria Thunders
Registered User
Join date: 11 Jun 2006
Posts: 29
12-22-2006 12:49
From: Eloise Pasteur
Can I ask who your collaborator is?

Since the script is mine originally, even to the comments I'm kind of interested.


Eloise when I get the script moded to the proper setting that I am seeking, your in the credits and the selling commissions hun. If I sell it and dont just give it away, have no worries. I dont take credit for things I don't do. ALso everyone knows Im not great at scripting., but what I seek is not in SL and will change the way people look at tip jar scripts. Oh yeah there will be more people writing these scripts after its done I'm sure.**grins**


Amd thanks for the help everyone.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-22-2006 13:12
potential copyright issues aside, I've found using IMs for thank-yous to be preffered when I create vendors for clients.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
12-22-2006 19:07
I find the concept of a tip jar in sl to be silly myself. There really is no point.

First, why tip dancers and such when they don't do a damn thing for you. And if you really like a DJ or a really fun host you can just right click on them and select pay if you want to tip them. No need for a tip jar.
_____________________
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
12-22-2006 19:44
Of course the tip jar is there so the club owner can take his/her commission. Without whom there would be no host/dj/dancer.

-peekay