You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: LuaApiReference.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ end
54
54
|`print(msg)`|String| nil | Will print to the OFS log file.|
55
55
|`ofs.Bind(functionName, description)`|String, String| nil | Will create a "Dynamic" key binding.<br/>Must be called from within `init()`.<br/>Bindings will always run in another thread. |
56
56
|`ofs.Task(functionName)`| String | nil |Will run a function in another thread. Use cautiously. |
57
+
|`ofs.ExtensionDir()`| None | String | Path to extension directory. |
57
58
58
59
59
60
# Video player API
@@ -66,6 +67,7 @@ end
66
67
|`player.Duration()`| None | Number | Returns the total duration of the video in seconds. |
67
68
|`player.IsPlaying()`| None | bool | Returns a boolean if the player is playing or not. |
68
69
|`player.CurrentVideo()`| None | String | Returns a path to the currently playing video. |
70
+
|`player.FPS()`| None | Number | Returns the fps of the video. |
69
71
70
72
# Funscript API
71
73
@@ -146,6 +148,9 @@ end
146
148
|`ofs.HasSelection(script)`| Funscript | bool | Returns if the script has a selection. |
147
149
|`ofs.Commit(script)`| Funscript | nil | This creates an undo snapshot and saves changes back to OFS.<br/>If you forget to call commit nothing will change in OFS. |
148
150
|`ofs.Undo()`| None | nil | Will undo the last modification done by a Lua script.<br/>It will do nothing if the last modification wasn't done by a script.<br/>Essentially you only undo modifications by `ofs.Commit`. |
151
+
|`ofs.ScriptTitle(index)`| Number | String | Returns title of a funscript. |
152
+
|`ofs.ClosestActionAfter(script, time)`| Funscript, Number | Number | Given a funscript and a time in seconds it returns an action index or nil. |
153
+
|`ofs.ClosestActionBefore(script, time)`| Funscript, Number | Number | Given a funscript and a time in seconds it returns an action index or nil. |
0 commit comments