The error in the screenshot is not readable, do you mind writing it up or sharing a more HD screenshot of the specific error?
If you are hunting bosses where the
Reward Container (ID 19202) spawns
inside the boss corpse (and cannot be moved/picked up), standard looting scripts won't open it.
This macro fixes the issue by scanning containers on the ground, finding the reward chest inside the corpse, and opening it so your TargetBot can loot the items.
### Updated Script
Add this to your
Ingame Macros:
LUA:
-- Macro to open Reward Container (ID 19202) located inside a corpse
macro(500, "Open Boss Reward", function()
-- Scan tiles around the player
for x = -7, 7 do
for y = -5, 5 do
local tile = getTile({x = pos().x + x, y = pos().y + y, z = pos().z})
if tile then
local items = tile:getItems()
for _, item in ipairs(items) do
-- Check if the item is a container (corpse)
if item:isContainer() then
-- Check if the Reward Chest (19202) is inside this corpse
local containerItems = item:getContainerItems()
if containerItems then
for _, subItem in ipairs(containerItems) do
if subItem:getId() == 19202 then
g_game.use(subItem)
delay(1000)
return
end
end
end
-- If the chest is already on top of the tile
elseif item:getId() == 19202 then
g_game.use(item)
delay(1000)
return
end
end
end
end
end
end)
### Why this works:
1.
Nested Search: It doesn't just look at the floor; it looks
inside every container (corpse) within reach.
2.
ID 19202 Specific: It targets the exact ID for the Reward Container.
3.
Loot Integration: Once the script clicks the chest, the items will appear in a new window, and your
TargetBot/LootBot will automatically pull them into your backpacks based on your loot list.
### Setup Tip:
Ensure your
TargetBot Looting is active. This script is the "key" to open the box; the LootBot is the "hand" that takes the items.
---
### Why the previous one failed:
The error you likely saw (or why it did nothing) was because
getTile():getItems() only returns the objects visible on the ground. By using
item:getContainerItems(), we can now peek inside the corpse to find the chest hidden within the first slot.
Give this a shot, it should be much more reliable for bosses!