Page 1 of 1
Delete item by name/id?
Posted: Sat Mar 02, 2013 6:34 pm
by attackspeedzero
I'd love to know what function to use to delete items from my character's inventory either by ID or name.
inventory:deleteItemInSlot(slot)
Code: Select all
function CInventory:deleteItemInSlot(slot)
self.BagSlot[slot]:delete();
end
was the closest thing I could find but it doesn't seem to work, or maybe I'm calling it wrong.
Thanks in advance!
Re: Delete item by name/id?
Posted: Sat Mar 02, 2013 7:46 pm
by lisa
Re: Delete item by name/id?
Posted: Wed Mar 06, 2013 12:08 pm
by attackspeedzero
Thanks! That makes things much easier.
Re: Delete item by name/id?
Posted: Thu Mar 07, 2013 1:10 am
by attackspeedzero
This actually does work, but I was calling it wrong. I didn't know that the player's inventory starts with 61 when I wrote the original post. I think 0-60 is reserved for the item shop bag or something.
This is great for sacking the newbie pet egg on my elf daily quest alts!
Re: Delete item by name/id?
Posted: Thu Mar 07, 2013 1:17 am
by lisa
just use this to get rid of newbie pet.
Code: Select all
local pet = player:findNearestNameOrId(113199)
if pet then inventory:useItem(207051); end -- get rid of the annoying newbie pet