Jump to content

LSL llMail script manipulation assistance.


Nosfera Osterham
 Share

You are about to reply to a thread that has been inactive for 3650 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello.  I am looking for some assistance with manipulating a basic prim server system I have developed with the help of a shared script for a vending system.  Basically it is currently set up to give an item or all items I have in the server prim when the vendor prim is clicked.  What I'd like to do is add a timer event to it only allowing each Avatar UUID to click it and receive the item every X number of minutes.  I'd also like to add a menu option for the owner to be able to turn the hover text off.  Here are the two scripts I am currently using.


Server Prim:

// Author: unknown
// Script Retrieved from Free SL Scripts at http://www.gendersquare.org/sl
 
string NewsServerKey = "";
 
integer a;
integer b;
string objectname;
list invent_types = [INVENTORY_BODYPART,INVENTORY_SCRIPT,INVENTORY_LANDMARK,INVENTORY_NOTECARD,INVENTORY_CLOTHING,INVENTORY_OBJECT,INVENTORY_SOUND,INVENTORY_TEXTURE];
integer type;
integer typecount;
 
default
{
     on_rez(integer i)
     {
          llResetScript();
     }
 
     state_entry()
     {
          NewsServerKey = llGetKey();
          llSetObjectDesc(NewsServerKey);
          llSetText(" ", <0,1,0>,1.0);
          llOwnerSay(llGetObjectName() + "\n"+ NewsServerKey);
          llSetTimerEvent(2.5);
     }
 
     touch_start(integer total_number)
     {
          NewsServerKey = llGetKey();
          llSetText("put name of server here ", <1,1,1>,1.0);
          llInstantMessage(llDetectedKey(0), "My Server Key is: " + NewsServerKey);
     }
 
     email(string time, string address, string subj, string message, integer num_left)
     {
          key target = subj;
            if (target == llGetOwner())
          {
               llOwnerSay("Touch received on a client prim from you.");
               //return; // uncomment if you want to receive copies of the server content yourself
          }
 
          integer total_number = 1;
          integer i;
          for (i=0;i < total_number;i++)
          {
               integer invent_count = llGetListLength(invent_types);
               string myname = llGetScriptName();
               for (a=0; a < invent_count;a++)
               {
                    type = llList2Integer(invent_types,a);
                    typecount = llGetInventoryNumber(type);
                    if (typecount > 0)
                    {
                         for (b=0; b < typecount;b++)
                         {
                              objectname = llGetInventoryName(type,b);
                              if (objectname != myname) // don't give self out
                              {
                                   llGiveInventory(target,objectname);
                              }
                         }
                    }
               }
          }
     }
 
     timer()
     {
          llGetNextEmail("", "");
     }
}

 

Vendor Prim:

// Author: unknown
// Script Retrieved from http://www.gendersquare.org/sl
  
string NewsTargetKey = "insert server prim uuid"; // change this with the UUID of your "Server" prim
  
default
{
    state_entry()
    {
    llSetText("Touch to Harvest", <1,1,1>,1.0);
    }
    touch_start(integer total_number)
    {
    llEmail(NewsTargetKey + "@lsl.secondlife.com", llDetectedKey(0), "");
    }
}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3650 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...