View Single Post
05/27/20, 08:45 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,973
If you want to: You can use DoItAll for this (written by Randacrtyl in the addon comments as well!)
It got the same feature and supports FCOItemSaver marked items (not moved) as well as AdvancedFilters + plugins and FCOCraftFilter.
Also got other featrues like extract all, refine all, attach all to mail, trade all, etc.

Else try to change the function to this (untested):
Seems the slotIndex was not found somehow so I've tried to look for slotIndex or slot, else do not add the item.
Lua Code:
  1. local function DepositAllItems(button)
  2.     local window = button:GetParent():GetNamedChild("Backpack")
  3.     local delayStep = 300
  4.  
  5.     local toBagId
  6.     local fromBagId = BAG_BACKPACK
  7.     if button.guild == true then toBagId = BAG_GUILDBANK
  8.     else toBagId = BAG_BANK end
  9.  
  10.     local tempitems = {}
  11.     local items = {}
  12.     for _,v in pairs(window.data) do
  13.         local slotIndex = v.data.slotIndex or v.data.slot
  14.         if slotIndex then
  15.             tempitems[slotIndex] = v.data
  16.         end
  17.     end
  18.     for _,v in pairs(tempitems) do
  19.         table.insert(items, v)
  20.     end
  21.  
  22.     MoveItems(toBagId, fromBagId, items, delayStep)
  23. end

Last edited by Baertram : 05/27/20 at 08:49 AM.
  Reply With Quote