• Visit Rebornbuddy
  • Delete an InventoryItem?

    Discussion in 'Wildbuddy Developers' started by TehHuntorz, Oct 15, 2015.

    1. TehHuntorz

      TehHuntorz Member

      Joined:
      Jan 15, 2010
      Messages:
      60
      Likes Received:
      1
      Trophy Points:
      8
      As title states, just looking for a method to delete an InventoryItem.
      Am trying to make a quick plugin to remove the junk from my inventory whilst botting.

      So, just doing something like this...

      Code:
      foreach (var item in GameManager.Inventory.Bags.Items)            
      {
               if ((ItemType)item.Info.Type.Id == ItemType.TechnologistFormula)
               {
                      //item.Delete();
               }
      }
      But Delete or similar methods don't exist. (There's a Dispose, but I assume that's just memory related)

      Is there something I'm missing, or?
       
    2. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      Code:
      private void DeleteItem(InventoryItem Item)
      {
        ConfirmActionButton btn = new ConfirmActionButton(
        @"local InventoryBag = Apollo.GetAddon('Inventory')
            if InventoryBag ~= nil then
              local btn = InventoryBag.wndDeleteConfirm:FindChild('DeleteBtn')
              if btn ~= nil then
                btn:SetActionData(GameLib.CodeEnumConfirmButtonType.DeleteItem, " + Item.InventoryId + @")
                return btn
              end
            end
        ");
      
        if (btn.IsValid)
          btn.Click();
      }
      
      It's not wrapped, so you gotta do it yourself, shouldddd still work since I used it last! :)
       

    Share This Page