Keep only clean HD items when selling items?
Posted: Thu Jan 27, 2011 7:03 pm
Can i set bot to sell all other items than clean HD items? I know i can set durability to ignore list but how keeping only clean items?
MicroMacro home
https://www.solarstrike.net/phpBB3/
But then he couldn't sell them.lisa wrote:When you say clean, do you mean with no bonus stats at all?
Actually I think the best way to do what you want is to get a loot filter addon and configure it to only collect what you want. Then set rombot autosell to false.
Code: Select all
if player:openStore("npcname") then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- only get tooltip if is type equipment, in bags and has high dura
if i > 60 and (item:isType("Weapons") or item:isType("Armor")) and item.Durability > 100 then
local tooltip_right = item:getGameTooltip("right") -- get tooltip
local statfound = false
for i,tooltipline in pairs(_tooltip_right) do
if string.match(tooltipline," [IVX]*$") then -- if ends in roman numeral
statfound = true
break
end
end
if statfound then -- sell it
item:use()
end
end
end
endOops, typo. And I noticed i had the dura check back-to-front.Giram wrote:Yes, items with no stats but high durability. Loot filter is not option cause i am collecting all items and selling them to merchant to get money. Clean items i would use my self or sell to ah cause from those i could get more money that way.
Edit: After trying out that code i get error: [string "..."]:8: bad argument #1 to 'pairs' (table expected, got nil).
Code: Select all
if player:openStore("npcname") then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- Only if equipment in bags
if i > 60 and (item:isType("Weapon") or item:isType("Armor")) then
-- only get tooltip if high dura
if item.Durability > 100 then
local tooltip_right = item:getGameTooltip("right") -- get tooltip
local sellit = false
for i,tooltipline in pairs(tooltip_right) do
if string.match(tooltipline," [IVX]*$") then -- if ends in roman numeral
sellit = true
break
end
end
else
sellit = true -- sell if dura is low
end
if sellit then
item:use() -- sell it
end
end
end
endCode: Select all
while(true) do
if player:openStore("Carey Delis") then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- Only if equipment in bags
if i > 60 and (item:isType("Weapon") or item:isType("Armor")) then
-- only get tooltip if high dura
if 100 > item.Durability then
item:use() -- sell it
end
end
end
end
endCode: Select all
<!-- # 68 --><waypoint x="-33393" z="-16217"> </waypoint>
<!-- # 69 --><waypoint x="-33391" z="-16198">
if player:openStore("Carey Delis") then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- Only if equipment in bags
if i > 60 and (item:isType("Weapon") or item:isType("Armor")) then
-- only get tooltip if high dura
if item.Durability > 100 then
local tooltip_right = item:getGameTooltip("right") -- get tooltip
local sellit = false
for i,tooltipline in pairs(tooltip_right) do
if string.match(tooltipline," [IVX]*$") then -- if ends in roman numeral
sellit = true
break
end
end
else
sellit = true -- sell if dura is low
end
if sellit then
item:use() -- sell it
end
end
end
end
loadPaths("RMoney");
</waypoint>Code: Select all
<option name="INV_MAX_SLOTS" value="180" />
<option name="INV_UPDATE_INTERVAL" value="300" />
<option name="INV_AUTOSELL_ENABLE" value="true" />
<option name="INV_AUTOSELL_FROMSLOT" value="24" />
<option name="INV_AUTOSELL_TOSLOT" value="180" />
<option name="INV_AUTOSELL_QUALITY" value="white, green, blue" />
<option name="INV_AUTOSELL_IGNORE" value="nil" />
<option name="INV_AUTOSELL_NOSELL_DURA" value="0" />
<option name="INV_AUTOSELL_STATS_NOSELL" value="nil" />
<option name="INV_AUTOSELL_STATS_SELL" value="nil" /> Code: Select all
inventory:update()Code: Select all
expertSell("Carey Delis",100)Code: Select all
if i > 60 and (item:isType("Weapon") or item:isType("Armor")) thenCode: Select all
if i > 60 thenCode: Select all
if (i > (60 + settings.profile.options.INV_AUTOSELL_FROMSLOT - 1) and 60 + settings.profile.options.INV_AUTOSELL_TOSLOT > i) thenCode: Select all
if (i > 60 + settings.profile.options.INV_AUTOSELL_FROMSLOT - 1 and 60 + settings.profile.options.INV_AUTOSELL_TOSLOT + 1 > i) and (item:isType("Weapons") or item:isType("Armor")) thengetGameTooltip returns false if it fails to get the tooltip. You could do something like this.Giram wrote:I have got this error few times when selling items: /addon_expertsell.lua:12: bad argument #1 to 'pairs' (table expected, got boolean). Any idea for fix?
Code: Select all
local tooltip_right
repeat tooltip_right = item:getGameTooltip("right") until tooltip_rightCode: Select all
if dura == nil then dura = 100 end
inventory:update()
if player:openStore(npcname) then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- Only if equipment in bags
if (item:isType("Weapons") or item:isType("Armor")) then
local sellit = false
local tooltip_right
repeat tooltip_right = item:getGameTooltip("right") until tooltip_right -- get tooltip
for i,tooltipline in pairs(tooltip_right) do
if string.match(tooltipline,"XI,XII") then
sellit = false
break
elseif item.Durability > dura then
if string.match(tooltipline,"II,III,IV,V,VI,VII,VIII,IX,X") then
sellit = true
break
end
sellit = false
end
if sellit then
item:use() -- sell it
end
end
end
end
Code: Select all
if string.match(tooltipline,"XI+$") thenCode: Select all
if string.match(tooltipline," [VXI]+$") thenCode: Select all
if dura == nil then dura = 100 end
inventory:update()
if player:openStore(npcname) then -- open store
for i, item in pairs(inventory.BagSlot) do -- for each item
-- Only if equipment in bags
if (item:isType("Weapons") or item:isType("Armor")) then
local hasXI = false
local hasDirty = false
local tooltip_right
repeat tooltip_right = item:getGameTooltip("right") until tooltip_right -- get tooltip
for i,tooltipline in pairs(tooltip_right) do
if string.match(tooltipline,"XI+$") then
hasXI = true
elseif string.match(tooltipline," [IVX]+$") then
hasDirty = true
end
end
local sellit = true
if hasXI and not hasDirty then
sellit = false
elseif item.Durability > dura and
not hasXI and not hasDirty then
sellit = false
end
if sellit then
item:use() -- sell it
end
end
end
end