/script
if not w_1_1_7_2_DoodadList then
w_1_1_7_2_DoodadList={}
w_1_1_7_2_use=false
RegisterEvent("DOODAD_ENTER_SCENE", function() w_1_1_7_2_DoodadList[arg0] = true w_1_1_7_2_() end)
RegisterEvent("DOODAD_LEAVE_SCENE", function() w_1_1_7_2_DoodadList[arg0] = nil end)
w_1_1_7_2_Distance=function(t)
local p = GetClientPlayer()
if t then
return (((p.nX - t.nX) ^ 2 + (p.nY - t.nY) ^ 2 + (p.nZ/8 - t.nZ/8) ^ 2) ^ 0.5)/64
end
end
w_1_1_7_2_=function()
if w_1_1_7_2_use then
local p = GetClientPlayer()
for v,_ in pairs(w_1_1_7_2_DoodadList) do
local dod = GetDoodad(v)
if dod and p.GetOTActionState() == 0 and w_1_1_7_2_Distance(dod) < 6 then
if string.find(dod.szName,w_1_1_7_2_name) then
InteractDoodad(v)
end
end
end
end
end
RegisterEvent("RENDER_FRAME_UPDATE" ,w_1_1_7_2_
)
end
w_1_1_7_2_name="散落的镖银"
if w_1_1_7_2_use then
w_1_1_7_2_use=false
OutputMessage("MSG_SYS", "自动拾取("..w_1_1_7_2_name.."):关\n")
else
w_1_1_7_2_use=true
OutputMessage("MSG_SYS", "自动拾取("..w_1_1_7_2_name.."):开\n")
end