Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Recent Loot

  1. #1
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22

    Recent Loot

    Recent Loot



    Description

    It'll show all the recent loot and highlight the important ones.


    Configuration

    Change MaxLines to the number of lines you want to display.
    Change ShowNothing to true to show "nothing" messages on the display, set it to false to hide them.
    Fill Items with the item names you want to display.
    Change Scroll to true to enable mouse scroll between messages on the display, set it to false to ignore this feature.
    Change Length to the maximum text length you want to display.

    Code

    init start

    local Config = {
    MaxLines = 10,
    ShowNothing = false,
    Items = {'cheese'},
    Scroll = true,
    Length = 60,
    }

    -- DO NOT EDIT BELOW THIS LINE --

    LootMessages = LootMessages or {}

    local HUD = {
    Restart = -1,
    Start = 1,
    End = Config.MaxLines,
    strStart = 1,
    strEnd = 30,
    strMax = 30,
    Position = {$worldwin.right + 3, $worldwin.bottom - (Config.MaxLines * 16)},
    Auxiliar = {0, 0},
    ColumnWidth = {125, 12},
    Moving = false,
    Blue = {0.0, color(36, 68, 105, 20), 0.23, color(39, 73, 114, 20), 0.76, color(21, 39, 60, 20)},
    Black = {0.0, color(75, 75, 75, 20), 0.23, color(45, 45, 45, 20), 0.76, color(19, 19, 19, 20)},
    Orange = {0.0, color(145, 95, 0, 20), 0.23, color(158, 104, 0, 20), 0.76, color(84, 55, 0, 20)},
    Green = {0.0, color(65, 96, 12, 20), 0.23, color(67, 99, 13, 20), 0.76, color(36, 52, 6, 20)},
    Red = {0.0, color(90, 12, 15, 20), 0.23, color(98, 13, 17, 20), 0.76, color(52, 6, 9, 20)},
    }

    local tempPos = $chardb:getvalue('AWE.RL', 'POSITION')

    if tempPos then
    tempPos = tempPos:explode(":")
    HUD.Position = {tonumber(tempPos[1]), tonumber(tempPos[2])}
    end

    table.lower(Config.Items) filterinput(true, true, true, Config.Scroll) setfillstyle('gradient', 'linear', 2, 0, 0, 0, 14) setfontstyle('Tahoma', 8, 50, 0xFFFFFF, 1, color(0, 0, 0, 50))

    function inputevents(e)
    if e.type == IEVENT_RMOUSEDOWN or e.type == IEVENT_MMOUSEDOWN then
    HUD.Moving, HUD.Auxiliar = true, {$cursor.x - HUD.Position[1], $cursor.y - HUD.Position[2]}
    elseif e.type == IEVENT_RMOUSEUP or e.type == IEVENT_MMOUSEUP then
    HUD.Moving = false
    elseif e.type == IEVENT_MOUSEWHEEL then
    if iskeypressed(0x12) then
    if e.value2 < 0 then
    HUD.strStart, HUD.strEnd = HUD.strStart - 1, HUD.strEnd - 1
    elseif e.value2 > 0 then
    HUD.strStart, HUD.strEnd = HUD.strStart + 1, HUD.End + 1
    end
    if HUD.strStart > HUD.strMax then
    HUD.strStart, HUD.strEnd = 1, 30
    end
    else
    if #LootMessages > Config.MaxLines then
    if e.value2 < 0 then
    if HUD.Start <= #LootMessages - Config.MaxLines then
    HUD.Start, HUD.End = HUD.Start + 1, HUD.End + 1
    end
    elseif e.value2 > 0 then
    if HUD.End > Config.MaxLines then
    HUD.Start, HUD.End = HUD.Start - 1, HUD.End - 1
    end
    end
    end
    end
    elseif e.type == IEVENT_LMOUSEUP then
    if e.elementid == HUD.Restart then
    LootMessages = {}
    end
    end
    end

    local function displaytext(text, x, y, c)
    addgradcolors(unpack(c))
    local w, h = measurestring(text)
    HUD.ColumnWidth[1], HUD.ColumnWidth[2] = math.max(HUD.ColumnWidth[1], w or 0), math.max(HUD.ColumnWidth[2], h or 0)
    local t = drawroundrect(x, y, HUD.ColumnWidth[1] + 7, HUD.ColumnWidth[2], 2, 2)
    drawtext(text, x + 2, y + math.floor(HUD.ColumnWidth[2] / 4) - 2.4)
    return t
    end

    init end

    if HUD.Moving then
    auto(10)
    HUD.Position = {$cursor.x - HUD.Auxiliar[1], $cursor.y - HUD.Auxiliar[2]}
    $chardb:setvalue('AWE.RL', 'POSITION', table.concat(HUD.Position, ':'))
    end

    foreach newmessage m do
    if m.type == MSG_INFO then
    local Monster, Loot = m.content:match('Loot of a?n? (.+): (.+)')

    if Monster and (Loot ~= 'nothing' or Config.ShowNothing) then
    local tempLoot = Loot:lower()

    if HUD.End + #LootMessages >= Config.MaxLines * 2 then
    HUD.Start, HUD.End = HUD.Start + 1, HUD.End + 1
    end

    Monster = Monster:gsub('the ', '', 1)

    local Warn = false

    for _, Item in pairs(Config.Items) do
    if tempLoot:find(Item) then
    Warn = true
    break
    end
    end

    table.insert(LootMessages, {text = string.format("%s %s: %s", os.date("%H:%M"), Monster:gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), Loot), color = Warn and HUD.Orange or HUD.Black})
    end
    end
    end

    local x, y, w, h = 0, 0, 0, 0

    displaytext(" Recent Loots:", x, y, HUD.Blue)
    addgradcolors(unpack(#LootMessages > 0 and HUD.Green or HUD.Red))

    w, h = measurestring("RESET")
    HUD.ColumnWidth[1] = math.max(HUD.ColumnWidth[1], w)
    HUD.Restart = drawroundrect(x - w + HUD.ColumnWidth[1], y, w + 7, h, 2, 2)

    drawtext("RESET", 5 + x - w + HUD.ColumnWidth[1], y + math.floor(h / 4) - 2.4)

    y = y + 20

    for i = HUD.Start, HUD.End do
    if LootMessages[i] then
    local msg = LootMessages[i].text
    local h, j = math.max(1, HUD.strStart), math.max(msg:len(), HUD.strEnd)
    HUD.strMax = math.max(HUD.strMax, msg:len())
    if h == 2 then
    msg = "." .. msg:sub(h, j)
    elseif h == 3 then
    msg = ".." .. msg:sub(h, j)
    elseif h >= 4 then
    msg = "..." .. msg:sub(h, j)
    else
    msg = msg:sub(h, j)
    end
    displaytext(msg:fit(Config.Length or 60), x, y, LootMessages[i].color)

    y = y + 16
    end
    end

    setposition(unpack(HUD.Position))

    Download
    Last edited by Leonardo; 03-16-2015 at 05:58 PM.

  2. #2
    Free User
    Join Date
    Dec 2013
    Posts
    5
    Reputation
    10
    Rep Power
    0
    Description

    It'll show all the private messages sent and received on your screen.

    typo? i think you meant that to this link http://forums.tibiawindbot.com/showt...ivate-Messages

  3. #3
    Free User
    Join Date
    Dec 2013
    Posts
    5
    Reputation
    10
    Rep Power
    0
    02:54:16 error in HUD script AweRecentLoot:
    ["Position = {$worldwin.right + 3, $wor..."]:AweRecentLoot:21 attempt to perform arithmetic on field 'MaxLines' (a nil value)

    @Leonardo

  4. #4
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by strike View Post
    02:54:16 error in HUD script AweRecentLoot:
    ["Position = {$worldwin.right + 3, $wor..."]:AweRecentLoot:21 attempt to perform arithmetic on field 'MaxLines' (a nil value)

    @Leonardo
    Ye the description was wrong, I've edited everything, and fixed that MaxLines problem, just download again.

  5. #5
    Free User
    Join Date
    Aug 2014
    Posts
    3
    Reputation
    10
    Rep Power
    0
    Hello I need this Recent Loot but only to one monster. For example I killed: Orc, Troll, Minotaur. I need only Minotaur Loot's on HUD.

  6. #6
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by shnelock View Post
    Hello I need this Recent Loot but only to one monster. For example I killed: Orc, Troll, Minotaur. I need only Minotaur Loot's on HUD.
    It's based on the items not the monsters, so on the items list to highlight put minotaur items.

  7. #7
    Free User iagobrunogurgel's Avatar
    Join Date
    Aug 2014
    Posts
    64
    Reputation
    10
    Rep Power
    20
    Nice bro!


  8. #8
    Free User
    Join Date
    Oct 2014
    Posts
    1
    Reputation
    10
    Rep Power
    0
    where I get to appear for only the items you want ??

  9. #9
    Free User
    Join Date
    Nov 2014
    Posts
    5
    Reputation
    10
    Rep Power
    0
    Can you adapt to be a loot counter ?

  10. #10
    Free User
    Join Date
    Jan 2015
    Posts
    11
    Reputation
    10
    Rep Power
    0
    @Leonardo
    Is there any possibility to inserting Items to display from looting list? If u are exping at some differents places with many mobs it would take too much time to fill it?
    Thanks in advance

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •