Class Funscript

Funscript returned by ofs.Script()

See also funscript

Synopsis

Attributes
actions Action[]

read/write

Array of actions

path string

read-only

Default save path

name string

read-only

Name of the script

Methods
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
for idx, action in ipairs(script.actions) do
  if action.pos > 50 then
    script:markForRemoval(idx)
  end
end
script:removeMarked()
removeMarked()

Remove all marked actions

Attributes

Funscript.actions Action[] read/write

Array of actions

Funscript.path string read-only

Default save path

Funscript.name string read-only

Name of the script

Methods

Funscript:hasSelection()

Gets if the script has a selection

Return Values
(bool)

hasSelection

Funscript:commit()

Commit the changes

Return Values
(nil)
Funscript:sort()

Sort the actions array

Return Values
(nil)
Funscript:closestAction(time)

Get the closest action to a given time

Parameters
time (number)

Time in seconds

Return Values
1. (Action)

closest

2. (number)

index

Funscript:closestActionAfter(time)

Get the closest action after a given time

Parameters
time (number)

Time in seconds

Return Values
1. (Action)

closest

2. (number)

index

Funscript:closestActionBefore(time)

Get the closest action before a given time

Parameters
time (number)

Time in seconds

Return Values
1. (Action)

closest

2. (number)

index

Funscript:selectedIndices()

Get an array of selected indices into the actions array

Return Values
(number[])

indices

Funscript:markForRemoval(actionIdx)

Mark an action for removal

Example
for idx, action in ipairs(script.actions) do
  if action.pos > 50 then
    script:markForRemoval(idx)
  end
end
script:removeMarked()
Parameters
actionIdx (number)
Return Values
(nil)
Funscript:removeMarked()

Remove all marked actions

Return Values
(number)

removedCount