Best Neighbor Ad Hiding Script

Expired

Introduction

 

Even after changes regulating the form of advertising billboards in Second Life, many users are still dissatisfied with the look of some ads. As part of a "Best Neighbor" policy, some advertisers have agreed to hide their advertisements when nearby land owners are logged in. Doran Zemlja was kind enough to release a script to do this under the open source GPL license.

 

//  best neighbor.lsl: Best Neighbor Ad Hider
//  Copyright (C) 2009 Adam Wozniak and Doran Zemlja
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see .
//
//  Adam Wozniak and Doran Zemlja
//  1352 Fourteenth St, Los Osos, CA 93402
//  This email address is being protected from spambots. You need JavaScript enabled to view it.
 
//  Scan for owners on their own land within 96m
//  If any are found, go invisible by setting all alphas to 0.0
//  Otherwise go visible by setting all alphas to 1.0
 
//  This is a compromise solution to the "ad problem".  The hope is that
//  if the ad is invisible to nearby land owners, then they are less
//  likely to complain about the ad.
 
//  Adapted from an idea proposed by Temporal Mitra
//  in Arbor Project group chat.
 
//  And no, copying an idea is NOT theft.  Pepsi isn't stealing from Coke,
//  and I'm not stealing from toaster manufacturers when I design and build
//  my own kind of toaster, even if toast is a pretty neat idea.
 
//  force alpha value for all prims in linkset
setAlpha(float alpha) 
{
    llSetLinkAlpha(LINK_SET, alpha, ALL_SIDES);
}
 
//  change visibility
changeVisibilityTo(integer inputInteger)
{
    if (inputInteger)
        setAlpha(1.0);
 
    else
        setAlpha(0.0);
}
 
