Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions library/lua/repeat-util.lua
Original file line number Diff line number Diff line change
@@ -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")

Expand All @@ -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
Expand Down
Loading