if Needed_Runes == 0 then
while Needed_Runes > 0 and (itemcount(FoodID, ExtraDepotBackpack) > 0) and (getcontainer(SupplyBPname).maxslots - getcontainer(SupplyBPname).usedslots > 0) do
Needed_Runes = RunesToGet - (itemcount(RuneName,SupplyBPname))
Credits to BUGWT and his team.
i just used his base to do this.
PD: Your MainBP and your Supply bp have to be opened before use this... change backpacks name as your pleasure.
while windowcount() < 2 do
openitem(MainBPname, "back", true)
openitem(SupplyBPname, MainBPname, true)