Last active
October 17, 2018 21:53
-
-
Save epsilon-phase/f6f9af002e4319509cda96ab862c6bd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Paste this into the pattern match for the alias editor | |
--> ^/in ([0-9]+) (minutes|m|seconds|hours|h|s) do (.+)$ | |
--- Then paste the rest into the code editor | |
local noseconds = tonumber(matches[2]) | |
local timeunit = matches[3] | |
if timeunit == "minutes" or timeunit == "m" then | |
noseconds = noseconds * 60 | |
elseif timeunit == "hours" or timeunit == "h" then | |
noseconds = noseconds * 3600 | |
end | |
local command = matches[4] | |
cecho("<yellow>In " .. noseconds .. " seconds " .. "running " .. command .. '\n') | |
local myCss1 = | |
[[ | |
border-width: 4px; | |
border-radius: 7; | |
border-color: red; | |
background-color: green; | |
]] | |
local myCss2 = | |
[[ | |
border-width: 4px; | |
border-radius: 7; | |
border-color: green; | |
background-color: red; | |
]] | |
local atCount = 0 | |
for _, timername in pairs(demonnic.anitimer.activeTimers) do | |
if string.find(timername, "At" .. atCount) then | |
atCount = atCount + 1 | |
end | |
end | |
demonnic.anitimer:new( | |
"At" .. atCount, | |
{x = 0, y = 0 + 20 * atCount, height = 20, width = "25%"}, | |
noseconds, | |
{ | |
container = usefulContainer, | |
showTime = true, | |
timerCaption = command, | |
cssFront = myCss1, | |
cssBack = myCss2, | |
} | |
) | |
tempTimer( | |
noseconds, | |
function() | |
expandAlias(command) | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment