+ Reply to Thread
Results 1 to 5 of 5

Thread: How does Inspect.Item.Find() work?

  1. #1
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default How does Inspect.Item.Find() work?

    I've been toying around with some new addon ideas. For this I wanted to use Inspect.Item.Find() to find out if a certain item can be found in the players inventory. What I got is the addonKey provided by the items.xml so I can do an Inspect.Item.Detail() to query the details. This works as intended, but I can't find any way to use the information on Inspect.Item.Find().

    Here's what I'm trying to do:

    Code:
    local err, details = pcall (Inspect.Item.Detail, itemKey)
    	if err == true then 
    		local nextErr, tmp = pcall(Inspect.Item.Find, details.id)
    		if nextErr == true then dump (tmp) end
    	end
    I tried both the ID as well as the type parameter returned by Inspect.Item.Detail(). None of the two works.

    Has someone already toyed around with this and could tell me what I'm doing wrong?

    Cheers
    N.

  2. #2
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    I believe the intended usage is to find an item by "id", which refers to a single specific instance-of-item. Like, if you have two stacks of the same item, each has its own id. I don't know whether it survives relogging or /reloadui, but I wouldn't expect it to.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  3. #3
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default

    Yeah looks like it the individual ID of the item in your inventory. So Inspect.Item.Find() will not help if I was trying to find out if a player has a certain item in his inventory. Let's go for the workaround ...

    Cheers
    N.

  4. #4
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Quote Originally Posted by Naifu View Post
    Yeah looks like it the individual ID of the item in your inventory. So Inspect.Item.Find() will not help if I was trying to find out if a player has a certain item in his inventory.
    Boy, sure would be nice if *cough*LibEnfiltrate*cough* someone had ALREADY DONE THAT.

    This is basically the kind of thing it's designed to solve.

    Code:
    local filter = Library.LibEnfiltrate.Filter:new()
    filter:require('type==' .. item_type)
    local items = Inspect.Item.Detail(Utility.Item.Slot.All())
    items = filter:filter(items)
    Look, it's every item you had with that type!

    I'm thinking of moving the iterate/select/reject/first stuff from LibBaggotry over to LibEnfiltrate, since it'd be useful for lots of stuff.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  5. #5
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default

    While I really appreciate your work and you showing a level of knowledge about development as a whole which clearly goes way above mine, I would not use your libs at the moment a rather simple reason:

    With the API only being available for a little more than 6 monts old I wouldn't want to use third party libraries. What happens if you quit Rift or what about I'd do that? Being independent feels like the better way for me at the moment. If we'd be 1-2 years into future and a framework like Ace would have matured, I'd be very much using third party libs of such a framework. Just not now, yet.

    But hey that's my personal opinion. I see a lot of potential in your work and your knowledge that you might be able to build the foundation to a framework. I'd be there to support you. Until then I'll stick with my own work cause it helps me understanding better the API as a whole.

    Cheers
    N.
    Last edited by Naifu; 03-02-2012 at 05:23 AM.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts