Difference between revisions of "User:Kristy Fanshaw/Shorter Vendor System Script"

From Second Life Wiki
Jump to navigation Jump to search
Line 16: Line 16:


To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.}}
To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.}}
{{box|Pay Script for Reseller vendor|
{{box|Pay Script for "Reseller Vendor Object"|
Place this script in a Vendor Root prim you've created.<br><br>
Place this script in a Vendor Root prim you've created.<br><br>
What it does:
What it does:
Line 249: Line 249:
             }                           
             }                           
}</lsl>}}
}</lsl>}}
{{box|Updater Script for Reseller vendor|
{{box|Updater Script for "Reseller Vendor Update Object"|
Place this script in a box you've created.<br><br>
Place this script in a box you've created.<br><br>
What it does:
What it does:
Line 295: Line 295:
                     {
                     {
                         llDie();
                         llDie();
                    }
            }
}</lsl>}}
{{box|Server Script and Mailer Script for "Server Object"|
Place this script into a box you've created as a server prim.<br>
What it does:
# when rezzed, it will tell you it's email address.
# when this scrpt gets an email from the vendor, it gives the inventory item to buyer and asks mailer script to send a note back to vendor that the delivery is done.
<lsl>////////////////////////////////////////////////////////////////////////////////////////////////
//    Copyright (c) 2008 by Kristy Fanshaw                                                    //
//    This script is part of Vendor System.                                                  //
////////////////////////////////////////////////////////////////////////////////////////////////
//    Vendor System 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.                                                    //
//                                                                                            //
//    Vendor System 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.                                            //
//                                                                                            //
//    To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.    //
////////////////////////////////////////////////////////////////////////////////////////////////
string my_address = "my.email@email.com";      // Write here the email, where you want to recieve the message with new server email address.
integer total_mailers = 5;                      // How many mailer scripts you have in server prim. 5 mailer scripts are Recomended min. because of llEmail function.
integer mailer = 1;                           
default
    {
        changed(integer change)
            {
                if(change & CHANGED_OWNER)
                    {
                        llResetScript();
                    }     
            }
        on_rez(integer start_parameter)
            {
                llOwnerSay("new email is: " + (string)llGetKey() + "@lsl.secondlife.com");
                llEmail(my_address,llGetObjectName() , "my new email is: " + (string)llGetKey() + "@lsl.secondlife.com");
                llOwnerSay("message with new address is sent to your email");
            }
        state_entry()
            {             
                llOwnerSay("new email is: " + (string)llGetKey() + "@lsl.secondlife.com");
                llEmail(my_address,llGetObjectName() , "my new email is: " + (string)llGetKey() + "@lsl.secondlife.com");
                llOwnerSay("message with new address is sent to your email");
                llSetTimerEvent(5.0);             
            }
        timer()
            {
                llGetNextEmail("", "");
            }
        email( string time, string address, string subj, string message, integer num_left )
            {
                llGiveInventory(subj,llGetInventoryName(INVENTORY_OBJECT,0) );
                message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") +1);
                llMessageLinked(LINK_THIS, mailer, message, "");
                if (mailer <= total_mailers)
                    {
                        mailer = mailer + 1;
                    }
                if (mailer >= total_mailers + 1)
                    {
                        mailer = 1; 
                    }
                llGetNextEmail("", "");
            }
}</lsl>
Mailer script.<br>
Make as many sciprts you need and place them into server object.<br>
Name them with numbers starting from number "1".<br>
Don't skip any numbers: if you have 5 mailer scripts in you server object then you their names should be 1, 2, 3, 4 and 5.
<lsl>////////////////////////////////////////////////////////////////////////////////////////////////
//    Copyright (c) 2008 by Kristy Fanshaw                                                    //
//    This script is part of Vendor System.                                                  //
////////////////////////////////////////////////////////////////////////////////////////////////
//    Vendor System 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.                                                    //
//                                                                                            //
//    Vendor System 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.                                            //
//                                                                                            //
//    To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.    //
////////////////////////////////////////////////////////////////////////////////////////////////
                       
string mailer_num;
default
    {
        link_message(integer sender_num, integer num, string msg, key id)
            {
                mailer_num = llGetScriptName();
                if (num == (integer)mailer_num)
                    {
                        llEmail(msg,"delivered", (string)num);
                        llOwnerSay("mailer" + mailer_num);
                     }
                     }
             }
             }
}</lsl>}}
}</lsl>}}

Revision as of 05:51, 11 January 2009

Copying Permission

Copyright © 2008 by Kristy Fanshaw

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.

To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.

Pay Script for "Reseller Vendor Object"

Updater Script for "Reseller Vendor Update Object"

Server Script and Mailer Script for "Server Object"