Mana Leech Analyser
Description
It helps people to track how much they're profiting using mana leech imbuement.
Configuration
Create one persistent hotkey and a HUD with these codes below.
You must edit table mp, it contains 3 vars:
- name - a mana potion for reference purposes.
- avg - how much does this potion heals approximately?
- get - bot will parse values lower than this, so if you usually heals 20-30 with mana leech imbuement, you should set something higher than 30.
Screenshots
http://i.imgur.com/8ZSUiCz.png
Code
Persistent Hotkey:
init start
-- SCRIPT VERSION: 1.0.2
local mp = {name = "strong mana potion", avg = 150, get = 50}
-- DO NOT CHANGE BELOW
local REGEX_MANA_GAINED = '^You gained (%d+) mana%.$'
manaLeechTotal = 0
aproxManas = 0
aproxCash = 0
init end
auto(200)
foreach newmessage m do
if m.type == MSG_STATUSLOG then
local gained = m.content:match(REGEX_MANA_GAINED)
if gained and tonumber(gained) < mp.get then
manaLeechTotal = manaLeechTotal + gained
end
aproxManas = math.floor(manaLeechTotal / mp.avg)
aproxCash = math.floor(aproxManas*itemcost(mp.name) / 100) / 10
end
end
HUD Script:
init start
setfontstyle("Tahoma", 7, 99, "white", 1)
setmaskcolorxp(0)
init end
setposition($clientwin.left + 10, $worldwin.bottom - 10)
drawtext("Mana Leech: "..manaLeechTotal .." (aprox.: "..aproxManas .."/" ..aproxCash .. "k)")
MMS:
{'Mana Leech', function() return math.floor(manaLeechTotal / 100) / 10 .."k ("..aproxManas .."/" ..aproxCash .. "k)" end}
Feel free to share your opinion/improve the code.