Tip Jar - ALIZmediaScript.lsl

Discuss scripting tips and techniques with other inworld developers. All scripting related discussions are encouraged here.

Tip Jar - ALIZmediaScript.lsl

Postby Vincent » February 20th, 2013, 15:40:02

ALIZmediaScript.lsl - A tip jar with variable pay from a blue dialog

Code: Select all
// Script Name: ALIZmediaScript.lsl
// Author: Ali Virgo
//A tip jar with variable pay from a blue dialog

// This program is free software; you can redistribute it and/or modify it.
// Additional Licenes may apply that prevent you from selling this code
// and these licenses may require you to publish any changes you make on request.
//
// There are literally thousands of hours of work in these scripts. Please respect
// the creators wishes and Copyright law and follow their license requirements.
//
// License information included herein must be included in any script you give out or use.
// Licenses may also be included in the script or comments by the original author, in which case
// the authors license must be followed, and  their licenses override any licenses outlined in this header.
//
// You cannot attach a license to any of these scripts to make any license more or less restrictive.
//
// All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
// Commercial use is NOT allowed - no resale of my scripts in any form. 
// This means you cannot sell my scripts but you can give them away if they are FREE. 
// Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
// For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
// See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
// You must leave any author credits and any headers intact in any script you use or publish.
///////////////////////////////////////////////////////////////////////////////////////////////////
// If you don't like these restrictions and licenses, then don't use these scripts.
//////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////

// CATEGORY:Tip Jar
// DESCRIPTION:A tip jar with variable pay from a blue dialog
// ARCHIVED BY:Ferd Frederix

list amounts = [    10,20,25,30,40,50,100,200]; // Up to 12 amounts - must be integer, no commas or periods.
string d_msg = "This is donation If you can, please donate to  Ali Virgo                                                                                                                                                                                               "; // Dialog message.
key payee = "Insert your key here"; // Insert your key here. (I will have provided a script that gives you your key.)

// =======================================================
// == Don't worry about here down if you don't want to. ==
// =======================================================

// Other globals
list amt_string = [];
string owner = "";
integer lhan;

integer don_amt = 0;

list stringify(list amt)
{
    integer n = llGetListLength(amt);
    integer i;
    list temp = [];
    for(i=0; i<n; i++)
    {
        temp += "L$" + (string)llList2Integer(amt,i);
    }
    return temp;
}

default
{
    state_entry()
    {
        owner = llKey2Name(llGetOwner());
        amt_string = stringify(amounts);
        lhan = llListen(990099, "", llGetOwner(), "");
        llDialog(llGetOwner(), d_msg, amt_string, 990099);
        llSetTimerEvent(300);
    }
   
    on_rez(integer n)
    {
        llResetScript();
    }
   
    listen(integer chan, string name, key id, string msg)
    {
        llListenRemove(lhan);
        integer index = llListFindList(amt_string, [msg]);
        if ( index > -1 ) // valid
        {
            don_amt = llList2Integer(amounts, index);
            llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
        }
    }
   
    run_time_permissions(integer perm)
    {
        if( perm & PERMISSION_DEBIT )
        {
            llOwnerSay("Processing donation... please wait!");
            llGiveMoney(payee, don_amt);
            llInstantMessage(payee, owner + " has donated L$" + (string)don_amt + ".");
            llOwnerSay("Thank you for your donation!");
        }
        else
        {
            llOwnerSay("Thanks for considering a donation!");
        }
    }
   
    timer()
    {
        llListenRemove(lhan);
        llOwnerSay("Thanks for considering a donation!");
    }
}
// END //


Signature:
W̛̲̼͚͖h͎̯͇ͬ̉̓̉ͭ͆aͣ̋̓͠t͋ ̜͔̤̠̻̯̝̅̊͋ͬ̍͢â̶ͧ͊̀r͍̞̯̲͎̣̀̿͌̿̂ͅȇ͒̓̈́̄̋̉҉̜̲ ̡͎̯̲̼̟̂ͅs̱͉͚̼͌o̶͒̎̐͋ͥm̷̦͎ͣ̄̿ė̼̺̰̿ͦ̀ ̖͉̞̝̠ͤͧ̉̾̌̎͗ḡ͖̦̘̜̩͔ͤ͜o͕͈̥̦͖͛̕o̧̪̘̱̼ͨͨ̏̌d̫̫̣̪ ̢̩͈̙̬ͤ͑D̡̖̪̠̖̺͋̌̚u̡̱ͨͮͬ͑̌ͬ̎b̷̘̍̄̆̂̑̅s̳͖̪̉͢ͅt̢̩͈̗͋ͅe̯̭̩̣̗͉ͧ̚͝p͙̼̝̮͕̿̓͋ͫ͐̽ͩ ͇̫̤ͤͩ͐ͩ̋s̶̺̻ȍ̶̻̰͔̫͎̭͎ͥͭ̽ͣn͔̼̩̠̦͇͐g̛̱̫̗̑͗ͥ̂ͣ͗s̳͓̞̠͍̔͆̽!̶͑?̶͖͎
palavas.biz | Palavas

Vincent Sobieski, who goes by the stage name "Vincentgbr", was born in Bulgaria and raised in Great Britain. Vincent grew up with a lot of passion in music which gave him the determination to start his DJ course at Point Blank London at the age of 21. He received training from Ben Bristow, at which he succeeded in the course and obtained his DJ certificate.

After gaining 6 years DJ experience, "Vincent" recently got involved with TribalDanceFR and is a weekly resident DJ for them at Club ORBILUX.

"Vincent" has also received offers to play in various Clubs in France, these include Le Balajo, La Java, La Palace, Les Etoiles, etc.

At the beginning of 2009, he started to pursue his interest in producing music. In collaboration with professional producer and friend (Sam Hunwicke), he made his 1st track called (…) and shortly after, 2nd track "DJs The Beat".
He is also looking forward to making his own album in 2012, which promises to be really interesting. He is almost certainly going to be very busy for the future....




[+/-] Copyright
User avatar
Vincent
Palavas VIP
Palavas VIP
Posts: 235
 




Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest

cron