Soft Duration Left
Description
Some of you guys might remember this HUD on ElfBot NG, so here's on WindBot.
Configuration
Create one persistent hotkey and a HUD with these codes below.
Screenshots
http://i.imgur.com/YhX5B5k.jpg
Requirements
- WindBot 1.3.3
- Raphael's Library 1.1.1
- Lucas Terra's Library 14.1
Code
Persistent Hotkey:
init start
local function getsecs(msg)
local times, temp = {m = 60, h = 3600, s = 1}, 0
for n, t in msg:gmatch('(%d+)%s(%a)') do
temp = temp + (tonumber(n) * times[t] or 0)
end
return temp
end
-- SCRIPT VERSION: 1.1.0
init end
auto(1000) -- do not change it!
if not softTime then
if $feet.id == 3549 then
contextmenu("Look", $feet.id, "feet") waitping()
end
foreach newmessage m do
if m.type == MSG_INFO then
local name, duration = m.content:match(REGEX_ITEM_DURATION)
if duration then
softTime = getsecs(duration)
end
end
end
end
if $feet.id ~= 3549 then
softTime = false
end
if softTime then
softTime = softTime - 1
end
gist
HUD Script:
init start
local fontsize = 7
local fontspacing = fontsize + 6
setfontstyle("Tahoma", fontsize, 99, 0xE4B31B, 1)
setmaskcolorxp(0)
setposition($clientwin.left + 7, $worldwin.top + 5)
init end
softDuration = time(softTime) or 0
drawtext("Soft Duration: "..softDuration or 0, 2, 2 + fontspacing)
gist