--ITEMS OVER 1k--
local warnItems = {'yellow gem', 'wyvern fang', 'wolf trophy', 'wand of voodoo', 'wand of starstorm', 'wand of inferno', 'wand of draconia', 'wand of decay', 'wand of cosmic energy', 'underworld rod', 'titan axe', 'terra rod', 'terra hood', 'terra boots', 'terra amulet', 'spool of yarn', 'spike sword', 'spellbook of enlightenment', 'sniper gloves', 'skeleton decoration', 'shockwave amulet', 'shard', 'scarab shield', 'sacred tree amulet', 'ruby necklace', 'purple tome', 'platinum amulet', 'pirate hat', 'pirate boots', 'piece of draconian steel', 'patched boots', 'pair of iron fists', 'ornamented shield', 'northwind rod', 'norse shield', 'necrotic rod', 'ecklace of the deep', 'natural soil', 'naginata', 'mino shield', 'metal spats', 'magma monocle', 'magma boots', 'magma amulet', 'lion trophy', 'lightning pendant', 'lightning headband', 'lightning boots', 'leopard armor', 'knight axe', 'icy war hammer', 'icy knight axe', 'iced soil', 'ce rapier', 'hibiscus dress', 'helmet of the lost', 'heavy trident', 'hailstorm rod', 'guardian shield', 'golden sickle', 'golden amulet', 'glorious axe', 'glooth whip', 'glooth club', 'glooth blade', 'glooth axe', 'glooth amulet', 'glimmering soil', 'glacier shoes', 'glacier mask', 'glacier amulet', 'giant shimmering pearl', 'flower dress', 'fire sword', 'fiery war hammer', 'fiery spike sword', 'fiery knight axe', 'energy war hammer', 'energy spike sword', 'energy soil', 'energy knight axe', 'elvish bow', 'earth war hammer', 'earth spike sword', 'earth knight axe', 'dragon hammer', 'disgusting trophy', 'diamond sceptre', 'devil helmet', 'demon horn', 'deer trophy', 'deepling staff', 'death ring', 'daramanian waraxe', 'crystal of power', 'crystal of focus', 'crystal of balance', 'crown helmet', 'crocodile boots', 'cowtana', 'broken visor', 'broken ring of ending', 'amber staff', 'angelic axe', 'banana staff', 'bat decoration', 'beastslayer axe', 'beetle necklace', 'behemoth claw' } --over 1k
local rareLootColor = 0xFFFF00
--RUSTY ITEMS--
local warnItemsRusty = {'rusty armor', 'rusty legs'}
local rustyLootColor = 0x993300
--PLATINUM COINS--
local warnItemsPlatinum = {'platinum coins', 'platinum coin'}
local platinumLootColor = 0x02d0ff
local maxMsgs = 8 -- max lines to display at once
local msgTimeOut = 30000 -- will only show loots from the last 30 seconds
local position = 'left' -- right or left
local lootColor = 0x11EC09
-- dont edit anything below this line
local fontsize = 7
local fontspacing = fontsize + 6
local isRight = (position == 'right')
local msgs = {}
setfontstyle("Tahoma", fontsize, 75, lootColor, 1, 0x002200)
setmaskcolorxp(0)
init end
foreach newmessage m do
if m.level == 0 and m.content:sub(0,8) == 'Loot of ' then
local msgInfo = m.content:lootmsg()
local color = lootColor
local hasItems = false
local a = 0
local b = 0
local c = 0
local d = 0
local e = 0
local f = 0
local g = 0
local msg = msgInfo.name .. ': '
local lastIndex = #msgInfo.items
for index, item in ipairs(msgInfo.items) do
hasItems = true
if (item.count > 1) then
msg = msg .. item.count .. ' '
end
msg = msg .. item.name
if index ~= lastIndex then
msg = msg .. ', ' or ' ('
end
if table.find(warnItemsErare, item.name) then
a = a + 1
elseif table.find(warnItemsUrare, item.name) then
b = b + 1
elseif table.find(warnItemsVrare, item.name) then
c = c + 1
elseif table.find(warnItemslrare, item.name) then
d = d + 1
elseif table.find(warnItems, item.name) then
e = e + 1
elseif table.find(warnItemsRusty, item.name) then
f = f + 1
elseif table.find(warnItemsPlatinum, item.name) then
g = g + 1
end
end
if (hasItems) then
if a > 0 then
color = erareLootColor
elseif b > 0 then
color = urareLootColor
elseif c > 0 then
color = vrareLootColor
elseif d > 0 then
color = lrareLootColor
elseif e > 0 then
color = rareLootColor
elseif f > 0 then
color = rustyLootColor
elseif g > 0 then
color = platinumLootColor
end
local msgWidth = measurestring(msg)
table.insert(msgs, {['msg'] = msg, ['color'] = color, ['time'] = $timems, ['width'] = msgWidth})
end
end
end
local msgsLen = #msgs
local longestLine = 0
if isRight then
for index = msgsLen, math.max(msgsLen - maxMsgs + 1, 1), -1 do
if msgs[index].width > longestLine then longestLine = msgs[index].width end
end
end
local i = 1
while (i <= msgsLen) do
if $timems - msgs[i].time <= msgTimeOut and i > msgsLen - maxMsgs then
setfontcolor(msgs[i].color)
addtext(msgs[i].msg, tern(isRight, longestLine - msgs[i].width + 2, 2), i*fontspacing)
i = i + 1
else
table.remove(msgs, i)
end
msgsLen = #msgs
end
if not isRight then
setposition($worldwin.left + 3, $worldwin.bottom - i*fontspacing)
else
setposition($worldwin.right - 3 - longestLine, $worldwin.bottom - i*fontspacing)
end
if msgsLen == 0 then -- to clear HUD when resetting script
addtext('', 0, 0)
end
Plz, do not hate me code, could be awefull, but u can still use earlier version ;)
Very good, but you have to configure hud every time you change the hunt. You could try using the foreach lootingitem which uses the bot looting settings
example:
foreach lootingitem m category do
if (m.sellprice >= 80) then
LootColor = 0x850185
elseif (m.sellprice >= 30) and (m.sellprice < 80) then
LootColor = 0xFF0000
end
end
Very good, but you have to configure hud every time you change hunt
Could u explain that ?
Mb. Ill explain how its works.
I created version of this script thinking about Team Hunts.
Many times my palladin didnt collect any expensive items because usually he must be fast and following us to get sharied experience, looking into loot table and read whats dropped its timeless, so, i decide that first version of "recentloot" script is not satisfactory for me because i have only 1 type of color.
I wanted see specified item in another color.
Like if i see green, blue, yellow i know, there aren't expensive items, so if palladin miss it, ill not cry, but if i see color purple, red or orange, i know , there is something interesting, and i can tell to my palladin that example: steel boots dropped and he should find it.
So i created 7 tables and i seperated into groups of items by cost like
group A items over 80k
Group B items over 30k ect.
All items in tables are sellable in NPC
I didnt put items which i cant sold, coz price is another on every Tibia server.
And propably(didnt try ur version, but tested without new variables), this script is simple, if found item, change color, but.. if loot look like this:
Loot of rat: steel boots, 2 platinum coins.
Color will be blue, not red.
Explain
Found: steel boot
Change
Color = 0xFF0000
next item - found: 2 platinum coins
Change
Color = 0x0000FF
Finnaly color - 0x0000FF
And i think nothing interest inside coz i will not read blue loot color.
Below original code of RecentLoot (didnt found thread with this script)
init start
-- SCRIPT_VERSION = '1.1.1'
local warnItems = {'fire sword', 'boots of haste', 'wand of inferno'} -- you can add more items here
local maxMsgs = 5 -- max lines to display at once
local msgTimeOut = 30000 -- will only show loots from the last 30 seconds
local position = 'left' -- right or left
local rareLootColor = 0xCE7C4E
local lootColor = 0x2DA357
-- dont edit anything below this line
local fontsize = 7
local fontspacing = fontsize + 6
local isRight = (position == 'right')
local msgs = {}
setfontstyle("Tahoma", fontsize, 75, lootColor, 1, 0x002200)
setmaskcolorxp(0)
init end
foreach newmessage m do
if m.level == 0 and m.content:sub(0,8) == 'Loot of ' then
local msgInfo = m.content:lootmsg()
local color = lootColor
local hasItems = false
local msg = msgInfo.name .. ': '
local lastIndex = #msgInfo.items
for index, item in ipairs(msgInfo.items) do
hasItems = true
if (item.count > 1) then
msg = msg .. item.count .. ' '
end
msg = msg .. item.name
if index ~= lastIndex then
msg = msg .. ', '
end
if table.find(warnItems, item.name) then
color = rareLootColor
end
end
if (hasItems) then
local msgWidth = measurestring(msg)
table.insert(msgs, {['msg'] = msg, ['color'] = color, ['time'] = $timems, ['width'] = msgWidth})
end
end
end
local msgsLen = #msgs
local longestLine = 0
if isRight then
for index = msgsLen, math.max(msgsLen - maxMsgs + 1, 1), -1 do
if msgs[index].width > longestLine then longestLine = msgs[index].width end
end
end
local i = 1
while (i <= msgsLen) do
if $timems - msgs[i].time <= msgTimeOut and i > msgsLen - maxMsgs then
setfontcolor(msgs[i].color)
addtext(msgs[i].msg, tern(isRight, longestLine - msgs[i].width + 2, 2), i*fontspacing)
i = i + 1
else
table.remove(msgs, i)
end
msgsLen = #msgs
end
if not isRight then
setposition($worldwin.left + 3, $worldwin.bottom - i*fontspacing)
else
setposition($worldwin.right - 3 - longestLine, $worldwin.bottom - i*fontspacing)
end
if msgsLen == 0 then -- to clear HUD when resetting script
addtext('', 0, 0)
end