While ((l.class = "dialogue") and string.len(l.text) < 55 and i < #subs) doĪegisub. Automation module also uses the Lua, Perl and Ruby programming languages. a powerful scripting environment called Automation (originally mostly intended for creating karaoke effects. intended for creating karaoke effects, Automation can now be used much else. Script_description="Concatenates Lines under 55 characters" Package: aegisub (3.2.2+dfsg-6 and others). I feel like it is a syntax problem with the way I've written my loops but im not super experienced with lua and am unsureĪny help would be greatly appreciated script_name="Concatenate lines" Fix crash when trying to open compressed tracks from Matroska The edit boxs background color is now customizable. While Automation 4 Lua presents the subtitles as if it was an array, it internally maintains a cursor used to optimise for sequential access. While true do if ((l.class = "dialogue") and string.len(l.text) < 55 and i < #subs) thenĪs well as attempting to add else statements to the end but these just return errors. Aegisub internally stores the subtitle file as a linked list, which means that random access is slow, but sequential access is fast. Ive tried changing while ((l.class = "dialogue") and string.len(l.text) < 55 and i < #subs) do this is almost exactly how I want it to function however I cant figure out why my loops dont cause the program to execute until all of the lines of dialogue fit the conditions. executing it repeatedly will continue to merge the 2nd line into the first until it hits the character threshold, at which point it will start merging line 2 with line 3, etc etc. Lua API reference: Registration Subtitles object Progress reporting Dialogs Misc. In actuality when executed it will concatenate lines 1 and 2, deleting line 2 in the process provided line one is less than 55 characters, but after the single join it stops running. This is a code im working on in lua for an aegisub automation, the intended goal is to have it concatenate the first and second dialogue lines, then repeat that process until line 1 contains at least 55 characters, before moving on to dialogue line two, concatenating it with line 3 until line two is at least 55 characters, etc, etc.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |