View Single Post
02-10-23, 02:55 AM   #10
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,331
I wrote my own script to do this a long time ago and decided to dust it off and make some improvements. It should work with Classic Era, Wrath Classic, and Dragon Flight.

Lua Code:
  1. local function UnequipAll()
  2.     local invslot,lastslot=EQUIPPED_FIRST or INVSLOT_FIRST_EQUIPPED,EQUIPPED_LAST or INVSLOT_LAST_EQUIPPED;
  3.  
  4.     ClearCursor();
  5.     for bag=NUM_BAG_SLOTS or NUM_TOTAL_EQUIPPED_BAG_SLOTS,0,-1 do
  6.         local free,type=(C_Container or _G).GetContainerNumFreeSlots(bag);
  7.         free=(type==0 and free or 0);
  8.  
  9.         for _=1,free do
  10.             PickupInventoryItem(invslot);
  11.             (bag==0 and PutItemInBackpack or PutItemInBag)((C_Container or _G).ContainerIDToInventoryID(bag));
  12.  
  13.             invslot=invslot+1;
  14.             if invslot>lastslot then return; end
  15.         end
  16.     end
  17. end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote