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

25 lines
1 KiB
Lua

-- Aegisub Automation demonstration script
-- Original written by Niels Martin Hansen
-- Given into the public domain
-- This script demonstrated using include scripts in Automation.
-- You include a file simply by calling the include function with a filename.
-- Depending on whether the filename contains a path or not, it is interpreted in slightly different ways,
-- see the documentation for more information.
include("utils.lua")
-- The usual info
name = "Include demo"
description = "Simple demonstration of the include function."
-- Here several values are set in one line
version, kind, configuration = 3, 'basic_ass', {}
function process_lines(meta, styles, lines, config)
-- Copy the first line (line 0) and store it as as a new last line
-- The last line has index lines.n-1, so lines.n is one past the last line
lines[lines.n] = copy_line(lines[0])
-- Make sure to increment 'n', so the correct number of lines are read out
lines.n = lines.n + 1
-- Then return the modified lines table
return lines
end