找回密码
 register

QQ登录

只需一步,快速开始

搜索
查看: 490|回复: 0

客户端:获取道具材料在背包位置Pos Lua_GetBagPosByItemIndex

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:270
  • 打卡月天数:20
  • 打卡总奖励:268
  • 最近打卡:2025-08-21 12:09:08
Waylee 发表于 2023-10-20 16:39 | 显示全部楼层 |阅读模式

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×
文章编辑人员:雪舞
内容测试时间:2023-10-20 16:39:16
Lua_GetBagPosByItemIndex(30503150)


--======================================
--获取物品背包位置
--======================================
function Lua_GetBagPosByItemIndex(ItemID)
        local ret = -1
        for i = 1,96 do --目前暂时不检测任务物品(大背包96、 小背包60)
                local theAction = EnumAction(i-1, "packageitem")
                if theAction:GetID() ~= 0 then 
                        if theAction:GetDefineID() == ItemID then
                                ret = i - 1
                                break;
                        end
                end
        end
        return ret
end


自带函数(实测 并不存在 估计是官方函数 ):
PlayerPackage:GetBagPosByItemIndex(30900010)



您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 ) |网站地图|天天打卡

GMT+8, 2025-8-22 09:50 , Processed in 0.101070 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表