Jump to content

Moni Telling

Resident
  • Posts

    22
  • Joined

  • Last visited

Posts posted by Moni Telling

  1. I know I may have the wrong script, but this script is the most close thing that works for me. I want to be able to type in local chat /1 SLURLLINK and it automatically teleport me to the location. How can I achieve this?

     

    string simName = "Help Island Public";
    vector simGlobalCoords;
     
    vector landingPoint = <128.0, 128.0, 24.0>;
     
    key owner;
     
     
    default
    {
        on_rez(integer start_param)
        {
            llResetScript();
        }
     
        changed(integer change)
        {
            if (change & CHANGED_OWNER)
                llResetScript();
        }
     
        state_entry()
        {
            owner = llGetOwner();
     
            llRequestPermissions(owner, PERMISSION_TELEPORT);
            llRequestSimulatorData(simName, DATA_SIM_POS);
        }
     
        touch_start(integer total_number)
        {
            key id = llDetectedKey(0);
     
            if (id == owner)
            {
                if (simGlobalCoords == ZERO_VECTOR)
                {
                    llOwnerSay("Config error, tp request was denied. Please try again!");
                    llResetScript();
                }
                else
                {
                    llOwnerSay("Teleporting you to: http://maps.secondlife.com/secondlife/"
                        + llEscapeURL(simName) + "/" + (string)llRound(landingPoint.x)
                        + "/" + (string)llRound(landingPoint.y) + "/" + (string)llRound(landingPoint.z) + "/");
     
                    llTeleportAgentGlobalCoords(owner, simGlobalCoords, landingPoint, ZERO_VECTOR);
                }
            }
            else
            {
                // llRegionSayTo is faster than llInstantMessage and we can assume
                // that the touching avatar is within the same sim
     
                llRegionSayTo(id, PUBLIC_CHANNEL,
                    "Sorry, I can't tp you. You're NOT my owner!");
            }
        }
     
        run_time_permissions(integer perm)
        {
            // if permission request has been denied (read ! as not)
            if (!(perm & PERMISSION_TELEPORT))
            {
                llOwnerSay("I need permissions to teleport you!");
                llRequestPermissions(owner, PERMISSION_TELEPORT);
            }
        }
     
    // dataserver event only called if data is returned
    // or in other words, if you request data for a sim that does
    // not exist this event will NOT be called
     
        dataserver(key query_id, string data)
        {
            simGlobalCoords = (vector)data;
            // llOwnerSay("Sim global coords: " + (string)simGlobalCoords);
        }
    }

  2. I got this far with the menu button it worked. now it doesn't  recognize the item to give

     

     

     

    composelist()
    {
        integer currentobject = 0;
        integer totalobjects = llGetInventoryNumber(INVENTORY_OBJECT);
      
        if(totalobjects > 0 & totalobjects <= 12)
        {
            object_list = [];
            do
            {
                string name = llGetInventoryName(INVENTORY_OBJECT, currentobject);
                sub = llGetSubString(name, 0, 12);
                object_list = object_list + sub;
                currentobject++;
            }
            while (currentobject > 0 & currentobject < totalobjects);
        }
      
        if(totalobjects > 12 & totalobjects <= 22)
        {
            object_list = ["Next Page"];
            do
            {
                string name = llGetInventoryName(INVENTORY_OBJECT, currentobject);
                sub = llGetSubString(name, 0, 12);
                object_list = object_list + sub;
                currentobject++;
            }

  3. I have an multi give object dialog menu.

    Menu recognize names in contents of prim and convert names to a button

    The problem is if the names are too long I get  an 24 character error

    How can I shorten names on button but still give item when recognize full name to give item on the button?

     

    HERE IS THE  SCRIPT

     

    list object_list;
    list object_list2;
    key user = NULL_KEY;

    composelist()
    {
        integer currentobject = 0;
        integer totalobjects = llGetInventoryNumber(INVENTORY_OBJECT);
       
        if(totalobjects > 0 & totalobjects <= 12)
        {
            object_list = [];
            do
            {
                object_list = object_list + llGetInventoryName(INVENTORY_OBJECT, currentobject);
                currentobject++;
            }
            while (currentobject > 0 & currentobject < totalobjects);
        }
       
        if(totalobjects > 12 & totalobjects <= 22)
        {
            object_list = ["Next Page"];
            do
            {
                object_list = object_list + llGetInventoryName(INVENTORY_OBJECT, currentobject);
                currentobject++;
            }
            while (currentobject > 0 & currentobject < 11);
           
            object_list2 = ["Last Page"];
            do
            {
                object_list2 = object_list2 + llGetInventoryName(INVENTORY_OBJECT, currentobject);
                currentobject++;
            }
            while (currentobject >= 11 & currentobject < totalobjects);
        }
       
        if(totalobjects > 22)
        {
            llWhisper(0, "You may only have a maximimum of 22 Objects. Please remove any extra ones.");
        }
        if(totalobjects == 0)
        {
            llWhisper(0, "Please add up to 22 Objects to give away. They should be Copy/Transfer.");
        }
    }


    //The Menu
    integer menu_handler;
    integer menu_channel;
    menu(key user,string title,list object_list)
    {
        menu_channel = (integer)(llFrand(99999.0) * -1); //random channel
        menu_handler = llListen(menu_channel,"","","");
        llDialog(user,title,object_list,menu_channel);
        llSetTimerEvent(30.0); //menu channel open for 30 seconds
    }

    default
    {
        state_entry()
        {
            composelist(); //make list from inventory objects
        }

        touch_start(integer total_number)
        {
            user = llDetectedKey(0);
            if (user == llGetOwner())
            {
                menu(user,"\n\nPlease select one below.",object_list);
            }
            else
            {
                llInstantMessage(user,"These items are for the owner only, sorry.");
            }
        }
       
        listen(integer channel,string name,key id,string message)
        {
            if (channel == menu_channel)
            {           
                if(message == "Next Page")
                {
                    menu(user,"\n\nPlease select one below.",object_list2);
                }
                else if(message == "Last Page")
                {
                    menu(user,"\n\nPlease select one below.",object_list);
                }
                else
                {
                    llGiveInventory(user,message); //Give Object
                    llSetTimerEvent(0.0);
                    llListenRemove(menu_handler);
                }
            }
        }
       
        timer() //Close the Menu Listen or we'll get laggy
        {
            llSetTimerEvent(0.0);
            llListenRemove(menu_handler);
        }
       
        changed(integer change)
        {
            if (change & CHANGED_INVENTORY) //inventory has changed
            {
                llSleep(0.5);
                composelist(); //rebuild the list
            }
        }
    }

  4. okay your suggestion helped but I couldn't get it work the way you wrote. I did it the way I knew how It kinda worked but I still need some help figuring the rest and fix these bugs

     

    list list_of_avatars = ["222ade58-d3bf-4fb7-9910-6e39008183fa","dd55ba04-18c0-4c5b-8241-d5503b6ec044"];

     integer i;
    integer DebitPerms;

    float comission=25; // for % comission
    default
    {
        state_entry()
        {
          llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
        }
     
        run_time_permissions (integer perm)
        {
            if  (perm & PERMISSION_DEBIT)
                DebitPerms = TRUE;
        }
        money(key giver, integer amount)
        {
           
              integer i;
            integer length = llGetListLength(list_of_avatars);
            do
            {
                 float percentage = (float)amount/100*comission;
               llGiveMoney(llList2Key(list_of_avatars,i),(integer)percentage);

    llSay(0,(string)llList2Key(list_of_avatars,i));
    }
            while(++i < length);
           

      } 
    }

×
×
  • Create New...