View Single Post
03/07/15, 02:38 PM   #1
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Fish gutting snippet

Made this real quick to use all of my hundreds of fish items. There aren't really any safety checks, so it needs to be used responsibly (use it on fish!)

Lua Code:
  1. local function AddContextMenuOption(rowControl)
  2.     local bagId = rowControl.bagId
  3.     local slotIndex = rowControl.slotIndex
  4.  
  5.     AddMenuItem("Use All", function()
  6.             local delay = 0
  7.             for i = 1, rowControl.stackCount do
  8.                 zo_callLater(function() CallSecureProtected("UseItem", bagId, slotIndex) end, delay)
  9.                 delay = delay + 2000
  10.             end
  11.         end, MENU_ADD_OPTION_LABEL)
  12.  
  13.     ShowMenu(self)
  14. end
  15.  
  16. local function AddContextMenuOptionSoon(rowControl)
  17.     zo_callLater(function() AddContextMenuOption(rowControl) end, 50)
  18. end
  19.  
  20. ZO_PreHook("ZO_InventorySlot_ShowContextMenu", AddContextMenuOptionSoon)

If anyone wants to make something of this, go for it.

edit: one nice change would be disabling the "Fish acquired." center screen announcement!

Last edited by Randactyl : 03/07/15 at 02:45 PM.