Hello.
The script that you mention doesn't uses ID, so I'm not sure what you mean.
You can only retrieve messages from the current selected channel, so you would need to let Server log selected. That also means Alerts -> Selected Chat Msg would also work for Server Log and not Default channel.
If loot message shows on a green message in the middle of your screen AND you are killing single monsters (like battle attack, not GFB rune for example) then you could use the script below:
local MESSAGES_PIECES = {
'Rat plague',
'western Darashian'
}
if connected() then
table.lower(MESSAGES_PIECES)
local screenMsg = screenmessage(true)
if screenMsg ~= nil and screenMsg ~= '' then
screenMsg = screenMsg:lower()
for _, msgPiece in ipairs(MESSAGES_PIECES) do
if string.find(msgPiece:lower(), screenMsg) ~= nil then
playsound('default')
flashclient()
end
end
end
end
But if you plan to let Server log selected then use like this, which will play alert if finds those texts in selected channel messages.
I let 'rare' as example, because would trigger anything that has "rare" like: rare war hammer, rare golden boots.
local MESSAGES_PIECES = {
'uncommon war hammer',
'rare',
}
if connected() then
table.lower(MESSAGES_PIECES)
local messages = getnewmessages()
for _, message in ipairs(messages) do
if message.sender == '' and message.content ~= nil and message.content ~= '' then
local msgLowered = message.content:lower()
for __, piece in ipairs(MESSAGES_PIECES) do
if string.find(msgLowered, piece:lower()) ~= nil then
playsound('default')
flashclient()
break
end
end
end
end
end