09-17-2021, 04:33 PM
Check fluid count from "Using ... " message
Check multiple items count from "Using ... " message and go to label
keywords: check supply, check mana, check runes, check msg supply, check msg rune, check message supply, check message rune, check message mana, count mana, count supply, count rune
local ItemCheck = 'vial'
local msg = screenmessage()
if msg ~= nil and msg ~= '' then
local count = itemcountmsg(ItemCheck, msg)
if count >= 0 and count < 20 then
playsound('alert_healthbelow')
flashclient()
end
end
Check multiple items count from "Using ... " message and go to label
local ITEMS = {
{ NAME = 'vial', MIN_COUNT = 10 }, -- Items names should be exactly like appears on the message.
{ NAME = 'rune', MIN_COUNT = 5 }, -- Items names should be exactly like appears on the message.
}
local LEAVE_LABEL = 'leave_hunt'
local msgs = getnewmessages()
for _, msg in ipairs(msgs) do
if msg.type == 6 then
for __, item in ipairs(msgs) do
local count = itemcountmsg(item.NAME, msg.content)
if count ~= -1 and count <= item.MIN_COUNT then
gotolabel(LEAVE_LABEL)
break
end
end
end
end
keywords: check supply, check mana, check runes, check msg supply, check msg rune, check message supply, check message rune, check message mana, count mana, count supply, count rune