those sort of actions cannot be performed via lua (I assume to prevent people from writing bots). You need user interaction, hence the quickslot. You can get creative with it though...
- create quickslot
- place it behind an image icon
- set a timer to highlight the image (so it flashy the user) ever 5 minutes to indicate they need to click it to get another pellet.