Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CONFIG = {
- DRAW_TYPE = "border",
- ORIENTATION = "right",
- POSITION = {X = 8, Y = 12},
- MAX_TEXT_LENGTH = 17,
- TEXT_DISTANCE = 130,
- LINE_DISTANCE = 14,
- }
- HUD = {
- TITLE = "Awsome Loot Counter",
- ITEMS = {
- LOOT = {
- {NAME = "knight armor", VALUE = 5000},
- {NAME = "knight legs", VALUE = 5000},
- {NAME = "spider silk", VALUE = 5000},
- {NAME = "platinum amulet", VALUE = 2500},
- {NAME = "lightning headband", VALUE = 2500},
- {NAME = "two handed sword", VALUE = 450},
- {NAME = "steel helmet", VALUE = 293},
- {NAME = "plate legs", VALUE = 115},
- {NAME = "time ring", VALUE = 100},
- {NAME = "tarantula egg", VALUE = 80},
- {NAME = "spider fangs", VALUE = 10},
- {NAME = "gold coin", VALUE = 1},
- {NAME = "mercenary sword", VALUE = 12000},
- {NAME = "flask of warrior's sweat", VALUE = 10000},
- {NAME = "tower shield", VALUE = 8000},
- {NAME = "batwing hat", VALUE = 8000},
- {NAME = "crusader helmet", VALUE = 6000},
- {NAME = "angelic axe", VALUE = 5000},
- {NAME = "spellbook of enlightenment", VALUE = 4000},
- {NAME = "glorious axe", VALUE = 3000},
- {NAME = "knight axe", VALUE = 2000},
- {NAME = "guardian shield", VALUE = 2000},
- {NAME = "bat wing", VALUE = 100},
- {NAME = "belted cape", VALUE = 500},
- {NAME = "mutated bat ear", VALUE = 420},
- {NAME = "sabretooth", VALUE = 400},
- {NAME = "black pearl", VALUE = 280},
- {NAME = "stealth ring", VALUE = 200},
- {NAME = "energy ring", VALUE = 200},
- {NAME = "small amethyst", VALUE = 200},
- {NAME = "broken gladiator shield", VALUE = 190},
- {NAME = "mutated rat tail", VALUE = 150},
- {NAME = "strong health potion", VALUE = 100},
- {NAME = "striped fur", VALUE = 50},
- {NAME = "health potion", VALUE = 45},
- {NAME = "green mushroom", VALUE = 0},
- {NAME = "plate armor", VALUE = 400},
- {NAME = "obsidian lance", VALUE = 500},
- {NAME = "halberd", VALUE = 400},
- {NAME = "beastslayer axe", VALUE = 1500},
- {NAME = "red piece of cloth", VALUE = 20000},
- {NAME = "fur boots", VALUE = 2000},
- {NAME = "shard", VALUE = 2000},
- {NAME = "two handed sword", VALUE = 450},
- {NAME = "spool of yarn", VALUE = 50000},
- {NAME = "sweet smelling bait", VALUE = 100000},
- },
- SUPPLY = {
- {NAME = "Mana Potion", VALUE = 50},
- {NAME = "Strong Mana Potion", VALUE = 80},
- {NAME = "Great Health Potion", VALUE = 190},
- }
- },
- COLORS = {SHADOW = -16119286, TITLE = -1128192, TEXT1 = -1, TEXT2 = -2968436, SUBTITLE = -33024, PROFIT = -9320847, WASTE = -3342336},
- VERSION = "1.1"
- }
- --[[ DONT EDIT NOTHING BELOW THIS LINE --]]
- function formatnumber(n, s)
- local result, sign, before, after = '', string.match(tostring(n), '^([%+%-]?)(%d*)(%.?.*)$')
- while #before > 3 do
- result = (s or '.') .. string.sub(before, -3, -1) .. result
- before = string.sub(before, 1, -4)
- end
- return sign .. before .. result .. after
- end
- function addcustomtext(TEXT, X, Y, COLOR)
- setfontcolor(rgbcolor(10, 10, 10))
- if CONFIG.DRAW_TYPE:upper() == "SHADOW" then
- addtext(TEXT, X + 1, Y + 1)
- elseif CONFIG.DRAW_TYPE:upper() == "BORDER" then
- addtext(TEXT, X + 1, Y + 1)
- addtext(TEXT, X - 1, Y - 1)
- addtext(TEXT, X - 1, Y + 1)
- addtext(TEXT, X + 1, Y - 1)
- addtext(TEXT, X, Y + 1)
- addtext(TEXT, X, Y - 1)
- addtext(TEXT, X + 1, Y)
- addtext(TEXT, X - 1, Y)
- end
- setfontcolor(COLOR)
- return addtext(TEXT, X, Y)
- end
- local X, Y, INDEX, TOTAL, TOTAL_LOOTED, TOTAL_WASTED = (CONFIG.ORIENTATION:lower() == "right" and worldwin.right + 10
- or clientwin.left + 10) + CONFIG.POSITION.X, worldwin.top + 20 + CONFIG.POSITION.Y, 1, 0, 0, 0
- addcustomtext(HUD.TITLE, X, Y, HUD.COLORS.TITLE)
- Y = Y + 20
- addcustomtext("ITEMS LOOTED:", X, Y, HUD.COLORS.SUBTITLE)
- Y = Y + 5
- for _, ITEM in ipairs(HUD.ITEMS.LOOT) do
- local ITEM_LOOTED = getitems(itemid(ITEM.NAME))
- if ITEM_LOOTED[ITEM_LOOTED.count - 1].loot > 0 then
- Y = Y + CONFIG.LINE_DISTANCE
- addcustomtext((#ITEM.NAME < CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1,
- CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y,
- HUD.COLORS.TEXT1)
- addcustomtext(string.format("%s (%sk)", formatnumber(ITEM_LOOTED[0].loot), math.floor(ITEM_LOOTED[0].loot *
- (ITEM.VALUE or itemvalue(ITEM.NAME)) / 100) / 10), X + CONFIG.TEXT_DISTANCE, Y, HUD.COLORS.TEXT2)
- TOTAL, TOTAL_LOOTED = TOTAL + ITEM_LOOTED[0].loot * (ITEM.VALUE or itemvalue(ITEM.NAME)), TOTAL_LOOTED +
- (ITEM_LOOTED[0].loot * (ITEM.VALUE or itemvalue(ITEM.NAME)))
- end
- end
- Y = Y + 20
- addcustomtext("Total: ", X, Y, HUD.COLORS.TEXT2)
- addcustomtext(formatnumber(TOTAL_LOOTED) .. " GPs", X + CONFIG.TEXT_DISTANCE, Y, HUD.COLORS.TITLE)
- Y = Y + 25
- addcustomtext("ITEMS USED:", X, Y, HUD.COLORS.SUBTITLE)
- Y = Y + 5
- for _, ITEM in ipairs(HUD.ITEMS.SUPPLY) do
- local ITEM_USED = getitems(itemid(ITEM.NAME))
- if ITEM_USED[ITEM_USED.count - 1].usage > 0 then
- Y = Y + CONFIG.LINE_DISTANCE
- addcustomtext((#ITEM.NAME < CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y,
- HUD.COLORS.TEXT1)
- addcustomtext(string.format("%s (%sk)", formatnumber(ITEM_USED[0].usage), math.floor(ITEM_USED[0].usage *
- (ITEM.VALUE or itemvalue(ITEM.NAME)) / 100) / 10), X + CONFIG.TEXT_DISTANCE, Y, HUD.COLORS.TEXT2)
- TOTAL, TOTAL_WASTED = TOTAL - ITEM_USED[0].usage * (ITEM.VALUE or itemvalue(ITEM.NAME)), TOTAL_WASTED +
- (ITEM_USED[0].usage * (ITEM.VALUE or itemvalue(ITEM.NAME)))
- end
- end
- Y = Y + 20
- addcustomtext("Total: ", X, Y, HUD.COLORS.TEXT2)
- addcustomtext("-" .. formatnumber(TOTAL_WASTED) .. " GPs", X + CONFIG.TEXT_DISTANCE, Y, HUD.COLORS.TITLE)
- Y = Y + 25
- addcustomtext(TOTAL_LOOTED - TOTAL_WASTED >= 0 and "Profit:" or "Waste:", X, Y, TOTAL_LOOTED - TOTAL_WASTED >= 0
- and HUD.COLORS.PROFIT or HUD.COLORS.WASTE)
- addcustomtext(string.format("%s GPs (%s k/h)", formatnumber(TOTAL_LOOTED - TOTAL_WASTED), math.floor(((TOTAL_LOOTED -
- TOTAL_WASTED) / (tosec(timehunt) / 3600)) / 100) / 10), X + CONFIG.TEXT_DISTANCE, Y, TOTAL_LOOTED - TOTAL_WASTED
- >= 0 and HUD.COLORS.PROFIT or HUD.COLORS.WASTE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement