Tipjar Script Help - SLUniverse Forums
Navigation » SLUniverse Forums > Development Discussion and Support > Scripting » Tipjar Script Help


Scripting Discuss scripting and programming for SL and other platforms

 
Reply
 
LinkBack Thread Tools Display Modes
Old 02-20-2009, 05:20 PM   #1 (permalink)
The Gingerbeard Man

*SLU Supporter*
 
Lewis Luminos's Avatar
Class of '08
 
Join Date: Aug 2008
Location: UK
Posts: 6,816
My Mood:
SL Join Date: 08/11/2008
Business: Club Noir
Client: Firestorm and v2
Blog Entries: 17
Tipjar Script Help

I have a tip-jar script, a freebie from the NCI. When a donor clicks on it to pay, they get 4 buttons to choose from in the amounts of L$1, L$5, L$10 and L$20. I would like to change the amounts on these buttons. How do I do that?

Quote:
default
{
state_entry()
{

}

money(key giver, integer amount)
{
llSay(0, "Thank you, " + llKey2Name(giver) + " for your donation!");
if (llKey2Name(llGetOwner()) != "")
{
llInstantMessage(llGetOwner(), llKey2Name(giver) + " just donated L$" + (string)amount);

}
}
}
__________________
Club Noir - 24/7 Jazz and Swing


Quote:
Originally Posted by Shiloh Lyric View Post
So, next time we get called a 'viper's nest', I'm going to take that to mean a community full of people who, even through disagreement and argument, are caring, kind, compassionate, accepting and completely awesome. Oh, and not very fond of fools, liars and thieves. I'm pretty proud to be a part of this nest of hive-mind vipers.
Lewis Luminos is offline   Reply With Quote
Old 02-20-2009, 05:29 PM   #2 (permalink)
Nekoquettish
 
Geaven Gall's Avatar
Wanderer
 
Join Date: Sep 2007
Location: Australia
Posts: 727
SL Join Date: 07-28-2005
Business: GG Creations
lewis, you can use llSetPayPrice in the state_entry() event.

this would be something like:
llSetPayPrice(PAY_DEFAULT, [1, 5, 10, 20]);

more info can be found here: LSL Wiki : llSetPayPrice
__________________
My shop on the marketplace:
GG Creations
Geaven Gall is offline   Reply With Quote
Old 02-20-2009, 05:30 PM   #3 (permalink)
Tastes like purple
 
Dnate Mars's Avatar
Error, failure to load Status
 
Join Date: Sep 2007
Location: Home
Posts: 11,735
My Mood:
SL Join Date: 01/27/2004
Business: Scripter for hire
Send a message via Yahoo to Dnate Mars Send a message via Skype™ to Dnate Mars
You need to add llSetPayPrice somewhere.

Like this:
Code:
default
{
state_entry()
{
llSetPayPrice(PAY_DEFAULT, [10,20,50,100]) ;
}

money(key giver, integer amount)
{
llSay(0, "Thank you, " + llKey2Name(giver) + " for your donation!");
if (llKey2Name(llGetOwner()) != "")
{
llInstantMessage(llGetOwner(), llKey2Name(giver) + " just donated L$" + (string)amount);

}
}
}
Just change the numbers and you are set!
__________________
I'm not dead yet....

Dnate Mars is offline   Reply With Quote
Old 02-20-2009, 06:30 PM   #4 (permalink)
The Gingerbeard Man

*SLU Supporter*
 
Lewis Luminos's Avatar
Class of '08
 
Join Date: Aug 2008
Location: UK
Posts: 6,816
My Mood:
SL Join Date: 08/11/2008
Business: Club Noir
Client: Firestorm and v2
Blog Entries: 17
Thanks guys!
Lewis Luminos is offline   Reply With Quote
Old 03-01-2009, 04:07 PM   #5 (permalink)
Zero Gravitas
 
Talwyn Mills's Avatar
You can't run away forever, but there's nothing wrong with getting a good head start..
 
Join Date: May 2008
Location: UK
Posts: 1,030
My Mood:
SL Join Date: 21 April 2007
Business: TalTECH Weapons
Client: Firestorm
And change the llInstantMessage to llOwnerSay since your only sending messages to the items owner, llInstantMessage has a 2 second delay, llOwnerSay doesn't.
Talwyn Mills is offline   Reply With Quote
1 User Agreed:
Old 03-01-2009, 05:33 PM   #6 (permalink)
dorkasaurus

*SLU Supporter*
 
Carter-Madhu's Avatar
good looking ullu di patthi
 
Join Date: Mar 2008
Location: N.E. United States
Posts: 2,662
My Mood:
SL Join Date: Nov 2007
Client: Viewer 2.x
Blog Entries: 4
Quote:
Originally Posted by Talwyn Mills View Post
And change the llInstantMessage to llOwnerSay since your only sending messages to the items owner, llInstantMessage has a 2 second delay, llOwnerSay doesn't.
llOwnerSay won't send you a message when you are offline, correct?
Carter-Madhu is offline   Reply With Quote
Old 03-02-2009, 06:15 PM   #7 (permalink)
Zero Gravitas
 
Talwyn Mills's Avatar
You can't run away forever, but there's nothing wrong with getting a good head start..
 
