• Visit Rebornbuddy
  • Check if a stash tab has enough space

    Discussion in 'Archives' started by cyberbot, Oct 26, 2014.

    1. cyberbot

      cyberbot Member

      Joined:
      Mar 15, 2014
      Messages:
      220
      Likes Received:
      2
      Trophy Points:
      18
      Which function tells me if the current stash tab does not have enough space for the item that I am trying to stash?

      Thanks.
       
    2. cyberbot

      cyberbot Member

      Joined:
      Mar 15, 2014
      Messages:
      220
      Likes Received:
      2
      Trophy Points:
      18
      Do I have to really try to stash an item and wait for a "CouldNotFitAllitems" StashItemsCoroutineError? Is there not a way to check before trying to stash?
       
    3. Nepthys

      Nepthys Community Developer

      Joined:
      Oct 13, 2014
      Messages:
      89
      Likes Received:
      1
      Trophy Points:
      0
      heyas :)

      I haven't done anything with stashing yet, so can't say from experience
      but maybe Loki.Bot.v3.Coroutines.BestStashTabForItem could help reduce the problem?


      Thanks!
       
    4. darkbluefirefly

      darkbluefirefly Community Developer

      Joined:
      Nov 8, 2013
      Messages:
      1,927
      Likes Received:
      18
      Trophy Points:
      38
      Hey dude.

      Code:
      Coroutines.StashItemsCoroutine
      Should take care of it for you, Pushedx made it real easy to stash.
       
    5. cyberbot

      cyberbot Member

      Joined:
      Mar 15, 2014
      Messages:
      220
      Likes Received:
      2
      Trophy Points:
      18
      Dark, thanks for your help, but that was not what I am asking. I know the existence of Coroutines.StashItemsCoroutine, but I wonder if there is a way to check if the Current tab is full before trying to stash an item.

      By the way, what is "object user" which is one of the possible arguments in Coroutines.StashItemsCoroutine? I am setting it to null at the moment and seems to be OK.
       
    6. pushedx

      pushedx Moderator Moderator Buddy Core Dev

      Joined:
      Sep 24, 2013
      Messages:
      4,258
      Likes Received:
      290
      Trophy Points:
      83
      You need to obtain the 'Inventory' class object for whatever inventory you want to check. Then, you can use CanFitItem. Check the overloads for more options as well.

      LokiPoe.InGameState.StashPanel.CurrentTabInventory gets you the current inventory for the current stash tab.
       

    Share This Page