default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }
 
    state_entry()
    {
        changeVisibilityTo(TRUE);
        llSensorRepeat("", NULL_KEY, AGENT, 96.0, PI, 10);
    }
 
    sensor(integer num)
    {
        integer found = FALSE;
 
        integer i;
        do
        {
            key id = llDetectedKey(i);
            key landOwnerAtDetectedPos = llGetLandOwnerAt(llDetectedPos(i));
 
            if (id == landOwnerAtDetectedPos)
                found = TRUE;
        }
        while (++i 

 

*DS* Anti (copy & transfer)

Expired

This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission. Additionally the script will delete itself when the customer of the reseller receives it with both permissions. Because it is a global function, it can be used universally.

Make sure that you not give away scripts with modify rights which contains this function.

/*
    ╔═════════════════════════════════════−−−­­­­­­→
    ║ *DS* Anti (copy & transfer) © by Daemonika Nightfire (daemonika.nightfire)
    ╚══════════════════════−−−­­­→
*/
 
// stored key's (UUID) of creator and reseller
list CreatorKey = ["61ee201a-81cf-4322-b9a8-a5eb8da777c2","00000000-0000-0000-0000-000000000000"]; // expandable
 
////////// global function \\\\\\\\\\
CorrectPerms?()
{
    string Script = llGetScriptName(); // ask for scriptname
    llSetText("", ZERO_VECTOR, 0.0); // clear floatingtext
 
    // compares the ownerkey with the key's in the list
    if(llListFindList(CreatorKey, llCSV2List(llGetOwner())) == -1)
    {
        // if the ownerkey don't match, the script will delete itself when permission copy & tranfer is given
        integer MaskOwner = llGetInventoryPermMask(Script, MASK_OWNER);
        if((MaskOwner & PERM_TRANSFER) && (MaskOwner & PERM_COPY) != 0)
        {
            llOwnerSay("/me " + Script + ": Sorry, i was not made for you. Goodbye");
            llRemoveInventory(Script);
        }
    }
 
    // force the reseller to set (no copy) or (no trans), otherwise the script will not work
    integer MaskNext = llGetInventoryPermMask(Script, MASK_NEXT);
    if((MaskNext & PERM_TRANSFER) && (MaskNext & PERM_COPY) != 0)
    {
        llSetText("please correct the script-permission to:\n(copy/no transfer) or (no copy/transfer)", <1 ,1,0>, 1.0);
        state Offline;
    }
}
 
default
{
    state_entry()
    {
        CorrectPerms?(); // starts the global function
    }
 
    touch_start(integer total_number) // just for show that it work
    {
        llSay(0, "Yay, script-permission correct.");
    }
 
    changed(integer change)
    {
        if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
        {
            llResetScript();
        }
    }
 
    on_rez(integer Dae)
    {
        llResetScript();
    }
}
 
state Offline
{
    state_entry()
    {
        llOwnerSay("Sorry, please correct the script-permission");
    }
 
    changed(integer change)
    {
        if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
        {
            llResetScript();
        }
    }
 
    on_rez(integer Dae)
    {
        llResetScript();
    }
}

 

 

Display Script

Expired

This script is an experimentation to operate the property of persistence of particles to show the matrix of corresponding points in every characters. Billing is refresh every 30 sec

 

//////////////////////////////////////////////////////////////////// 
//
//  AbcText
//  by Ange Capalini
//  Originally Written  10/31/2011
//  code released to the public domain
// 
//////////////////////////////////////////////////////////////////// 
 
 
//==================================================================
//               INSTRUCTIONS
//==================================================================
//
//  - set Max Particles to 4096
//  - create white cube "board" <15 .500, 0.010, 0.800>
//  - create red cube "cursor" <0.050, 0.010, 0.030> & drop AbcText
//  - link cursor (child) to board (root)
//  - send message <= 25 char. to chanel 20
//  - that's all folk's
//
/////////////////////////////////////////////////////////////////////
 
 
//===========================================
//               CONSTANTS
//===========================================
float  Size_Point = 0.1; //pixel size
string Txt_Point = "";  //pixel texture
vector Color_Point = < 0., 0., 1. >; //pixel color
vector Size_Affich = <15 .5, .01, .8>; //display size
 
//===========================================
//           GLOBALS VARIABLES
//===========================================
list Alphabet = [   " ",
                    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
                    "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
 
                    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
                    "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
 
                    "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 
 
                    ":", "'", ",", "!", "?", "#", ".", "/", "-", "é", "è", "à"     ];
 
//char matrix 6 x 5 points
list Matrices = [ " ", 
                    "011001001010010111101001000000", //A
                    "111001001011100100101110000000",
                    "011001000010000100000110000000",
                    "111001001010010100101110000000",
                    "111001000011100100001110000000",
                    "111001000011100100001000000000",
                    "011101000010110100100111000000",
                    "100101001011110100101001000000",
                    "111000100001000010001110000000",
                    "001100001000010100100110000000",
                    "100101010011000101001001000000",
                    "100001000010000100001110000000",
                    "100011101110101100011000100000",
                    "100101101010110100101001000000",
                    "011001001010010100100110000000",
                    "111001001010010111001000000000",
                    "011001001010010100100110000010",
                    "111001001010010111001001000000",
                    "011101000001100000101110000000",
                    "111000100001000010000100000000",
                    "100101001010010100100110000000",
                    "100101001010100101000100000000",
                    "100011010110101101010101000000",
                    "100101001001100100101001000000",
                    "100101001001110000100110000000",
                    "111100001001100100001111000000", //Z
 
                    "000000110010010100100111000000", //a
                    "100001110010010100101110000000",
                    "000000110010000100000110000000",
                    "000100111010010100100111000000",
                    "000000111010010101000111000000",
                    "011001000011000100001000000000",
                    "011001001010010011100001001100",
                    "100001110010010100101001000000",
                    "100000000010000100001000000000",
                    "001000000000100001000010011000",
                    "100001001010100110101001000000",
                    "100001000010000100001000000000",
                    "000001101010101101011010100000",
                    "000001110010010100101001000000",
                    "000000110010010100100110000000",
                    "111001001010010111001000010000",
                    "011101001010010011100001000010",
                    "000001010011000100001000000000",
                    "000000111011000001101110000000",
                    "010001110001000010000100000000",
                    "000001001010010100100111000000",
                    "000001001010010100100110000000",
                    "000001010110101101010101000000",
                    "000001001001100011001001000000",
                    "100101001010010011100001001100",
                    "000001111000100010001111000000", //z
 
                    "011001001010010100100110000000", //0
                    "011000010000100001000010000000",
                    "111000001001100100001111000000",
                    "111000001001100000101110000000",
                    "001000110010100111100010000000",
                    "111101000011100000101110000000",
                    "011001000011100100100110000000",
                    "111100001000100010000100000000",
                    "011001001001100100100110000000",
                    "011001001001110000100110000000", //9
 
                    "000000000000100000000010000000", //:
                    "000100010000000000000000000000",
                    "000000000000000000100010000000",
                    "001000010000100000000010000000",
                    "001000101000010001000000000100",
                    "010101111101010111110101000000", 
                    "000000000000000000000010000000", 
                    "000010001000100010001000000000", 
                    "000000000001110000000000000000", 
                    "000100110010010101000111000000",
                    "010000111010010101000111000000",
                    "010000110010010100100111000000"  //à
                    ];
 
list    Particle_Parameters=[];
vector  Origine;
string  Texte;
integer id_Phrase;
integer len_Phrase;
integer id_Lettre;
string  Lettre;
string  matrice_Lettre;
vector  point_zero;
integer x;
integer z;
 
//===========================================
//        SET PARTICLES
//===========================================
 
init_particles(){
 
    Particle_Parameters = [  
           PSYS_SRC_TEXTURE, Txt_Point, 
           PSYS_PART_START_SCALE, , 
           PSYS_PART_END_SCALE,   , 
           PSYS_PART_START_COLOR, Color_Point,    
           PSYS_PART_END_COLOR,   Color_Point, 
 
           PSYS_SRC_BURST_PART_COUNT, (integer)1, 
           PSYS_SRC_BURST_RATE, (float) 0.0,  
           PSYS_PART_MAX_AGE, (float) 30.0, 
 
           PSYS_SRC_PATTERN, (integer) 1,
 
           PSYS_PART_FLAGS,
           PSYS_PART_EMISSIVE_MASK
           ];
}
 
//===========================================
//          SET DISPLAY
//===========================================
affichage (string phrase) {
 
    integer len_Phrase = llStringLength(phrase)-1;  
    for(id_Phrase = 0; id_Phrase <= len_Phrase;++id_Phrase){ 
        Lettre = llGetSubString(phrase, id_Phrase, id_Phrase);
        id_Lettre = llListFindList(Alphabet, [Lettre]);
        matrice_Lettre = llList2String(Matrices, id_Lettre); 
        z=0; 
        do{ 
            x=0;
            do{
                if( (integer)llGetSubString(matrice_Lettre, x + 5*z, x + 5*z) ) {
                    llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, point_zero + < x*Size_Point, 0.0, -z*Size_Point > ]);
                    llParticleSystem( Particle_Parameters );
                    llSleep(0.12);
                    llParticleSystem( [] );
                }
            } while( ++x <= 4);
        } while( ++z <= 5);
 
        point_zero += < 6. * Size_Point, 0.0, 0.0 >; //locate next char
    }
}
/////////////////////////////////////
///////////////////////////////////// 
/////////////////////////////////////
/////////////////////////////////////
 
 
default {
 
    state_entry() {
 
        llListen(20, "", llGetOwner(), "");
        init_particles(); 
        Origine = <(-0.48 * Size_Affich.x) , (-1.25 * Size_Point) , (0.3 * Size_Affich.z)  >; //raz cursor
    }
 
    listen( integer channel, string name, key id, string msg ) {
 
        Texte = msg;
        point_zero = Origine;    //raz cursor         
        llSetTimerEvent(30.);
        affichage(Texte);
    } 
 
    timer(){
 
        point_zero = Origine;  //raz cursor
        affichage(Texte);
    }
 
    on_rez(integer param) {llResetScript();}
    changed(integer mask) {if(mask & CHANGED_OWNER) {llResetScript();}} 
 
}

 

Sell To Group Only ( V2 )

Expired

This is a simple GROUP ONLY vendor script. It can be used to GIVE FREE items to group only too.

    https://d1yjxggot69855.cloudfront.net/skins/monobook/bullet.gif); color: rgb(0, 0, 0); font-family: verdana, helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">
  • THIS SCRIPT WILL ASK FOR DEBIT PERMISSIONS. THEY MUST BE GRANTED FOR THE SCRIPT TO FUNCTION. L$ WILL BE TAKEN FROM THE OBJECT OWNERS ACCOUNT.
      https://d1yjxggot69855.cloudfront.net/skins/monobook/bullet.gif); ">
    • The debit permissions are required for making refunds in the event of an over or under payment or a payment being made by a non group member.
      • // V2 //
         
        integer cost = 0; // The cost of the contents of this object (A whole round number (No decimal places)).
                          // If this is set to zero, the object will act as a group only freebie giver, however...
                          // ...it will still ask for permissions to debit.
         
        string folder_name = "Folder"; // The Name of the folder in which to give the contents.
         
        integer offer_group_join = TRUE; // Set TRUE or FALSE to offer group membership link on failed purchase attempt.
         
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////// YOU NEED NOT CHANGE ANYTHING BELOW THIS POINT /////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         
        list contents_list = [];
         
        string group_name;
         
        key group_key;
         
        key owner;
         
        default
        {
            on_rez(integer param)
            {
                llResetScript();
            }
            changed(integer change)
            {
                if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
                llResetScript();
            }
            state_entry()
            {
                llSetClickAction(CLICK_ACTION_TOUCH);
                llRequestPermissions((owner = llGetOwner()), PERMISSION_DEBIT);
            }
            run_time_permissions(integer perm)
            {
                if(perm & PERMISSION_DEBIT)
                {
                    integer in = llGetInventoryNumber(INVENTORY_ALL);
                    integer count;
                    string name;
                    do
                    {
                        if((name = llGetInventoryName(INVENTORY_ALL, count)) != llGetScriptName())
                        contents_list += [name];
                    }
                    while((++count) ") + 7),
                                                                  (llSubStringIndex(body, "") - 1))) +
                               "\nOnly members of that group will be able to buy this objects contents." +
                               "\nContents for sale - \n" + llDumpList2String(contents_list, "\n") +
                               "\nPrice is " + ((string)cost) + "L$");
                    if(cost)
                    {
                        llSetClickAction(CLICK_ACTION_PAY);
                        llSetPayPrice(PAY_HIDE, [cost, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
                        state shoptastic;
                    }
                    else
                    state freebietastic;
                }
                else
                {
                    llOwnerSay("HTTP Request failed. Trying again in 45 seconds. Please wait.");
                    llSleep(45.0);
                    llHTTPRequest("http://world.secondlife.com/group/" + ((string)group_key), [], "");
                }
            }
        }
        state freebietastic
        {
            on_rez(integer param)
            {
                llResetScript();
            }
            changed(integer change)
            {
                if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
                llResetScript();
            }
            touch_start(integer nd)
            {
                while(nd)
                {
                    key id = llDetectedKey(--nd);
                    if(llSameGroup(id))
                    llGiveInventoryList(id, folder_name, contents_list);
                    else
                    {
                        string msg = "";
                        if(offer_group_join)
                        msg = "\nYou can join this group by clicking this - \nsecondlife:///app/group/" + ((string)group_key) + "/about";
                        llRegionSayTo(id, 0, "Sorry, this vendor is set to give only to " + group_name + " group members." + msg);
                    }
                }
            }
        }
        state shoptastic
        {
            on_rez(integer param)
            {
                llResetScript();
            }
            changed(integer change)
            {
                if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
                llResetScript();
            }
            money(key id, integer amount)
            {
                if(llSameGroup(id))
                {
                    if(amount >= cost)
                    {
                        if(amount > cost)
                        llGiveMoney(id, (amount - cost));
                        llGiveInventoryList(id, folder_name, contents_list);
                    }
                    else if(amount