Skip to content

Instantly share code, notes, and snippets.

@nefftd
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save nefftd/ff4736c868a5b48ae32a to your computer and use it in GitHub Desktop.

Select an option

Save nefftd/ff4736c868a5b48ae32a to your computer and use it in GitHub Desktop.
mod:provider 'health' {
function(unit, event, ...)
if some_example then
return -- return nothing to not update frames
end
return UnitHealth(unit), UnitHealthMax(unit) -- returned values get sent as signal to unit frame
end,
updatefor = {'.*'}, -- invoke for all units
unitevents = {'UNIT_HEALTH','UNIT_MAXHEALTH'}, -- invoke for event's arg1 unit on these events
events = { ['.*'] = 'PLAYER_ENTERING_WORLD' }, -- also invoke on PEW for all valid units
timers = { ['player'] = .1 }, -- also invoke every .1 sec for player
resolve = true, -- also invoke immediately when unit changes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment