diff --git a/library/lua/repeat-util.lua b/library/lua/repeat-util.lua index ce07cdafd7..fe793d0e13 100644 --- a/library/lua/repeat-util.lua +++ b/library/lua/repeat-util.lua @@ -1,7 +1,4 @@ --- lua/plugins/repeatUtil.lua --- author expwnent -- tools for registering callbacks periodically --- vaguely based on a script by Putnam local _ENV = mkmodule("repeat-util") @@ -13,6 +10,18 @@ dfhack.onStateChange.repeatUtilStateChange = function(code) end end +function isScheduled(name) + return repeating[name] ~= nil +end + +function listScheduled() + local result = {} + for name, _ in pairs(repeating) do + table.insert(result, name) + end + return result +end + function cancel(name) if not repeating[name] then return false