Skip to content

Instantly share code, notes, and snippets.

@RaphPH
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RaphPH/0cb1e661a9a3e217ed17 to your computer and use it in GitHub Desktop.
Save RaphPH/0cb1e661a9a3e217ed17 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment