Hello.
Well, there's no 100% accurate to do that because LUA is not connected to Runemaker, but you can try.
I've developed two scripts, that will pickup life rings when there's no more life rings.
The 1st script will try to do what you asked for, try to guess when it's done refilling then refill life rings. refilling which may fail. The second script will only pickup more rings if it's not refilling or in danger.
Both scripts will work in same way: Disable runemaker, reach a location, open a container on the floor and pickup life rings then enable runemaker again.
If there's no more life rings, it will try to open the next backpack. So you need a backpack with 19 life rings and a backpack inside... This backpack inside will have more 19 life rings and another backpack.
1st script
Try to detect when bot is refilling then disable runemaker after it finishes refilling then refill life rings and enable runemaker again.
local ITEM = 'life ring' -- Item NAME or ID, id is recommended.
local ITEM_MAX_AMOUNT = 10 -- Max. amount that you wanna carry.
local ITEM_CONTAINER = 'red backpack' -- Container that item will be moved to.
local GROUND_CONTAINER = 'bag' -- Item NAME or ID of container on FLOOR. Id is recommended.
local GROUND_LOCATION = { X = 12345, Y = 12345, Z = 7 } -- Location of container with life rings on FLOOR.
if WAS_REFILLING == nil then
WAS_REFILLING = runemaker_isrefilling()
end
if runemaker_isondanger() == false and runemaker_isrefilling() == false and WAS_REFILLING and itemcount(ITEM, ITEM_CONTAINER, true) < ITEM_MAX_AMOUNT then
setsettings('Runemaker/Enabled', false)
for i = 1, 3 do
reachlocation(GROUND_LOCATION.X, GROUND_LOCATION.Y, GROUND_LOCATION.Z)
wait(300, 800)
local CONTAINER_ID = itemid(GROUND_CONTAINER)
local CONTAINERS_BEFORE = getcontainers()
openitem(CONTAINER_ID, ground(GROUND_LOCATION.X, GROUND_LOCATION.Y, GROUND_LOCATION.Z))
wait(1000)
local CONTAINERS_CURRENT = getcontainers()
local container = nil
for _, current in ipairs(CONTAINERS_CURRENT) do
local found = false
for __, last in ipairs(CONTAINERS_BEFORE) do
if last.index == current.index then
found = true
break
end
end
if found == false and (CONTAINER_ID <= 0 or CONTAINER_ID == current.id) then
container = current
break
end
end
if container ~= nil then
local pickup_count = math.max(0, (ITEM_MAX_AMOUNT - itemcount(ITEM, ITEM_CONTAINER, true)))
while pickup_count > 0 and container ~= nil and container.index >= 0 do
if itemcount(ITEM, container.index) > 0 then
moveitems(ITEM, ITEM_CONTAINER, container.index, pickup_count)
wait(300, 500)
else
local flag = false
for _, item in ipairs(container.items) do
if itemhasflags(item.id, 4) then
openitemslot(item.index, container.index, true)
wait(500, 800)
container = getcontainer(container.index)
flag = true
break
end
end
if not flag then
break
end
end
pickup_count = math.max(0, (ITEM_MAX_AMOUNT - itemcount(ITEM, ITEM_CONTAINER, true)))
end
break
end
end
setsettings('Runemaker/Enabled', true)
end
WAS_REFILLING = runemaker_isrefilling()
2nd script
Whenever you are out of life rings, it's gonna disable runemaker then refill life rings and enable runemaker again.
local ITEM = 'life ring' -- Item NAME or ID, id is recommended.
local ITEM_MAX_AMOUNT = 10 -- Max. amount that you wanna carry.
local ITEM_CONTAINER = 'red backpack' -- Container that item will be moved to.
local GROUND_CONTAINER = 'bag' -- Item NAME or ID of container on FLOOR. Id is recommended.
local GROUND_LOCATION = { X = 12345, Y = 12345, Z = 7 } -- Location of container with life rings on FLOOR.
if runemaker_isondanger() == false and runemaker_isrefilling() == false and itemcount(ITEM, ITEM_CONTAINER, true) == 0 then
setsettings('Runemaker/Enabled', false)
for i = 1, 3 do
reachlocation(GROUND_LOCATION.X, GROUND_LOCATION.Y, GROUND_LOCATION.Z)
wait(300, 800)
local CONTAINER_ID = itemid(GROUND_CONTAINER)
local CONTAINERS_BEFORE = getcontainers()
openitem(CONTAINER_ID, ground(GROUND_LOCATION.X, GROUND_LOCATION.Y, GROUND_LOCATION.Z))
wait(1000)
local CONTAINERS_CURRENT = getcontainers()
local container = nil
for _, current in ipairs(CONTAINERS_CURRENT) do
local found = false
for __, last in ipairs(CONTAINERS_BEFORE) do
if last.index == current.index then
found = true
break
end
end
if found == false and (CONTAINER_ID <= 0 or CONTAINER_ID == current.id) then
container = current
break
end
end
if container ~= nil then
local pickup_count = math.max(0, (ITEM_MAX_AMOUNT - itemcount(ITEM, ITEM_CONTAINER, true)))
while pickup_count > 0 and container ~= nil and container.index >= 0 do
if itemcount(ITEM, container.index) > 0 then
moveitems(ITEM, ITEM_CONTAINER, container.index, pickup_count)
wait(300, 500)
else
local flag = false
for _, item in ipairs(container.items) do
if itemhasflags(item.id, 4) then
openitemslot(item.index, container.index, true)
wait(500, 800)
container = getcontainer(container.index)
flag = true
break
end
end
if not flag then
break
end
end
pickup_count = math.max(0, (ITEM_MAX_AMOUNT - itemcount(ITEM, ITEM_CONTAINER, true)))
end
break
end
end
setsettings('Runemaker/Enabled', true)
end