Hello.
This script will check if there are RUNES on specific backpack's and...
1. IF OPEN_BACKPACK is ENABLED... If there are no specific rune and there are a container, it will open this container. I recommend to disable "OPEN_BACKPACK" (set "OPEN_BACKPACK" as false) while using "Healer/Settings/Open next BP for more supply" or "Targeting/Settings/Open next BP for more runes".
2. If there are less or equal to MinCount and there are no container, it will play a sound and flash the client.
I recommend you to use Backpack index instead of names, unless you use that specific backpack (e.g.: "golden backpack') for your runes backpacks only and all runes backpacks INSIDE are the same kind. So if you are using Golden Backpack for runes and gold coins OR not using same color for all runes backpacks, you must use index.
Index is zero-based and according the order that you opened the backpacks.
This code will check for supplies, when no more supplies and no more backpacks inside then go to a specific label, it's great for Cavebot->Actions.
This script will check if there are RUNES on specific backpack's and...
1. IF OPEN_BACKPACK is ENABLED... If there are no specific rune and there are a container, it will open this container. I recommend to disable "OPEN_BACKPACK" (set "OPEN_BACKPACK" as false) while using "Healer/Settings/Open next BP for more supply" or "Targeting/Settings/Open next BP for more runes".
2. If there are less or equal to MinCount and there are no container, it will play a sound and flash the client.
I recommend you to use Backpack index instead of names, unless you use that specific backpack (e.g.: "golden backpack') for your runes backpacks only and all runes backpacks INSIDE are the same kind. So if you are using Golden Backpack for runes and gold coins OR not using same color for all runes backpacks, you must use index.
Index is zero-based and according the order that you opened the backpacks.
local Backpack = 'green backpack' -- specific container to check for runes.
local Rune = 'ultimate healing rune' -- rune to check.
local OPEN_BACKPACK = true -- open next backpack for more runes?
local PLAY_ALERT = true -- Play alert on MinCount?
local ALERT_COUNT = 2 -- Min. count to play alert.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
Rune = itemid(Rune)
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
if (cont.name:lower() == Backpack:lower() or tostring(Backpack) == tostring(cont.index)) then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == Rune then
RunesCount = RunesCount + item.count
end
end
if OPEN_BACKPACK and RunesCount == 0 and ContainerSlot >= 0 then
openitemslot(ContainerSlot, cont.index, false)
wait(1000)
elseif PLAY_ALERT and RunesCount <= ALERT_COUNT and ContainerSlot == -1 then
playsound('default')
flashclient()
wait(800)
end
end
end
end
This code will check for supplies, when no more supplies and no more backpacks inside then go to a specific label, it's great for Cavebot->Actions.
local Rune = 'ultimate healing rune' -- Mana count to leave, it will go to LEAVE_LABEL.
local Rune_Backpack = 'green backpack' -- specific container (name, id or index) to check for runes.
local Rune_LeaveCount = 10
local Mana = 'mana fluid'
local Mana_Backpack = 'green backpack' -- specific container (name, id or index) to check for manas.
local Mana_LeaveCount = 10 -- Mana count to leave, it will go to LEAVE_LABEL.
local LEAVE_LABEL = 'Exit' -- Label to go if any of supplies above are below.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if connected() then
Rune = itemid(Rune)
Mana = itemid(Mana)
local Containers = getcontainers()
for i = 1, #Containers do
local cont = Containers[i]
local ContainerSlot = -1
local RunesCount = 0
local ManasCount = 0
local isRuneBP = false
local isManaBP = false
if (cont.name:lower() == Rune_Backpack:lower() or tostring(Rune_Backpack) == tostring(cont.index)) then
isRuneBP = true
elseif (cont.name:lower() == Mana_Backpack:lower() or tostring(Mana_Backpack) == tostring(cont.index)) then
isManaBP = true
end
if isRuneBP or isManaBP then
for j = 1, #cont.items do
local item = cont.items[j]
if itemhasflags(item.id, 4) then
ContainerSlot = item.index
elseif item.id == Rune then
RunesCount = RunesCount + item.count
elseif item.id == Mana then
ManasCount = ManasCount + item.count
end
end
if (isRuneBP and RunesCount <= Rune_LeaveCount) or (isManaBP and ManasCount <= Mana_LeaveCount) and ContainerSlot == -1 then
gotolabel(LEAVE_LABEL)
break
end
end
end
end