; ========================== SUB RESTOCK ==============================
;
;gosub TG_Restock (Container) (ItemStock) (Amount) (colour)
; %1 Container to restock from
; %2 Item to restock
; %3 Number of items to take
; %4 Colour Item (optional)
; Returns #FALSE if item to move is not found
; gosub TG_Restock %Resource_Secure %Wood %Fletching_Drag_Amount
; gosub TG_Restock %Resource_Secure %Sand %Sand_Drag_Amount 2413
;
sub TG_Restock
menu Edit StatusBox 80 20 121 Restoking %Restock
Namespace Push
Namespace Local TG_Restock
if %0 < 4
set %4 0
finditem %2 C_ , %1
For #findindex 1 #findcnt
{
if #findkind = -1
{
NameSpace Pop
Return #FALSE
}
if #findcol = %4 && #findType = %2
{
exevent drag #findid %3
wait !sWait
exevent dropc #backpackid
wait !sWait
}
}
Namespace Pop
wait !sWait
return
; ----------------------------------------------------------------