Funscript
¶
Funscript returned by ofs.Script()
actions | Action[] | read/write |
Array of actions |
path | string | read-only |
Default save path |
name | string | read-only |
Name of the script |
hasSelection() | Gets if the script has a selection |
commit() | Commit the changes |
sort() | Sort the actions array |
closestAction() | Get the closest action to a given time |
closestActionAfter() | Get the closest action after a given time |
closestActionBefore() | Get the closest action before a given time |
selectedIndices() | Get an array of selected indices into the actions array |
markForRemoval() | Mark an action for removal Example
|
removeMarked() | Remove all marked actions |
Array of actions
Default save path
Name of the script
Gets if the script has a selection
(bool) | hasSelection |
Commit the changes
(nil) |
Sort the actions array
(nil) |
Get the closest action to a given time
time | (number) | Time in seconds |
1. | (Action) | closest |
2. | (number) | index |
Get the closest action after a given time
time | (number) | Time in seconds |
1. | (Action) | closest |
2. | (number) | index |
Get the closest action before a given time
time | (number) | Time in seconds |
1. | (Action) | closest |
2. | (number) | index |
Get an array of selected indices into the actions array
(number[]) | indices |
Mark an action for removal
for idx, action in ipairs(script.actions) do
if action.pos > 50 then
script:markForRemoval(idx)
end
end
script:removeMarked()
actionIdx | (number) |
(nil) |
Remove all marked actions
(number) | removedCount |