Keep only clean HD items when selling items?
Keep only clean HD items when selling items?
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?
Re: Keep only clean HD items when selling items?
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.
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.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Keep only clean HD items when selling items?
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.
You need some sort of specially written function.
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
end- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
I think what he is trying to do is keep only clean (no stat) items with high durability. So the loot filter will make sure he only picks up those items. I think selling the other items is just to clear bag space.
I could be wrong though.
I could be wrong though.
Remember no matter you do in life to always have a little fun while you are at it 
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Keep only clean HD items when selling items?
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).
Edit: After trying out that code i get error: [string "..."]:8: bad argument #1 to 'pairs' (table expected, got nil).
Re: Keep only clean HD items when selling items?
Oops, 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).
No wait, there is more wrong with the code. Hold on a second.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
Ok try this.
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
end- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
I don't understand how that is working now... It might sell item regardless of dura or stat or it might not sell. It can be any color, dura or have any stat on it.
I tried to change it so it would sell only low dura but its still skipping many items.
Could there be still something wrong with memory addresses?
Edit: Maybe i need to clean my profile before trying but i test that later.
I tried to change it so it would sell only low dura but its still skipping many items.
Code: 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
endEdit: Maybe i need to clean my profile before trying but i test that later.
Re: Keep only clean HD items when selling items?
What my version does is, if dura is high it checks if there are any stats. If there are stats, then it sells. On the other hand if the dura is low then it sells anyway because you said you wanted to save only high dura clean items.
What your version looks like it does is sell all high dura equipment.
So what happened when you tried my code? How did you use it?
What your version looks like it does is sell all high dura equipment.
So what happened when you tried my code? How did you use it?
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
I though that my test would sell all low dura items...
But this is how i placed your code in my waypoint:
And my current selling settings:
But it sold my clean HD item and left many low dura or other items with stats on them. I think that there is some sort of pattern. It sells 2 or sometimes 3 items then skips one.
But this is how i placed your code in my waypoint:
Code: 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" /> Re: Keep only clean HD items when selling items?
I think to be sure, we should add a before the 'if' statment
The profile settings only affect player:merchant() which we are not using.
I had to test the function myself to find the bugs. Turned out I forgot to move where the 'sellit' variable declaration when I did my last change and I used a wrong symbol in the pattern match.
This is now working for me.
I've attached it as a userfunction file. Who knows maybe I'll develop it further. For now, it does what you want it too.
To use it just put it in the userfunctions folder and usethe second value is the dura level the item must beat to be kept.
Code: Select all
inventory:update()The profile settings only affect player:merchant() which we are not using.
I had to test the function myself to find the bugs. Turned out I forgot to move where the 'sellit' variable declaration when I did my last change and I used a wrong symbol in the pattern match.
This is now working for me.
I've attached it as a userfunction file. Who knows maybe I'll develop it further. For now, it does what you want it too.
To use it just put it in the userfunctions folder and use
Code: Select all
expertSell("Carey Delis",100)- Attachments
-
- addon_expertsell.lua
- (816 Bytes) Downloaded 155 times
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
That addon is still skipping many items. I tried changing this line:
to
and then it didn't skip any items. It started from first slot and sold all items that dura is less than 100 or dura more than 100 and has stats on it. So i did this:
So it won't sell my potions.But if my inventory is not full it would just go through every slot one by one and checks if there is item to sell. That doesn't matter for now cause i go sell only if my inventory is full.
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) thenRe: Keep only clean HD items when selling items?
That's a nice little addition.
Sorry, I see another error. Were the items skipped all weapons? It should be "Weapons" not "Weapon". I thought I fixed that. Also, of course, if you are playing in another language then you would translate "Weapons" and "Armor" to that language.
Sorry, I see another error. Were the items skipped all weapons? It should be "Weapons" not "Weapon". I thought I fixed that. Also, of course, if you are playing in another language then you would translate "Weapons" and "Armor" to that language.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Keep only clean HD items when selling items?
I have english client. I fixed that typo and i now test how its working.
edit: typo
edit: new typo and now it should be working well. It's keeping clean hd items and selling dirty items from right slots. Thank you so much Rock5
I uploaded latest version from it.
Code: 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")) thenedit: new typo and now it should be working well. It's keeping clean hd items and selling dirty items from right slots. Thank you so much Rock5
I uploaded latest version from it.
- Attachments
-
- addon_expertsell.lua
- (942 Bytes) Downloaded 122 times
Re: Keep only clean HD items when selling items?
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?
Re: Keep only clean HD items when selling items?
getGameTooltip 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_right- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: Keep only clean HD items when selling items?
I want to keep all XI and XII gear regardless of dura, and all I-statted or clean, high-dura gear. Am I close?
Code: 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
Re: Keep only clean HD items when selling items?
It's a good effort but there are a few errors.
I was thinking of adding stat autosell options awhile ago so I can point out a few thinks for you.
1. The tooltip can sometimes return duplicate lines with the same stat but without the "|cffFFFFFF" prefix so you have to take that into account. This usually happens because of addons that lengthen the data on the line such as statrating. Actually it looks like it wouldn't matter to you if you got duplicate values.
2. string.match doesn't work that way and can take some time mastering.
3. Your sellit values are all over the place. Usually you would set sellit to true and then if it ends in XI, XII etc you set it to false or if it's is a clean HD then you set it to false.
4. If the item has 2 stats eg. XI and VI, then if the XI is first it wont sell but if the VI is first it will sell. So you need to decide which action you prefer and adjust the code to do it.
To return all stats that end in XI,XII,XIII etc you can use thisThat should only match the stats that ends with 'X' and at least one 'I'.
To match any stat this should work.That will match any line that ends in a space followed by any combination of X, V or I.
The version i've come up will is this.This should sell all weapons and armor except ones with clean XI stats (ie. no lower stats) or clean hd items. Sorry for doing all the work for you but I'm really interrested in this as I still intend to add stat settings to autosell some day.
Note: this has not been tested.
I was thinking of adding stat autosell options awhile ago so I can point out a few thinks for you.
1. The tooltip can sometimes return duplicate lines with the same stat but without the "|cffFFFFFF" prefix so you have to take that into account. This usually happens because of addons that lengthen the data on the line such as statrating. Actually it looks like it wouldn't matter to you if you got duplicate values.
2. string.match doesn't work that way and can take some time mastering.
3. Your sellit values are all over the place. Usually you would set sellit to true and then if it ends in XI, XII etc you set it to false or if it's is a clean HD then you set it to false.
4. If the item has 2 stats eg. XI and VI, then if the XI is first it wont sell but if the VI is first it will sell. So you need to decide which action you prefer and adjust the code to do it.
To return all stats that end in XI,XII,XIII etc you can use this
Code: Select all
if string.match(tooltipline,"XI+$") thenTo match any stat this should work.
Code: Select all
if string.match(tooltipline," [VXI]+$") thenThe version i've come up will is this.
Code: 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
endNote: this has not been tested.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: Keep only clean HD items when selling items?
Rock, you kickass! I like to be able to understand the coding that's used and your pointers and explanations help immensely. I'll be testing this tomorrow hopefully and will post my findings afterward. 