Dear friends, i came here to show to yours my persistent for don't lost valuable items when don't have cap.
This persistent works like that.
Items = Here you will put the items that you want to take if no have cap.
IgnoredItems = Here you will put the items that you want to throw away if no have cap.
This Configuration is for 'Giant Spider' and 'Mutated Bat'.
Note: With this persistent you can loot all itens increasing profit, and don't be afraid if no have cap to take the valuable items.
An little bit of the code i take from an user in this forum, i don't remember who but Credits for him.
Don't know if is @Leonardo or @Raphael.
--Anti-LostItems By Sajean
init start
local lootBp = 'blue backpack'
Items = {'batwing hat','spider silk','platinum amulet','lightning headband','mercenary sword','knight legs','knight armor','black shield'}
IgnoredItems = {'battle shield','plate legs','steel helmet','two handed sword','plate armor','obsidian lance'}
init end
auto(100)
foreach newmessage m do
if m.type == MSG_INFO then
local Monster, Loot = m.content:match(REGEX_LOOT)
if Monster and (Loot ~= 'nothing') then
Monster = Monster:gsub('the ', '', 1)
for _, Item in ipairs(Items) do
if Loot:find(Item) then
if($cap < iteminfo(Item).weight)then
setsetting('Looting/Enabled', 'no')
pausewalking(2000)
while $cap < iteminfo(Item).weight do
wait(800,1000)
if($cap >= iteminfo(Item).weight)then
break
else
for _, IgnoredItem in ipairs(IgnoredItems) do
if($cap >= iteminfo(Item).weight)then
break
else
moveitems(IgnoredItem,ground($posx,$posy,$posz),lootBp)
end
end
end
end
setsetting('Looting/Enabled', 'yes')
pausewalking(0)
end
if(not $looting)then
setsetting('Looting/Enabled', 'yes')
end
end
end
end
end
end