zoukankan      html  css  js  c++  java
  • api示例

    (1)检索背包

    --NUM_BAG_SLOTS——背包个数
    --GetContainerNumSlots(bag)——获取指定背包物品数量
    --GetContainerItem(bag, slot)——获取背包指定位置物品链接
    for bag = 0, NUM_BAG_SLOTS do
        for slot = 0, GetContainerNumSlots(bag) do
            local link = GetContainerItemLink(bag, slot)
            if(link ~= nil) then
                local itemId, enchantId = link:match("item:(%d+) : (%d+)")
            end
        end
    end

    (2)检索装备

    --GetInventoryItemLink("palyer", slot)——获取指定部位装备链接
    --0-弹药, 1-头, 2-项链, 3-肩膀, 4-衬衫, 5-胸, 6-腰带, 7-腿, 8-鞋子, 9-手腕, 10-手套,
    --11-戒指(上), 12-戒指(下), 13-饰品(上), 14-饰品(下), 15-披风, 16-主手, 17-副手, 18-远程, 19-战袍 
    local link = GetInventoryItemLink("player", 10)
    if(link ~= nil) then
        local itemId, enchantId = link:match("item:(%d+):(%d+)")
    end

     (3)穿装备

    --EquipItemByName(itemId, slot)——装备物品到指定部位
    EquipItemByName(12345, 10)

    (4)常用判定

    --是否骑马
    IsMounted() and not UnitOnTaxi("player")
    
    --是否在战斗
    InCombatLockdown() or UnitAffectingCombat("player")
    
    --是否死亡
    UnitIsDeadOrGhost("player")
  • 相关阅读:
    python GUI
    Python 博客网站资源
    Python 100 天学习计划
    pycharm基本设置
    MySQL 57安装部署(Zip版)(Windows版)
    nginx在centos下的安装
    仓位计算
    python笔记
    vue(一)--监听事件
    Hibernate(五)--级联
  • 原文地址:https://www.cnblogs.com/not2/p/12654017.html
Copyright © 2011-2022 走看看