OpenFunscripter - another scripting tool - 2.0.0 release

Could it be ´ or ` and not ’ (i.e. characters that can also be used with some letters like é, è) ? Just a thought.

Still can’t reproduce. There may be something else going on though.
I’m not going to install windows 11 any time soon :sweat:

I just created another release. v1.4.0
You can now use the new Lua API there shouldn’t be any breaking changes anymore.
Check the reference to see how it works: LuaApiReference.md

Note:
You can use luasocket inside extensions without doing anything however I’m thinking of removing it because it’s not well documented and very impractical.
The reason you would want to use this is for inter process communication and raw tcp/udp sockets aren’t very easy to use especially not in a high level language like Lua.

So if you want to write an extension which needs to communicate with another program or hit a server using http let me know.
I think http support and maybe websocket support would be supperiour to raw tcp/udp sockets.
It would be a large amount of work so I wouldn’t want to do it, if it wouldn’t get used.

3 Likes

thanks for the the realeses !

Can you merge scripts ? import script A, add script B making a Script C = a+b

1 Like

Does anyone have a list of extensions for OpenFunscripter? I’m curious if they could make scripting life easier.
Thanks for the great tool!

The ones that are integrated with OFS:

Other than that I ocassionaly use HandyControl 1.2.0 to limit speed in the scripts / create fancy heatmaps.

2 Likes

Yes you can.

  1. Import the video/audio for your “C” script. (Loading scripts without video/audio is not supported)
  2. In the main menubar “Project”->“Add…”->“Add extisting” to add your “A” script.
  3. In the main menubar “Project”->“Add…”->“Add extisting” to add your “B” script.
  4. You should now have 3 timelines. Copy the sections you want from “B” / “A” to “C” via ctrl+c / ctrl+v
  5. When done you can remove “A” & “B” from the project via “Project”->“Remove”
1 Like

thanks, that’s great ! i didn’t think of making the compilation video before joining the scripts.

Has the bookmark function always jumped just by hovering over it? Because I don’t think it did before, and it’s bugging me. Is there a way to turn that behavior off and require clicking to jump?

This may be a dumb question but can you install OFS on a usb drive and work off that? Or does OFS need to be installed on a hard drive?

Similarly if the answer is yes would you be able to install the motion tracker on the usb as well

You can, just download the zip file and unzip it on the usb drive. If you put the motion tracker on the usb drive make sure that the usb drive letter is correct in the lua script when you change PCs.

1 Like

It’s not really an extension to OFS, but I suggest creating a batch file with this command (ex. “optimize-for-ofs.bat”):
"[path to ffmpeg]\ffmpeg.exe" -i "%~dp1\%~nx1" -r 30 -filter:v "scale=2048:-1" -intra -qp 30 -acodec copy "%~dp1\%~n1-optimized%~x1"

You can then drag a video file on the batch file and it will make an “[filename]-optimized.[extension]” file in the same folder. The optimized file will not have any ‘B’ frame and 30 fps, which make a big difference when you are working in OFS. Not sure where I saw this trick, but it made a huge difference for me.

To use the optimized file in OFS, but test with the original file, I usually do this:

  1. Open the optimized file in OFS (ex. “SIVR-00130-optimized.mp4”).
  2. Use menu “File\Export\Export Active Script”, save to “[original file name].funscript” (ex. "SIVR-00130.funscript). You only have to do it once. After that, OFS will always use the filename you chose for the ‘quick export’.
1 Like

Is there a hotkey to reload active extensions? Disabling and enabling my extension whenever I want to test a change is a bit of a chore.

@murmanox No but I think that’s a good idea.
You don’t need to disable and re-enable if you enable “Extensions”->“Developer mode” it places a “Reload” button + some perf timers in the extension window.

1 Like

Thanks, that’s good to know. Just a few more things:

  1. It would be nice if there was a number input which has an increment and decrement button, with custom step and optional min and max values. (turns out this is just ofs.Input… oopsie)
  2. Buttons with the same text don’t work properly, only the first instance of the button is functional.

@murmanox I could add an optional parameter for the step size of ofs.Input the clamping of the value I feel like you can always do in Lua.
Right now ofs.Input always steps by 1.

value, val_changed = ofs.Input("Number", value)
value = clamp(value, 0, 10)

For Buttons or any widgets using the same text you’ll have to write “Text Displayed##UniqueId” so for example multiple “Apply” buttons would work like this.

ofs.Button("Apply##ApplyButton1")
ofs.Button("Apply##ApplyButton2")

This applies to all widgets.
I’m passing the string from Lua directly to ImGui.
Here’s the section from their FAQ which applies ImGui Ids
I’m going to add this to my “API Reference”.

1 Like

New version v1.4.1

4 Likes

Added a new Version v1.4.2
Nothing major just some Lua stuff to execute other programs.

3 Likes

I followed all instructions but the lua doesn’t show up in custom scripts list. What can I try?

@gagax123 Thanks for adding more lua commands, I have been trying out writing extension.
One little request, is it possible to make the meta info popup optional when opening a new video?
I am not using it but it has to be closed every time to access the main GUI again.

1 Like