View Single Post
05-24-22, 10:01 PM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Unequip all items

Hi all

I am trying to unequip all items into any empty bag slot.

The problem is that I can unequip all items into my bags or into my backpack but not all into any empty slot in both.

This is the code I am trying to run;
Lua Code:
  1. for k, v in pairs(EquipmentSlots) do
  2.    PickupInventoryItem(v)
  3.    for bag = 0, 4 do
  4.       for slot = 0, GetContainerNumSlots(bag) do
  5.          local itemID = GetContainerItemID(bag, slot)
  6.          if not itemID then
  7.             PutItemInBag(slot)
  8.          end
  9.       end
  10.    end
  11.    if CursorHasItem() then
  12.     PutItemInBackpack()
  13.    end
  14. end

If I have enough bagspace the items move into the bags, but if I do not have enough space the leftover items do not drop into the backpack.

I have tried splitting it into 2 separate chunks runnig one after the other with the same results.

It is the backpack one that seems to break it, it will fill the backpack then say "not enough space" and then stop altogether.

Does anyone have any advice/help for me?

Cheers
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote