Advertisement
Darkstarr

ibotlootcountercustomcolours

Jun 24th, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. --[[
  2.  
  3. ( @ "
  4. ‘® ® ®!
  5. ®® *®$ ®®,
  6. =®® W®® ®®5
  7. M®®¦ ®®®. .®®®
  8. ®®®® C®®®@ W®®®
  9. J®®®A M®®®® ¦®®®Ð
  10. ®®®®7 . ®®®®®.‘ ‘®®®®
  11. J®®®®M ®®® ®®®®®!M®® $®®W®Ð
  12. @®MW®®* M®®®®(!®®®J‘®®®®® ®®®5®®
  13. Ю®7®®®C .M®®®®®®®$=3®®®®®®®® *®®®#W®®
  14. 3®®,@®®®®‘M®=®®®®®®®®®®®®®®®®®®®®®.®®.®®®®® ®®Ð
  15. ®®®* ®® ®.®(®®®®®®®®®®®®®®®®®®®®®#A ® ®®. ®®®
  16. .®®®M $W ,®®®®®®®®®M...$®®®®®®®®® %M Ю®®¦
  17. ®®®®AM(, ®®®®®®®®® W®®®®®®®®¦= ®¦®®®®
  18. 3®MÐAM$®®=(®®®®# 7®®®®3.®®MJ!®3®@
  19. .®3W®®®.‘ Ю® ®®M (@®®®,®=
  20. .=®®®®.®®W @®® ®®®®‘!
  21. ®®®®M.®®®®®WÐЮ®®®®!$®®®®
  22. ®®®®®@ ,®®®®®®®®®¦ A®®®®®
  23. ®®®®®®®®®" !¦( .®®®®®®®®®
  24. ®®®®®®®®®®® M®®®®®®®®®®,
  25. ®®®®®®®®®® ®®®®®®®®®®‘
  26. ¦®®®®®®®® ®®®®®®®®3
  27. Ю®®®®®‘ ®®®®®®®
  28. ®®®®®¦ .®®®®®.
  29. #®®®$ *®®®®
  30. ®®W $®®
  31. "® @7
  32. ]]--
  33.  
  34. HUD = {
  35.  
  36. TITLE = "iBot Loot Counter",
  37.  
  38. CONFIG = {
  39. ORIENTATION = "right",
  40. START_POSITION = {35, 25},
  41. MAX_TEXT_LENGTH = 15,
  42. TEXT_DISTANCE = 115,
  43. LINE_DISTANCE = 12,
  44. },
  45.  
  46. ITEMS =
  47. {
  48. LOOT = getlootitems(),
  49.  
  50. SUPPLY =
  51. {
  52. {NAME = "mana potion", VALUE = 50},
  53. {NAME = "strong mana potion", VALUE = 80},
  54. {NAME = "great mana potion", VALUE = 120},
  55. {NAME = "health potion", VALUE = 45},
  56. {NAME = "strong health potion", VALUE = 100},
  57. {NAME = "great health potion", VALUE = 190},
  58. {NAME = "ultimate health potion", VALUE = 310},
  59. {NAME = "Assassin Star", VALUE = 100},
  60. {NAME = "prismatic bolt", VALUE = 20},
  61. {NAME = "crystalline arrow", VALUE = 20},
  62. {NAME = "great fireball rune", VALUE = 45},
  63. {NAME = "sudden death rune", VALUE = 108},
  64. {NAME = "avalanche rune", VALUE = 45},
  65. {NAME = "icicle rune", VALUE = 30},
  66. {NAME = "fireball rune", VALUE = 30},
  67. {NAME = "thunderstorm rune", VALUE = 37},
  68. {NAME = "Soft Boots", VALUE = 10000},
  69. {NAME = "Rust Remover", VALUE = 50}
  70. }
  71. },
  72.  
  73. --[[ Just edit below if you know what you're doing --]]
  74.  
  75. COLORS = {
  76. SHADOW = rgbcolor(10, 10, 10),
  77. TITLE = rgbcolor(255,69,0),
  78. TEXT1 = rgbcolor(255,165,0),
  79. TEXT2 = rgbcolor(131,139,139),
  80. SUBTITLE = rgbcolor(255,69,0),
  81. PROFIT = rgbcolor(107, 142, 35),
  82. WASTE = rgbcolor(178, 34, 34),
  83. },
  84.  
  85. VERSION = "1.0"
  86. }
  87.  
  88. --[[ DONT EDIT NOTHING BELOW THIS LINE --]]
  89.  
  90. function formatnumber(n, s)
  91. local result, sign, before, after = '', string.match(tostring(n), '^([%+%-]?)(%d*)(%.?.*)$')
  92.  
  93. while #before > 3 do
  94. result = (s or '.') .. string.sub(before, -3, -1) .. result
  95. before = string.sub(before, 1, -4)
  96. end
  97.  
  98. return sign .. before .. result .. after
  99. end
  100.  
  101. local X, Y, INDEX, TOTAL, TOTAL_LOOTED, TOTAL_WASTED = (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], 1, 0, 0, 0
  102.  
  103. setfontcolor(HUD.COLORS.TITLE)
  104. addtextstroke(HUD.TITLE, X, Y)
  105.  
  106. Y = Y + 20
  107.  
  108. setfontcolor(HUD.COLORS.SUBTITLE)
  109. addtextstroke("ITEMS LOOTED:", X, Y)
  110.  
  111. Y = Y + 5
  112.  
  113. local lootqtd = HUD.ITEMS.LOOT.count-1
  114.  
  115. for it = 0, lootqtd do
  116. local ITEM = HUD.ITEMS.LOOT[it]
  117. if ITEM.lootmessage > 0 then
  118. Y = Y + HUD.CONFIG.LINE_DISTANCE
  119.  
  120. local itemvalue = ITEM.npcsell
  121. if ITEM.custom ~= 0 then
  122. itemvalue = ITEM.custom
  123. end
  124.  
  125. setfontcolor(HUD.COLORS.TEXT1)
  126. addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)
  127.  
  128. setfontcolor(HUD.COLORS.TEXT2)
  129. addtextstroke(string.format("%s (%s k)", formatnumber(ITEM.lootmessage), math.floor(ITEM.lootmessage * itemvalue / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)
  130.  
  131. TOTAL, TOTAL_LOOTED = TOTAL + ITEM.lootmessage * itemvalue, TOTAL_LOOTED + (ITEM.lootmessage * itemvalue)
  132. end
  133. end
  134.  
  135. Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
  136.  
  137. setfontcolor(HUD.COLORS.TEXT2)
  138. addtextstroke("Total: ", X, Y)
  139.  
  140. setfontcolor(HUD.COLORS.TITLE)
  141. addtextstroke(formatnumber(TOTAL_LOOTED) .. " GPs", X+35, Y)
  142.  
  143. Y = Y + 25
  144.  
  145. setfontcolor(HUD.COLORS.SUBTITLE)
  146. addtextstroke("SUPPLIES USED:", X, Y)
  147.  
  148. Y = Y + 5
  149.  
  150. for _, ITEM in ipairs(HUD.ITEMS.SUPPLY) do
  151. local ITEM_USED = itemproperty(ITEM.NAME)
  152. if ITEM_USED.usagemessage > 0 then
  153. Y = Y + HUD.CONFIG.LINE_DISTANCE
  154.  
  155. setfontcolor(HUD.COLORS.TEXT1)
  156. addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)
  157.  
  158. setfontcolor(HUD.COLORS.TEXT2)
  159. addtextstroke(string.format("%s (%sk)", formatnumber(ITEM_USED.usagemessage), math.floor(ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)) / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)
  160.  
  161. TOTAL, TOTAL_WASTED = TOTAL - ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)), TOTAL_WASTED + (ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)))
  162. end
  163. end
  164.  
  165. Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
  166.  
  167. setfontcolor(HUD.COLORS.TEXT2)
  168. addtextstroke("Total: ", X, Y)
  169.  
  170. setfontcolor(HUD.COLORS.TITLE)
  171. addtextstroke("-" .. formatnumber(TOTAL_WASTED) .. " GPs", X + 35, Y)
  172.  
  173. Y = Y + 25
  174.  
  175. setfontcolor(TOTAL_LOOTED - TOTAL_WASTED >= 0 and HUD.COLORS.PROFIT or HUD.COLORS.WASTE)
  176. addtextstroke(string.format("%s %s GPs (%s k/h)", TOTAL_LOOTED - TOTAL_WASTED >= 0 and "PROFIT:" or "WASTE:", formatnumber(TOTAL_LOOTED - TOTAL_WASTED), math.floor(((TOTAL_LOOTED - TOTAL_WASTED) / (tosec(timehunt) / 3600)) / 100) / 10), X, Y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement