That's correct. I'm not playing anymore so I can't confirm this will work but give it a try:

Code:
function eopendepot()
    while windowcount('depot chest') < 1 do
        opendepot(true)
        wait(300,500)
        openitem(3502)
        waitping()
    end
end

local depotId = 22796

function withdrawfrombox(itemName, tobackpack, box, amount)
    local from = depotId+box
    local itemsLeft = function() return itemcount(itemname, 'depot chest') end

    eopendepot()

    openitem(from)
    wait(300)

    for i = 0, amount do
        moveitems(itemName, tobackpack, from, amount)
        waitping()

        if itemcount(itemName, tobackpack) == amount then
            break
        elseif itemsLeft() < 1 then
            nextpage('depot chest')
            if itemsLeft() < 1 then
                break
            end
        end
    end
end

// Use the function to withdraw items
withdrawfrombox('life ring', 'myBP', 1, 5)