Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
archiv:opensim:downloads:scripts:give_all_content [2024/01/24 16:39] – Externe Bearbeitung 127.0.0.1 | archiv:opensim:downloads:scripts:give_all_content [Unbekanntes Datum] (aktuell) – Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Give all Content ===== | ||
+ | |||
+ | < | ||
+ | // Copyright 2004, Trimming Hedges. | ||
+ | |||
+ | // This is a simple script that gives everything in a box to the person who clicked. | ||
+ | // By default, it will only give items to the owner of the box. | ||
+ | |||
+ | // I wrote this because of all the texture bundles that are given out. It's really a PAIN | ||
+ | // to move a lot of textures or other contents out of a box. This speeds that up. | ||
+ | |||
+ | // This is NOT a vending script. | ||
+ | // | ||
+ | // I suggest not using this script in an area where several people are going to touch it at once, because giving inventory is slow. | ||
+ | // Version 2.0 of this script now detects multiple simultaneous touches: it is still slow, but it should work better at classes or events. | ||
+ | |||
+ | // THIS IS NOT A VENDING SCRIPT. | ||
+ | // This script doesn' | ||
+ | // Then rename a copy and put that in the box too. The renamed copy should be the running one. | ||
+ | // Rename it FIRST, I had weird issues with renaming it when it was already in | ||
+ | // the box. (version 1.2.12 of SL.) | ||
+ | |||
+ | integer owneronly = 0; | ||
+ | key owner; | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | owner = llGetOwner(); | ||
+ | } | ||
+ | |||
+ | touch_start(integer total_number) | ||
+ | { | ||
+ | integer i; | ||
+ | for (i=0; | ||
+ | { | ||
+ | key target = llDetectedKey(i); | ||
+ | |||
+ | if ( (target != owner) && (owneronly == 1) ) // person clicking isn't owner and owneronly is set; | ||
+ | { | ||
+ | llInstantMessage(target," | ||
+ | return; | ||
+ | } | ||
+ | list inventory_types = [INVENTORY_BODYPART, | ||
+ | integer inventory_count = llGetListLength(inventory_types); | ||
+ | integer j; | ||
+ | integer k; | ||
+ | integer type; | ||
+ | integer typecount; | ||
+ | string myname = llGetScriptName(); | ||
+ | string objectname; | ||
+ | |||
+ | for (j=0; j< | ||
+ | { | ||
+ | type = llList2Integer(inventory_types, | ||
+ | typecount = llGetInventoryNumber(type); | ||
+ | if (typecount > 0) | ||
+ | { | ||
+ | for (k=0; k< | ||
+ | { | ||
+ | objectname = llGetInventoryName(type, | ||
+ | if (objectname != myname) | ||
+ | { | ||
+ | llGiveInventory(target, | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||