Skip to content

Commit

Permalink
Merge branch 'develop' into adv-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Dec 25, 2024
2 parents 6e3091d + a93873a commit 4fcc4a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
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

0 comments on commit 4fcc4a5

Please sign in to comment.