Hi guys with a friend we made this little HUD to show with different colors when you loot different value items.
All items value less than 20k appears in green and all other items value superior to 20k appear in red.
Its not really usefull but we were pissed off seeing the same color for a gold ingot and Boots of haste
init start
REGEX_LOOT = '^Loot of ?a?n? (.-): (.+)$' --TEMP FIX
local warnItems = {"abyss hammer", "assassin dagger", "golden armor", "onyx flail", "composite hornbow", "twiceslicer", "relic sword", "bloody edge", "boots of haste", "demon shield", "golden legs", "hammer of wrath", "ring of the sky", "royal helmet", "steel boots", "vile axe", "zaoan sword", "demonbone amulet", "nightmare blade", "demonrage sword", "demon trophy", "dragon scale mail", "draken boots", "skull helmet", "amulet of loss", "ruthless axe", "zaoan helmet", "cobra crown", "elite draken mail", "heavy mace", "mastermind shield", "blade of corruption", "magic plate armor"}
local warnItems2 = {"cluster of solace", "blue gem", "dracoyle statue", "green gem", "gold ingot", "knight armor", "knight legs", "spiked squelcher", "warrior helmet", "zaoan shoes", "focus cape", "skull staff", "amber staff", "fire axe", "gold ring", "haunted blade", "magic sulphur", "tower shield", "war horn", "chaos mace", "dragon lord trophy", "drakinata", "piece of royal steel", "shadow sceptre", "violet gem", "glacier kilt", "magma coat", "magma legs", "terra legs", "terra mantle", "crown armor", "mercenary sword", "spellweaver's robe", "war axe", "zaoan robe", "zaoan armor", "zaoan legs", "dragon slayer", "draken trophy", "dreaded cleaver", "sai", "giant sword", "butcher's axe", "skullcracker armor", "jewelled backpack"}
local maxLines = 10 -- max lines to display at once
local lootMsgs = {}
init end
setfontstyle('Tahoma', 7, 75, 0xFFFFFF, 1, 0x000000)
foreach newmessage m do
local creature, loot = m.content:match(REGEX_LOOT)
if loot then
local message, color = m.content, 0xFFFFFF
for x, y in ipairs(warnItems2) do
if loot:find(y, 1, false) then
color = 0x00ff00
break
end
end
for k, v in ipairs(warnItems) do
if loot:find(v, 1, false) then
color = 0xFF0000
break
end
end
table.insert(lootMsgs, 1, {message = message, color = color})
end
end
while #lootMsgs > maxLines do
table.remove(lootMsgs)
end
for k, msg in ipairs(lootMsgs) do
setfontcolor(msg.color)
drawtext(msg.message, 0, k * 10)
end
setposition($worldwin.left + 3, $worldwin.bottom - #lootMsgs * 10 - 13)