Signup Now
Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21

    Hud showing different colors of loot depending of their price

    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)


  2. #2
    Free User
    Join Date
    Oct 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    not really usefull? man this is amazing, thank you so much!

  3. #3
    Free User sylomex's Avatar
    Join Date
    Dec 2013
    Location
    France
    Posts
    369
    Reputation
    39
    Rep Power
    21
    Quote Originally Posted by Pitoquinha View Post
    not really usefull? man this is amazing, thank you so much!
    haha thanks dude i thought everybody will find that useless as hell ^^

  4. #4
    Free User
    Join Date
    Oct 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by sylomex View Post
    haha thanks dude i thought everybody will find that useless as hell ^^
    @sylomex
    Dude, i was checking and there is this function iteminfo('wand of inferno').sellPrice (for example) that returns the selling price of the item (based on the items.xml inside "tibiadata" folder) .. how hard would it be to implement this scripts in a way that it would check the price of each dropped item from loot message, and automatically decide if it is a green warning (price, lets say, from 2k to 19,999k) or a red warning (from 20k up)?

    that would be amazing.. maybe @Leonardo could give us some hand ..

    i would implement that myself, but I suck @ regular expressions, i have no idea how to store only the name of the itens on an array to check those with iteminfo()
    now its up to you guys, regex masters, ahah

    cant wait!!
    Last edited by Pitoquinha; 02-27-2015 at 03:57 PM.

  5. #5
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Totally possible, but I just had another idea:

    Depending on the value the message would be displayed from a gradient color from green to red (like a heatmap), being green a low loot value and red the maximum so far, what do you think ?

  6. #6
    Free User
    Join Date
    Oct 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Leonardo View Post
    Totally possible, but I just had another idea:

    Depending on the value the message would be displayed from a gradient color from green to red (like a heatmap), being green a low loot value and red the maximum so far, what do you think ?
    @Leonardo oh man, can you do such a thing?
    if yes, allow me to pay you a beer .. i would definitelly donate a couple dollars to thank you..

    it would be like

    warnMin = 2000 (2k)
    warnMax = 20000 (20k)

    anything below Min, would come up was white regular message ..
    anything between Min and Max (inclusive) would come up on color (gradient) from solid green (2k) to solid red (20k)
    anything above Max would come up as solid red

  7. #7
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Pitoquinha View Post
    @Leonardo oh man, can you do such a thing?
    if yes, allow me to pay you a beer .. i would definitelly donate a couple dollars to thank you..

    it would be like

    warnMin = 2000 (2k)
    warnMax = 20000 (20k)

    anything below Min, would come up was white regular message ..
    anything between Min and Max (inclusive) would come up on color (gradient) from solid green (2k) to solid red (20k)
    anything above Max would come up as solid red
    Not exactly, the bot would choose the values for you, and mix many other colors.

  8. #8
    Free User
    Join Date
    Oct 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Leonardo View Post
    Not exactly, the bot would choose the values for you, and mix many other colors.
    @Leonardo i think it would be better if the bot would to do the gradiend thing only on drops between a pre determined min and max .. cuz it would suck to pay attention to some light greenish message just to figure out it was some shitty rod that dropped.
    For me it would fit perfectly if it could work like i said:

    - min and max that you could set on script
    - below Min .. no highlight at all .. just white regular message
    - between min and max, gradient from green to red ..
    - above max, red

    ofc those are just my 2 cents.. i really think that colorfull messages all around, even on cheaper drops, would confuse more than help ..

  9. #9
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Pitoquinha View Post
    @Leonardo i think it would be better if the bot would to do the gradiend thing only on drops between a pre determined min and max .. cuz it would suck to pay attention to some light greenish message just to figure out it was some shitty rod that dropped.
    For me it would fit perfectly if it could work like i said:

    - min and max that you could set on script
    - below Min .. no highlight at all .. just white regular message
    - between min and max, gradient from green to red ..
    - above max, red

    ofc those are just my 2 cents.. i really think that colorfull messages all around, even on cheaper drops, would confuse more than help ..
    Indeed you got a point, but leave the colors to me, I'll do something smart.

  10. #10
    Free User
    Join Date
    Oct 2014
    Posts
    29
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Leonardo View Post
    Indeed you got a point, but leave the colors to me, I'll do something smart.
    I am 100% sure you will and i cant wait for it to be ready.
    Thank you in advance .. and i really meant it when I said about the donation .. good jobs should be supported.

 

 

Posting Permissions

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