Hi guys, this is something i've been asking for help around but greedy ppl doesn't want to give me a hand with it
i'd like OTclient to show this, all what i got from ppl who got it is that its easy to adapt it with the clicking autoloot with some opcodes
what i want is it to show the loot that the autoloot picks on the screen just like this
this is the autoloot script
i'd really appreaciate if you guys give me a hand with this :| thanks
i'd like OTclient to show this, all what i got from ppl who got it is that its easy to adapt it with the clicking autoloot with some opcodes
what i want is it to show the loot that the autoloot picks on the screen just like this
this is the autoloot script
function onUse(cid, item, frompos, item2, topos)
if isWatchingTv(cid) then return true end
local function getContainers(pos)
local things = getTileInfo(pos).things
local ret = {}
for stack = 0, things do
pos.stackpos = stack
local item = getTileThingByPos(pos)
if item and isContainer(item.uid) then
local quemMatou = getItemAttribute(item.uid, "corpseowner")
if quemMatou then
local player = getCreatureByName(quemMatou)
if isPlayer(player) then
local isInParyWithPlayer = false
if isInParty(cid) and isInParty(player) then
isInParyWithPlayer = isPartyEquals(player, cid)
end
if getCreatureName(cid) == quemMatou or isInParyWithPlayer then
table.insert(ret, item)
end
end
end
end
end
return ret
end
local corpses = getContainers(getThingPosition(item.uid))
if #corpses == 0 then
doPlayerSendCancel(cid, "Você não pode abrir um loot que não é seu.")
return true
end
local autoLootList = getAllItensInMyList(cid)
local bag = getPlayerSlotItem(cid, 3).uid
local itemsToRemove = {}
if isCollectAll(cid) then
for _, corpse in pairs(corpses) do
for a = 0, getContainerSize(corpse.uid) - 1 do
local it = getContainerItem(corpse.uid, a)
if it.uid > 0 then
if addItemInFreeBag(bag, it.itemid, it.type) ~= false then
table.insert(itemsToRemove, it.uid)
end
end
end
end
end
if #autoLootList > 0 and not isCollectAll(cid) then
for a = 0, getContainerSize(item.uid) do
local it = getContainerItem(item.uid, a)
if it.uid > 0 then
for i = 1, #autoLootList do
if getItemInfo(it.itemid).name == autoLootList then
if addItemInFreeBag(bag, it.itemid, it.type) ~= false then
table.insert(itemsToRemove, it.uid)
end
end
end
end
end
end
if #itemsToRemove > 0 then
for i = 1, #itemsToRemove do
doChangeTypeItem(itemsToRemove, 0)
end
end
end
if isWatchingTv(cid) then return true end
local function getContainers(pos)
local things = getTileInfo(pos).things
local ret = {}
for stack = 0, things do
pos.stackpos = stack
local item = getTileThingByPos(pos)
if item and isContainer(item.uid) then
local quemMatou = getItemAttribute(item.uid, "corpseowner")
if quemMatou then
local player = getCreatureByName(quemMatou)
if isPlayer(player) then
local isInParyWithPlayer = false
if isInParty(cid) and isInParty(player) then
isInParyWithPlayer = isPartyEquals(player, cid)
end
if getCreatureName(cid) == quemMatou or isInParyWithPlayer then
table.insert(ret, item)
end
end
end
end
end
return ret
end
local corpses = getContainers(getThingPosition(item.uid))
if #corpses == 0 then
doPlayerSendCancel(cid, "Você não pode abrir um loot que não é seu.")
return true
end
local autoLootList = getAllItensInMyList(cid)
local bag = getPlayerSlotItem(cid, 3).uid
local itemsToRemove = {}
if isCollectAll(cid) then
for _, corpse in pairs(corpses) do
for a = 0, getContainerSize(corpse.uid) - 1 do
local it = getContainerItem(corpse.uid, a)
if it.uid > 0 then
if addItemInFreeBag(bag, it.itemid, it.type) ~= false then
table.insert(itemsToRemove, it.uid)
end
end
end
end
end
if #autoLootList > 0 and not isCollectAll(cid) then
for a = 0, getContainerSize(item.uid) do
local it = getContainerItem(item.uid, a)
if it.uid > 0 then
for i = 1, #autoLootList do
if getItemInfo(it.itemid).name == autoLootList then
if addItemInFreeBag(bag, it.itemid, it.type) ~= false then
table.insert(itemsToRemove, it.uid)
end
end
end
end
end
end
if #itemsToRemove > 0 then
for i = 1, #itemsToRemove do
doChangeTypeItem(itemsToRemove, 0)
end
end
end
i'd really appreaciate if you guys give me a hand with this :| thanks