“LlGetInventoryKey”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: key llGetInventoryKey( string name ) |参数= 参数:str…”) |
|||
第95行: | 第95行: | ||
|相关函数= | |相关函数= | ||
[[llGetInventoryName]] -返回库存项的名称 | [[llGetInventoryName]] -返回库存项的名称 | ||
− | [[ | + | [[llGetInventoryType]] -测试一个库存项是否存在并返回其类型 |
[[llGetInventoryNumber]] -返回库存中特定类型的项目的数量 | [[llGetInventoryNumber]] -返回库存中特定类型的项目的数量 | ||
[[llGetInventoryPermmask]] -返回库存项的权限 | [[llGetInventoryPermmask]] -返回库存项的权限 |
2021年1月25日 (一) 08:23的最新版本
首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
函数名 |
---|
Function: key llGetInventoryKey( string name ) |
参数:string name–an item in the inventory of the prim this script is in |
返回值:返回一个键,该键是库存名称的UUID |
注意事项 |
---|
注意事项
|
示例 |
---|
// Put this script in an empty prim, and drag a full-perm texture into the prim's contents to find out its UUID default { changed(integer change) { if (change & CHANGED_INVENTORY) // if there has been a change to the prim's contents ... { string name = llGetInventoryName(INVENTORY_TEXTURE, 0); if (name) // if a texture exists ... { key uuid = llGetInventoryKey(name); if (uuid) // if the uuid is valid ... llOwnerSay( "The UUID of '" + name + "' is " + (string) uuid); else // texture was not full-perm llOwnerSay( "The UUID of '" + name + "' could not be determined"); } } } } string item = "Default"; default { state_entry() { llOwnerSay("Touch to get information about \"" + item + "\"."); } touch_start(integer total_number) { integer type = llGetInventoryType(item); integer index = llListFindList([ INVENTORY_NONE, INVENTORY_TEXTURE, INVENTORY_SOUND, INVENTORY_LANDMARK, INVENTORY_CLOTHING, INVENTORY_OBJECT, INVENTORY_NOTECARD, INVENTORY_SCRIPT, INVENTORY_BODYPART, INVENTORY_ANIMATION, INVENTORY_GESTURE], [type]); string name = llList2String(["does not exist", "texture", "sound", "landmark", "clothing", "object", "notecard", "script", "body part", "animation", "gesture"], index); llOwnerSay("Type: " + name); if(type == INVENTORY_NONE) return; integer owner_perms = llGetInventoryPermMask(item, MASK_OWNER); list perms; if(owner_perms & PERM_COPY) perms += "Copy"; if(owner_perms & PERM_MODIFY) perms += "Modify"; if(owner_perms & PERM_TRANSFER) perms += "Transfer"; if(owner_perms & PERM_MOVE) perms += "Move"; llOwnerSay("Perms: " + llList2CSV(perms)); integer temp = PERM_COPY | PERM_MODIFY | PERM_TRANSFER; if((owner_perms & temp) != temp) return; llOwnerSay("Key: " + (string)llGetInventoryKey(item)); } } |
相关函数 |
---|
llGetInventoryName -返回库存项的名称
llGetInventoryType -测试一个库存项是否存在并返回其类型 llGetInventoryNumber -返回库存中特定类型的项目的数量 llGetInventoryPermmask -返回库存项的权限 llGetInventoryCreator -返回库存物品的创建者 |
相关事件 |
---|