• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[HELP] OTClient opcodes

xCastielx

New Member
Joined
Jun 4, 2015
Messages
17
Reaction score
0
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
b035cd0fc0f943968ce3c147474f8109.gif


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



i'd really appreaciate if you guys give me a hand with this :| thanks
 
Back
Top