Quote Originally Posted by alehopper View Post
I've messed around a bit with some example scripts and I managed to do this:


But I haven't gotten it to highlight loot so far, I've messed around ALOT tryin to get it to work but I just can't

And here's the script without highlighting loot, maybe someone can try to add it? Else i'll keep trying xd Would also be good to be avle to adjust the position, I would love to use this together with shadowhud.
Code:
--set the title of the HUD
local title = "Recent Loot:"
local showTitle = true

--set the number of messages to show
local messageCount = 10

--set the top left x and y coordinates of the HUD
local location =
{
	x = 25,
	y = 5
}

--set the colors for the HUD
local colors = 
{
	message = {95, 247, 247},
	title = {225, 225, 225},
}

-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------

--this creates the title HUD
if (showTitle == true) then
	local HUDTitle = HUD.CreateTextDisplay(location.x, location.y, title, unpack(colors.title))
	location.y = location.y + 20 -- just offsets the y axis to below the header
end

--loop from 1 until messageCount, creating HUD objects for each
local HUDData = {}
for index = 1, messageCount do
	local data = {}
	
	-- no message yet
	data.message = ""
	
	--create the label HUD
	data.label = HUD.CreateTextDisplay(
							location.x,
							-- +12 pixels to the y axis for every item
							location.y + ((index - 1) * 12),
							data.message,
							-- text color
							unpack(colors.message)
						)
						
	--store the data to use later
	HUDData[index] = data
end

--this is a proxy event which gets invoked when a private message is received
LootMessageProxy.OnReceive("lootProxy", function (proxy, message)
	local creature = string.match(message, "(.+):") --this stores the first part of the lootmessage "Loot of <monster>"
    local loot = string.match(message, ": (.+)") --this stores everything after the first part of the lootmessage "a gold coin, meat, 2 worms"
	local message = creature .. ": " .. loot 
	

	
	--this will move each message "up" (from index 4 to 3, 3 to 2, 2 to 1, etc)
	for index = 1, messageCount-1 do
		HUDData[index].message = HUDData[index+1].message
		HUDData[index].label:SetText(HUDData[index].message)
	end
	
	--this will put the new message in the last index
	HUDData[messageCount].message = message
	HUDData[messageCount].label:SetText(message)
end)
I will look into it when i get some time. Won't be this week tho, busy with studying for exams.