Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Money Donate  

Donate

Donate.lsl

Category: Money
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Donate
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Donate_1.lsl
1
2 //Variables
3 integer randomDialogChannel;
4 integer donationAmount;
5 integer listenID;
6 key theirkey; // place to save the guy that touched us's key
7
8 //Options
9
10 // you need to add your key!!
11 key recepient = "93ffa6cc-e2c6-431c-b67c-54cdb7882265"; //Key for Fox, please add it here using the Key Prim script
12
13 default
14 {
16 {
17 //Select a random dialog channel so we don't conflict with other scripts
18 randomDialogChannel = -(integer)llFrand(2147483647);
19 }
20 on_rez(integer start_param)
21 {
22 //Always reset on rez
24 }
25 run_time_permissions(integer permissions)
26 {
27 if(permissions & PERMISSION_DEBIT)
28 {
29 //If we have received permissions to debit account, send money
30 llGiveMoney(recepient, donationAmount);
31 llSay(0,"Thank you very much for your donation!");
32 llInstantMessage(recepient, llKey2Name(llGetOwner()) + " just donated L$" + (string)donationAmount + " via the built-in donation option");
33 }
34 llResetScript(); //Reset the script to remove permission to debit account
35 }
36
37 touch_start(integer total_number)
38 {
39 theirkey = llDetectedKey(0);
40 }
41
42
43 listen(integer channel, string name, key id, string message)
44 {
45 donationAmount = (integer)message;
46
47 //Process amount selected in dialog
48 if(donationAmount > 0)
49 {
51
52 llOwnerSay("Requesting Permissions to send donation ...");
54 }
55 }
56 link_message(integer sender_num, integer num, string str, key id)
57 {
58 //Receive message from dialog script
59 if(num == 324235353254)
60 {
61 llListenRemove(listenID);
62 listenID = llListen(randomDialogChannel, "", theirkey, "");
63 llDialog(theirkey, "Thank you for donating !\nPlease select the amount of L$ you would like to donate below...", ["10", "5", "1", "100", "50","25", "1000", "500", "250"], randomDialogChannel);
64 }
65 }
66
67 }
68 // END //

Back to the Best Free Tools in Second Life and OpenSim.