Aegisub/automation/autoload/test4.lua
Niels Martin Hansen b39451823e Continuing auto3 removal/auto4 merge
Originally committed to SVN as r644.
2006-12-28 21:18:35 +00:00

40 lines
853 B
Lua

-- Automation 4 test file
-- Create a Macro feature, that displays some text
script_name = "Automation 4 test 4"
script_description = "Test progress reporting"
script_author = "Niels Martin Hansen"
script_version = "1"
function wait()
local s = ""
for i = 0, 500 do
s = s .. i
end
return s
end
function progression(subtitles, selected_lines, active_line)
while not aegisub.progress.is_cancelled() do
aegisub.progress.task("Counting up...")
for i = 0, 100, 0.2 do
aegisub.progress.set(i)
if aegisub.progress.is_cancelled() then
break
end
wait()
end
if aegisub.progress.is_cancelled() then
break
end
aegisub.progress.task("Counting down...")
for i = 0, 100 do
aegisub.progress.set(100-i)
wait()
end
end
end
aegisub.register_macro("Progress fun", "Does absolutely nothing", "video", progression, nil)