Hi
I am looking for some help streamlining a solution for an issues I am having.
How to sell items in my inventory including and most importantly the arrows in my ammo slots that become two high level after swapping class.
Example: I am a Rogue41\Scout39, have quivers in bag, and arrows in ammo slot, also have potions for my level. I want to swap to the Scout being Primary class, but doing this will make all my ammo in hand and quivers in bag, and potions in bag all too high a level to use.
I can send the character to the Merchant and Weapon vendor, and the Store.lua script will purchase more of everything at the appropriate level, but how do I get rid of all the too high level items?
The most important thing though, is getting rid of the too high level arrows in my ammo slot, as I cannot use them, and wont reload until they are gone, so catch 22.
Selling high level items after class swap
-
imaginethat
- Posts: 61
- Joined: Sun Jul 10, 2011 10:39 pm
Re: Selling high level items after class swap
You can use EquipItem. All you have to do is equip an empty slot.
As for selling, do you know the names of the items you want to sell or do you want to just sell all pots and ammo with too high a level?
Code: Select all
local empty = inventory:findItem(0,"bags")
RoMScript("EquipItem(10,"..empty.BagId..")")- 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
-
imaginethat
- Posts: 61
- Joined: Sun Jul 10, 2011 10:39 pm
Re: Selling high level items after class swap
Hi rock5
you make things so simple, thanks.
yes I want to sell pots and ammo that I was using, but now cant use due to just changing to the lower level class. character does not drop pots/ammo, and does not sell pots/ammo, and do not want to carry it around until the character levels a couple of levels. (bag space is precious)
So the thing I want to sell will be in covered in the "consumables.xml" file
Thanks
you make things so simple, thanks.
yes I want to sell pots and ammo that I was using, but now cant use due to just changing to the lower level class. character does not drop pots/ammo, and does not sell pots/ammo, and do not want to carry it around until the character levels a couple of levels. (bag space is precious)
So the thing I want to sell will be in covered in the "consumables.xml" file
Thanks
Re: Selling high level items after class swap
You didn't really answer my question. Oh well. I'll just assume you want the harder solution of a general code that will sell any items above your level as apposed to a set list of items.
The only way I can see to sell them is to go through the steps of manually selling them. I can't see how we could get 'player:merchant' to do it. Of course you could also toss them.
This is untested so test it with caution.
The only way I can see to sell them is to go through the steps of manually selling them. I can't see how we could get 'player:merchant' to do it. Of course you could also toss them.
Code: Select all
if player:openStore("npcname") then
yrest(500)
for i = 61,120 do -- first 2 bags
local item = inventory.BagSlot[i]
if (item:isType("Potions") or item:isType("Arrows")) and
item.RequiredLvl > player.Level and item.Worth >= 1 then -- some items can't be sold
item:use()
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
-
imaginethat
- Posts: 61
- Joined: Sun Jul 10, 2011 10:39 pm
Re: Selling high level items after class swap
Hi
I want to sell all pots/ammo that is too high a level to use.
The script you provided works perfectly, but I have added a bit to it to pick up Quivers, as they seem to have a Type of "Other"
I added this into the or part of the If statement
And works great
Thanks so much for your help
I want to sell all pots/ammo that is too high a level to use.
The script you provided works perfectly, but I have added a bit to it to pick up Quivers, as they seem to have a Type of "Other"
I added this into the or part of the If statement
Code: Select all
(string.find(string.lower(item.Name),string.lower("Quiver")))Thanks so much for your help