Dont loot more than 99 of an item
Dont loot more than 99 of an item
How can i say if the bot got 99 of an item then dont loot it again until its 98 or less?
Thanks for help.
Thanks for help.
Re: Dont loot more than 99 of an item
You can't tell the bot not to loot. It doesn't loot. It just attacks the dead mob and your lootfilter addon does the looting. All you could do is have a function that you could run occationally to drop the excess items.
- 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: Dont loot more than 99 of an item
can you help me with the function?
I think i need commands like
RoMScript("PickupBagItem("..slotitem.BagId..")")
RoMScript("DeleteCursorItem()")
but i dont know how i find the bagid of the item i want to delete.
I think i need commands like
RoMScript("PickupBagItem("..slotitem.BagId..")")
RoMScript("DeleteCursorItem()")
but i dont know how i find the bagid of the item i want to delete.
Re: Dont loot more than 99 of an item
Assuming that if you have more than 99 you will have a big stack and a small stack then
will return the smallest stack. You can then drop it by doing.
Code: Select all
SmallStack = inventory:findItem("item name")SoSmallStack:delete()
Code: Select all
if inventory:itemTotalCount("item name") > 99 then
local SmallStack = inventory:findItem("item name")
SmallStack:delete()
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: Dont loot more than 99 of an item
WOW. Thank you. Works fine.
Re: Dont loot more than 99 of an item
Hmmm... this has me thinking now... Would there be a way to make that look at an item table instead of ("item name")? Trying to think how to word this for it to make sense. Ok, say I want to add that function to my onleavecombat section. There are several things I would like it to check for such as the 10% phirius pots, mana and hp stones, amulets of light, etc. It would be much easier to add another item to a table (and much cleaner coding) if it would look at a table instead of making a new code block for each item.
Like having one instance of the code in my onleavecombat:
and a table like
Like having one instance of the code in my onleavecombat:
Code: Select all
if inventory:itemTotalCount(item_table) > 99 then
local SmallStack = inventory:findItem(item_table_entry)
SmallStack:delete()
end
Code: Select all
item name/ID #1
item name/ID #2
item name/ID #3
Scout/Knight/Rogue 70/66/66
Re: Dont loot more than 99 of an item
create your table, for this example
You can have that in onload or somewhere. Maybe even make a userfunction out of the entire thing. Anyway then to check use this
Code: Select all
keptitems = {"Amulet of Light", "phitius pot", "some other item", "Something else", "blah blah"}
Code: Select all
for k,v in pairs(keptitems) do --looks into the table keptitems, v is the names you added. k is just the ordered number.
if inventory:itemTotalCount(v) > 99 then
local SmallStack = inventory:findItem(v)
SmallStack:delete()
end
end
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: Dont loot more than 99 of an item
Thank you very much Lisa, once again you are a godsend 
Scout/Knight/Rogue 70/66/66
Re: Dont loot more than 99 of an item
The only problem with that is, if the goal is to keep only 1 stack, not all items have a stack size of 99. We would have to check the stack size. The inventory items have that value so to use it you would have to get it first before the check. Try
Code: Select all
for k,v in pairs(keptitems) do --looks into the table keptitems, v is the names you added. k is just the ordered number.
local SmallStack = inventory:findItem(v)
if SmallStack and inventory:itemTotalCount(v) > SmallStack.MaxStack then
SmallStack:delete()
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: Dont loot more than 99 of an item
One other question. Instead of using the item names, could I do something likelisa wrote:create your table, for this exampleCode: Select all
keptitems = {"Amulet of Light", "phitius pot", "some other item", "Something else", "blah blah"}
Code: Select all
keptitems = {itemID#1, itemID#2, itemID#3, itemID#4, itemID#5}Scout/Knight/Rogue 70/66/66
Re: Dont loot more than 99 of an item
I don't see why not, I would try without the " " though.
So
Would obviously need testing, I don't recall using numbers in a table before.
Reason I said not to use the " " is because when it goes to use it in
you don't want
So
Code: Select all
keptitems = {500544, 586755, 699776, 273737}Reason I said not to use the " " is because when it goes to use it in
Code: Select all
local SmallStack = inventory:findItem(v)Code: Select all
local SmallStack = inventory:findItem("500544")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: Dont loot more than 99 of an item
Right, because the "" would make it a text string instead of a numerical value.
Scout/Knight/Rogue 70/66/66