Join Date: May 2008
Location: UK
Posts: 1,030
My Mood:
SL Join Date: 21 April 2007
Business: TalTECH Weapons
Client: Firestorm
Quote:
Originally Posted by Madhu Maruti View Post
llOwnerSay won't send you a message when you are offline, correct?
True, it also wont send you a message if you have not been in the same simulator as the tip jar since you logged in. If that's an issue, then llInstantMessage is probably a good bet. If the delay is an issue you could use a number of slave scripts that send the IM and rotate between them.
Talwyn Mills is offline   Reply With Quote
Old 03-02-2009, 07:21 PM   #8 (permalink)
The Gingerbeard Man

*SLU Supporter*
 
Lewis Luminos's Avatar
Class of '08
 
Join Date: Aug 2008
Location: UK
Posts: 6,816
My Mood:
SL Join Date: 08/11/2008
Business: Club Noir
Client: Firestorm and v2
Blog Entries: 17
I don't think the delay will be an issue, I'm not really expecting many people to use it.
Lewis Luminos is offline   Reply With Quote
Old 05-10-2012, 07:33 PM   #9 (permalink)
Swing Kid

*SLU Supporter*
 
Madison Talon's Avatar
Life is a cabaret old chum, come to the cabaret....
 
Join Date: Oct 2008
Location: Kolob
Posts: 1,974
My Mood:
SL Join Date: November 8,2006
Client: Singularity
Blog Entries: 3
what is the code for the hover text to be the color white???
__________________

Madison Talon is offline   Reply With Quote
Old 05-10-2012, 09:54 PM   #10 (permalink)
Nasty Brit
 
Innula Zenovka's Avatar
Wants *things*
 
Join Date: May 2009
Posts: 10,241
SL Join Date: 17 June 2007
Business: Something Spunky
Quote:
Originally Posted by Madison Talon View Post
what is the code for the hover text to be the color white???
It's
Code:
llSetText("Some Text",<1.0,1.0,1.0>,1.0);
You can find vector codes for some more colours in the wiki, along with some functions for converting HTML colours to LSL, if you need to.

The 1.0 at the end is the transparency of the text -- 1.0 is completely opaque.
__________________
Innula Zenovka is offline   Reply With Quote
1 User Said Thanks:
Old 05-10-2012, 10:07 PM   #11 (permalink)
Member
 
Ugleh Ulrik's Avatar
 
Join Date: Dec 2011
Posts: 80
My Mood:
You could probably find a function like Innula said to convert HTML Color to LSL, I have one in my Utility hud that is not for sale yet, but here is the math

Ugleh Ulrik is offline   Reply With Quote
Old 05-10-2012, 10:18 PM   #12 (permalink)
That Bitch

*SLU Supporter*
 
Void's Avatar
Innocent as far as you know
 
Join Date: Nov 2011
Location: Online
Posts: 8,865
My Mood:
SL Join Date: late 04 original account, mid 05 current
Quote:
Originally Posted by Talwyn Mills View Post
True, it also wont send you a message if you have not been in the same simulator as the tip jar since you logged in. If that's an issue, then llInstantMessage is probably a good bet. If the delay is an issue you could use a number of slave scripts that send the IM and rotate between them.
I would be very careful with using slave script to get around such limits...

most of the delays >0.2sec were placed to reduce simulator load. when LL realized that people were using this trick to beat the limit, they started going back and placing the limits in the region code... most of these are now limited for all scripts by the same owner, per region (this one included)....

you may be able to get a higher burst rate from them, but if you cap out on the burst rate or the base rate messages will be throttle... and by throttled I mean dropped... until they fall below the accepted rate (and dropped messages still count towards the going rate as a spam prevention measure)
__________________
- These eyes can do more than see
Quote:
Originally Posted by Cajsa Lilliehook View Post
It's not enough to care about liberty if the only liberty you care about is your own.
Quote:
Originally Posted by Jupiter Firelyte View Post
Why doesn't anyone ever ask, "What is the real meaning of the winter solstice?"
Quote:
Originally Posted by Eboni Khan View Post
Thanks for being passive agressive.
Void is offline   Reply With Quote
Old 05-10-2012, 10:33 PM   #13 (permalink)
That Bitch

*SLU Supporter*
 
Void's Avatar
Innocent as far as you know
 
Join Date: Nov 2011
Location: Online
Posts: 8,865
My Mood:
SL Join Date: late 04 original account, mid 05 current
hmm I though I had posted my color converter functions to the LSL Portal, but apparently I only posted the HSL<->RGB percentage functions...

of course conversion from other sources is easy... subtract the lower bound of the range, from the upper bound, (for instance, web colors are 0-255 for each color, so 255) and divide the value you have by that range...

it's now a percentage that works well with image maps, and can go in a vector (web colors done this way are LSL colors), or packed into an integer (sometimes useful for link messages and start_param's)
Void is offline   Reply With Quote
Old 05-11-2012, 12:07 AM   #14 (permalink)
Member
 
Ugleh Ulrik's Avatar
 
Join Date: Dec 2011
Posts: 80
My Mood:
Some sloppy version i made

[Linden Scripting] HTML2RGB - Pastebin.com
Ugleh Ulrik is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On