Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HUD = {
- TITLE = "General Info by Pink Panther",
- CONFIG = {
- ORIENTATION = "Right",
- START_POSITION = {15, 25},
- MAX_TEXT_LENGTH = 15,
- TEXT_DISTANCE = 115,
- LINE_DISTANCE = 15,
- },
- --[[ Just edit below if you know what you're doing --]]
- COLORS = {
- SHADOW = rgbcolor(10, 10, 10),
- TITLE = rgbcolor(255, 165, 0),
- TEXT1 = rgbcolor(205, 200, 177),
- TEXT2 = rgbcolor(255, 255, 255),
- SUBTITLE = rgbcolor(30, 144, 255),
- ENABLED = rgbcolor(107, 142, 35),
- DISABLED = rgbcolor(178, 34, 34),
- },
- INFO = {
- {NAME = "Level:", VALUE = levelValue, ENABLED = true},
- {NAME = "Hunt Time:", VALUE = timehunt, ENABLED = true},
- {NAME = "Exp Per Hour:", VALUE = exphourValue, ENABLED = true},
- {NAME = "Exp Gained:", VALUE = expgainedValue, ENABLED = true},
- {NAME = "Exp to Level:", VALUE = exptolevelValue, ENABLED = true},
- {NAME = "Time to Level:", VALUE = ttlValue, ENABLED = true},
- {NAME = "Stamina:", VALUE = stamValue, ENABLED = true},
- {NAME = "Balance:", VALUE = balanceValue, ENABLED = true},
- {NAME = "Cavebot:", VALUE = isCavebot, ENABLED = true},
- {NAME = "Looting:", VALUE = isLooting, ENABLED = true},
- {NAME = "Targeting:", VALUE = isTargeting, ENABLED = true},
- {NAME = "Pos X:", VALUE = posxValue, ENABLED = true},
- {NAME = "Pos Y:", VALUE = posyValue, ENABLED = true},
- {NAME = "Pos Z:", VALUE = poszValue, ENABLED = true},
- {NAME = "Mouse Item ID:", VALUE = cursoridValue, ENABLED = true},
- },
- KILLCOUNTER = {
- ENABLED = true,
- MONSTERS = {
- {NAME = "frost dragon", VALUE = 0},
- {NAME = "frost dragon hatchling", VALUE = 0},
- },
- TOTALKILLED = 0,
- HIGHESTHIT = 0,
- }
- }
- --[[ DONT EDIT NOTHING BELOW THIS LINE --]]
- function comma_value(amount)
- local formatted = amount
- while true do
- formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
- if (k==0) then
- break
- end
- end
- return formatted
- end
- function round(val, decimal)
- if (decimal) then
- return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
- else
- return math.floor(val+0.5)
- end
- end
- function format_num(amount, decimal, prefix, neg_prefix)
- local str_amount, formatted, famount, remain
- decimal = decimal or 2 -- default 2 decimal places
- neg_prefix = neg_prefix or "-" -- default negative sign
- famount = math.abs(round(amount,decimal))
- famount = math.floor(famount)
- remain = round(math.abs(amount) - famount, decimal)
- -- comma to separate the thousands
- formatted = comma_value(famount)
- -- attach the decimal portion
- if (decimal > 0) then
- remain = string.sub(tostring(remain),3)
- formatted = formatted .. "." .. remain ..
- string.rep("0", decimal - string.len(remain))
- end
- return formatted
- end
- levelValue = level
- exphourValue = comma_value(exphour)
- expgainedValue = comma_value(expgained)
- exptolevelValue = comma_value(exptolevel())
- ttlValue = format_num((exptolevel()/exphour)).." Hours"
- stamValue = format_num((math.floor(stamina/60))).." Hours"
- balanceValue = comma_value(balance)
- posxValue = comma_value(posx)
- posyValue = comma_value(posy)
- poszValue = posz
- cursoridValue = comma_value(cursorinfo().id)
- isCavebot = getsettings("Settings\\CaveBot\\Enabled")
- isLooting = getsettings("Settings\\Looting\\Enabled")
- isTargeting = getsettings("Settings\\Targeting\\Enabled")
- local X, Y = (HUD.CONFIG.ORIENTATION:lower() == "right" and worldwin.right + 10 or clientwin.left + 10) + HUD.CONFIG.START_POSITION[1], worldwin.top + 10 + HUD.CONFIG.START_POSITION[2]
- setfontcolor(HUD.COLORS.TITLE)
- addtextstroke(HUD.TITLE, X, Y)
- local Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
- setfontcolor(HUD.COLORS.SUBTITLE)
- addtextstroke("GENERAL INFO", X, Y)
- local Y = Y + HUD.CONFIG.LINE_DISTANCE
- for i = 1,#HUD.INFO do
- if HUD.INFO[i].ENABLED then
- setfontcolor(HUD.COLORS.TEXT1)
- addtextstroke(HUD.INFO[i].NAME, X, Y)
- if HUD.INFO[i].VALUE == "yes" then
- setfontcolor(HUD.COLORS.ENABLED)
- elseif HUD.INFO[i].VALUE == "no" then
- setfontcolor(HUD.COLORS.DISABLED)
- else
- setfontcolor(HUD.COLORS.TEXT2)
- end
- addtextstroke(HUD.INFO[i].VALUE, X + HUD.CONFIG.TEXT_DISTANCE, Y)
- Y = Y + HUD.CONFIG.LINE_DISTANCE
- end
- end
- local getMessages = getmessages("Server Log")
- local countMessages = getMessages.count - 1
- for i = 0, countMessages do
- if (getMessages[countMessages - i].text:find("Loot of a") and getMessages[countMessages - i].type == 20) then
- for _, MONSTER in ipairs(HUD.KILLCOUNTER.MONSTERS) do
- if (getMessages[countMessages - i].text:find("Loot of a ".. MONSTER.NAME:lower() ..":")) or (getMessages[countMessages - i].text:find("Loot of an ".. MONSTER.NAME:lower() ..":")) then
- MONSTER.VALUE = MONSTER.VALUE + 1
- HUD.KILLCOUNTER.TOTALKILLED = HUD.KILLCOUNTER.TOTALKILLED + 1
- end
- end
- elseif getMessages[countMessages - i].text:find(" hitpoints due to your attack.") then
- for h in string.gmatch(getMessages[countMessages - i].text, "(%d+)( hitpoints due to your attack.)$") do
- if tonumber(h) > tonumber(HIGHESTHIT) then
- HIGHESTHIT = tonumber(h)
- end
- end
- end
- end
- if HUD.KILLCOUNTER.ENABLED then
- Y = Y + 25
- setfontcolor(HUD.COLORS.SUBTITLE)
- addtextstroke("KILL COUNTER:", X, Y)
- for _, m in ipairs(HUD.KILLCOUNTER.MONSTERS) do
- if m.VALUE > 0 then
- Y = Y + HUD.CONFIG.LINE_DISTANCE
- setfontcolor(HUD.COLORS.TEXT1)
- addtextstroke((#m.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and m.NAME or m.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)
- setfontcolor(HUD.COLORS.TEXT2)
- addtextstroke(m.VALUE, X + HUD.CONFIG.TEXT_DISTANCE, Y)
- end
- end
- if HUD.KILLCOUNTER.TOTALKILLED > 0 then
- Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
- setfontcolor(HUD.COLORS.TEXT2)
- addtextstroke("Kills Total: ", X, Y)
- setfontcolor(HUD.COLORS.TITLE)
- addtextstroke(HUD.KILLCOUNTER.TOTALKILLED, X + HUD.CONFIG.TEXT_DISTANCE, Y)
- Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
- setfontcolor(HUD.COLORS.TEXT2)
- addtextstroke("Kills Per Hour: ", X, Y)
- setfontcolor(HUD.COLORS.TITLE)
- addtextstroke(math.floor(HUD.KILLCOUNTER.TOTALKILLED/(tosec(timehunt)/60/60)), X + HUD.CONFIG.TEXT_DISTANCE, Y)
- end
- Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
- setfontcolor(HUD.COLORS.TEXT2)
- addtextstroke("Highest Damage: ", X, Y)
- setfontcolor(HUD.COLORS.TITLE)
- addtextstroke(HIGHESTHIT, X + HUD.CONFIG.TEXT_DISTANCE, Y)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement