Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19

    Post [HUD] Max hit on me counter.

    Hello, how can you turn this script into one showing me whats the highest hit dealt on me, and due to whom.
    The script is a total copy of one regaring a max hit counter.
    Code:
    init start
    		local BEST_HIT = {
    			POSITION = {$clientwin.left + 10, $worldwin.top - 55},
    		-- do not edit below
    			BEST = 0,
    			CREATURE = ""
    		}
    
    		BEST_HIT_FONT = {}
    		BEST_HIT_FONT.DISTANCE = 140
    		BEST_HIT_FONT.COLOR = color(255, 255, 255, 0)
    		BEST_HIT_FONT.WARNING_COLOR = color(243, 47, 47, 25)
    
    		setmaskcolorxp(0)
    		setfontstyle('Tahoma', 8, 85, BEST_HIT_FONT.COLOR, 1, color(0, 0, 0, 20))
    init end
    
    foreach newmessage m do
    	if m.type == MSG_STATUSLOG then
    		local messageDealt = {m.content:match(REGEX_DMG_DEALT)}
    		if unpack(messageDealt) then
    			if tonumber(messageDealt[2]) > BEST_HIT.BEST then
    				BEST_HIT.BEST = tonumber(messageDealt[2])
    				BEST_HIT.CREATURE = messageDealt[1]
    			end
    		end
    	end
    end
    
    setposition($clientwin.left + BEST_HIT.POSITION[1], $clientwin.top - BEST_HIT.POSITION[2])
    setfontcolor(BEST_HIT_FONT.COLOR)
    drawtext('Best hit: ')
    
    if BEST_HIT.BEST == 0 then
    	drawtext('Best hit: -')
    else
    	setfontcolor(BEST_HIT_FONT.white)
    	drawtext(BEST_HIT.BEST .. ' to ' .. string.capitalizeall(BEST_HIT.CREATURE), BEST_HIT.POSITION[1] + 37)
    end

  2. #2
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by popolord View Post
    Hello, how can you turn this script into one showing me whats the highest hit dealt on me, and due to whom.
    The script is a total copy of one regaring a max hit counter.
    Code:
    init start
            local BEST_HIT = {
                POSITION = {$clientwin.left + 10, $worldwin.top - 55},
            -- do not edit below
                BEST = 0,
                CREATURE = ""
            }
    
            BEST_HIT_FONT = {}
            BEST_HIT_FONT.DISTANCE = 140
            BEST_HIT_FONT.COLOR = color(255, 255, 255, 0)
            BEST_HIT_FONT.WARNING_COLOR = color(243, 47, 47, 25)
    
            setmaskcolorxp(0)
            setfontstyle('Tahoma', 8, 85, BEST_HIT_FONT.COLOR, 1, color(0, 0, 0, 20))
    init end
    
    foreach newmessage m do
        if m.type == MSG_STATUSLOG then
            local messageDealt = {m.content:match(REGEX_DMG_DEALT)}
            if unpack(messageDealt) then
                if tonumber(messageDealt[2]) > BEST_HIT.BEST then
                    BEST_HIT.BEST = tonumber(messageDealt[2])
                    BEST_HIT.CREATURE = messageDealt[1]
                end
            end
        end
    end
    
    setposition($clientwin.left + BEST_HIT.POSITION[1], $clientwin.top - BEST_HIT.POSITION[2])
    setfontcolor(BEST_HIT_FONT.COLOR)
    drawtext('Best hit: ')
    
    if BEST_HIT.BEST == 0 then
        drawtext('Best hit: -')
    else
        setfontcolor(BEST_HIT_FONT.white)
        drawtext(BEST_HIT.BEST .. ' to ' .. string.capitalizeall(BEST_HIT.CREATURE), BEST_HIT.POSITION[1] + 37)
    end
    i will look on it since it's my code :P

  3. #3
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19
    thank you very mucho

  4. #4
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19
    up

  5. #5
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    @popolord

    im so suck at huds but i've found free time today and did some extra shit.


    init start
    local BestHit = {


    Position = {300, 10},
    CharName = function() return $name end,


    -- do not edit below :)
    Best = 0,
    Taken = 0,
    Creature = "",
    Attacker = ""
    }


    local showTimers = true -- will show time from last best damages
    local showLast = true -- if true then it will show timer of last any damage, otherwise it will show time of best given/taken


    local lastTaken, lastDealt = $timems, $timems


    local Timer = {
    Dealt = function() return timeshort($timems - lastDealt) end,
    Taken = function() return timeshort($timems - lastTaken) end
    }

    filterinput(false, true, false, false)


    local Colors = {
    -- fonts:


    HeaderName = color(224, 242, 255, 0),
    BestHitFontColor = color(255, 255, 255, 0),
    BestHitWarningColor = color(255, 107, 97, 25),
    BestHitTimerColor = color(238, 242, 116, 10),


    -- shapes:
    HeaderBackground = {0.0, color(213, 77, 171, 21), 0.23, color(188, 37, 137, 17), 0.76, color(110, 28, 85, 21)},
    EntryNameBackground = {0.0, color(92, 93, 94, 20), 0.23, color(70, 73, 75, 20), 0.76, color(60, 64, 65, 20)},
    EntryValueBackground = {0.0, color(135, 150, 255, 20), 0.23,color(98, 115, 230, 15), 0.76, color(83, 110, 180, 25)},
    EntryValueLast = {0.0, color(62, 72, 137, 20), 0.23, color(47, 55, 103, 20), 0.76, color(33, 37, 71, 20)},


    }




    local Moving, Temp, Moved = false, {0, 0}, {0, 0}


    function inputevents(e)
    if (e.type == IEVENT_MMOUSEDOWN) then
    Moving, Temp = true, {$cursor.x - Moved[1], $cursor.y - Moved[2]}
    end


    if (e.type == IEVENT_MMOUSEUP) then
    Moving = false
    end
    end


    setmaskcolorxp(0)
    setfontstyle('Tahoma', 8, 85, Colors.BestHitFontColor, 1, color(0, 0, 0, 20))
    init end


    if (Moving) then
    auto(10)
    Moved = {$cursor.x - Temp[1], $cursor.y - Temp[2]}
    end


    setposition($clientwin.left + BestHit.Position[1] + Moved[1], $clientwin.top + BestHit.Position[2] +Moved[2])


    foreach newmessage m do
    if m.type == MSG_STATUSLOG then
    local creatureName, damageDealt = m.content:match(REGEX_DMG_DEALT)
    local damageTaken, _, creName = m.content:match(REGEX_DMG_TAKEN)


    if damageDealt then
    if showLast then
    lastDealt = $timems
    end
    if tonumber(damageDealt) > BestHit.Best then
    BestHit.Best = tonumber(damageDealt)
    BestHit.Creature = creatureName
    lastDealt = $timems
    end
    elseif damageTaken then
    if showLast then
    lastTaken = $timems
    end
    if tonumber(damageTaken) > BestHit.Taken then
    BestHit.Taken = tonumber(damageTaken)
    BestHit.Attacker = creName
    lastTaken = $timems
    end
    end
    end
    end


    setfontcolor(Colors.HeaderName)


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.EntryNameBackground))
    drawroundrect(0, BestHit.Position[2] - 5, 138, 21, 2, 2)
    drawtext(BestHit.CharName(), 5, BestHit.Position[2])


    drawroundrect(141, BestHit.Position[2] - 5, 138, 21, 2, 2)
    drawtext('Stats: ', 147, BestHit.Position[2])
    drawroundrect(282, BestHit.Position[2] - 5, 50, 21, 2, 2)
    drawtext('When: ', 287, BestHit.Position[2])




    setfontcolor(Colors.HeaderMain)


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.HeaderBackground))
    drawroundrect(0, BestHit.Position[2] + 20, 138, 16, 2, 2)
    drawtext('Best hit already: ', 5, BestHit.Position[2] + 22)


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.EntryValueBackground))
    drawroundrect(141, BestHit.Position[2] + 20, 138, 16, 2, 2)


    if BestHit.Best > 0 then
    local message = BestHit.Best .. ' to ' .. string.capitalizeall(BestHit.Creature)


    setfontcolor(Colors.BestHitWarningColor)
    drawtext(message, 145, BestHit.Position[2] + 22)
    end


    setfontcolor(Colors.BestHitFontColor)


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.HeaderBackground))
    drawroundrect(0, BestHit.Position[2] + 40, 138, 16, 2, 2)
    drawtext('Highest damage taken: ', 5, BestHit.Position[2] + 42)


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.EntryValueBackground))
    drawroundrect(141, BestHit.Position[2] + 40, 138, 16, 2, 2)




    if BestHit.Taken > 0 then
    local message = BestHit.Taken .. ' from ' .. string.capitalizeall(BestHit.Attacker)


    setfontcolor(Colors.BestHitWarningColor)
    drawtext(message, 145, BestHit.Position[2] + 42)
    end




    if showTimers then
    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.EntryValueLast))
    drawroundrect(282, BestHit.Position[2] + 20, 50, 16, 2, 2)


    if BestHit.Best ~= 0 then
    setfontcolor(Colors.BestHitTimerColor)
    drawtext(Timer.Dealt(), 285, BestHit.Position[2] + 22)
    end


    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 22)
    addgradcolors(unpack(Colors.EntryValueLast))
    drawroundrect(282, BestHit.Position[2] + 40, 50, 16, 2, 2)


    if BestHit.Taken ~= 0 then
    setfontcolor(Colors.BestHitTimerColor)
    drawtext(Timer.Taken(), 285, BestHit.Position[2] + 42)
    end
    end
    Last edited by mistgun; 03-17-2015 at 01:12 PM.

  6. #6
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19
    thats was insane, i cannot find a proper way to thank you, id buy you a sandwich lmao, but i cannot.
    thank you very much

  7. #7
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19
    im sorry, but on the best hit already,
    omg im such an asker
    instead of the best hit already>"when:" can it show how much time has gone since the LAST bloodhit?, not since the last max hit
    i love you

    ps:i love you

    ps2: thanks alot

  8. #8
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by popolord View Post
    im sorry, but on the best hit already,
    omg im such an asker
    instead of the best hit already>"when:" can it show how much time has gone since the LAST bloodhit?, not since the last max hit
    i love you

    ps:i love you

    ps2: thanks alot
    @popolord
    done!
    btw.beer would be enough

  9. #9
    Free User popolord's Avatar
    Join Date
    Mar 2015
    Location
    Iquique, Chile
    Posts
    62
    Reputation
    21
    Rep Power
    19
    omfg thanks mate, ur the man

  10. #10
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    @mistgun That's baaaaaaaaaaaaaaaaaaaad code.

 

 

Posting Permissions

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