Drain Soul - Delete Extra Shard Macro

Can’t seem to get this macro to run correctly. Specifically, it fails when trying to execute PickupContainerItem() with the message that the function is nil.

Any advice?

#showtooltip Drain Soul
/petfollow
/cast Drain Soul(Rank 1)
slots = C_Container.GetContainerNumSlots(4)
/run  C_Container.PickupContainerItem(4,slots) DeleteCursorItem()

Your /run in in the wrong spot.

#showtooltip Drain Soul
/petfollow
/cast Drain Soul(Rank 1)
/run local slots = C_Container.GetContainerNumSlots(4) C_Container.PickupContainerItem(4,slots) DeleteCursorItem()

Thank you. Should have seen that.

Cheers