DrizzoxNox
New Member
- Joined
- Apr 10, 2022
- Messages
- 2
- Reaction score
- 0
Hello All,
I was trying to code myself but I ran in a dead end.
I've used a code that currently exist to loot and drop items, however I would like to loot only specific items eg:
13:04 You see a legendary melee copper shield of restoration (faster regeneration) (Def:19).
It is level 98 with 19% to go next level.
It weighs 63.00 oz.
Magical Enchantments:
[Melee Skill: +5%]
Obviously each item has a prefix common,uncommon,epic,legendary (is there an autocomplete function in looting ? I was using always something like eg common*
Dropping function (with strings doesn't work):
local itemToDrop = { "common*","uncommon*","epic*" }
local dropDistance = 3
local dPos = {
{ x = 33351, y = 32048, z = 8 },
}
dropTrash = macro(1000, "DropTrash", function(m)
local dropPos = nil
if dropTrash:isOn() then
local pos = player:getPosition()
for i = 1, #dPos do
if getDistanceBetween(player:getPosition(), dPos) <= dropDistance then
dropPos = dPos
break
end
end
if dropPos then
for _, container in pairs(g_game.getContainers()) do
for __, item in ipairs(container:getItems()) do
if table.find(itemToDrop, item:getId()) then
return g_game.move(item, dropPos, 1)
end
end
end
end
end
end)
I'd appreciate any tip in setting up proper looting.
I was trying to code myself but I ran in a dead end.
I've used a code that currently exist to loot and drop items, however I would like to loot only specific items eg:
13:04 You see a legendary melee copper shield of restoration (faster regeneration) (Def:19).
It is level 98 with 19% to go next level.
It weighs 63.00 oz.
Magical Enchantments:
[Melee Skill: +5%]
Obviously each item has a prefix common,uncommon,epic,legendary (is there an autocomplete function in looting ? I was using always something like eg common*
Dropping function (with strings doesn't work):
local itemToDrop = { "common*","uncommon*","epic*" }
local dropDistance = 3
local dPos = {
{ x = 33351, y = 32048, z = 8 },
}
dropTrash = macro(1000, "DropTrash", function(m)
local dropPos = nil
if dropTrash:isOn() then
local pos = player:getPosition()
for i = 1, #dPos do
if getDistanceBetween(player:getPosition(), dPos) <= dropDistance then
dropPos = dPos
break
end
end
if dropPos then
for _, container in pairs(g_game.getContainers()) do
for __, item in ipairs(container:getItems()) do
if table.find(itemToDrop, item:getId()) then
return g_game.move(item, dropPos, 1)
end
end
end
end
end
end)
I'd appreciate any tip in setting up proper looting.