How to Script Quickly like a Pro (WIP)

I wanted to write up a quick guide with my tips and tricks on how to script more quickly.
I think it’s best to get the info out there, and build this as a WIP, and fill in the details as I go.

This guide is probably not going much sense at all until I add in screenshots, so probably just come back later and it’ll be fleshed out and you’ll be able to get setup quickly.

Step 1. Preparation
To best prepare a video for scripting, you need to prepare it in a few ways to script more quickly with OFS:
a. filesize - a re-encode to a smaller resolution and framerate can often make it smaller
b. video resolution - shrink it to 480p or so for fast video navigation.
c. Convert video to i-frames - most important step

a/b. Shrinking a video with Handbrake:
Download Handbrake here: HandBrake: Downloads
You can change the config or download my json files and import them into Handbrake.

Under the Dimension tab, make the video 480p NTSC SD:

Under Video, you can use H.264.
If you have Intel or Nvidia, those versions will run faster. Quality goes down a bit but speed drastically goes up.

This quick config will work on all CPUs:
480p RF20 x264 Any CPU Encode Preset.json (3.4 KB)

This quick config will work quickly with Nvidia:
480p RF20 x264 Nvidia Encode Preset.json (3.4 KB)

This quick config will work quickly with Intel:
480p Intel Rf24 x264 Encode Preset.json (3.4 KB)

c. Convert video to i-frames
Download the tool FunExpander and in the bottom-right, click to choose your video to convert to i-frames:
Download from here: Fun Expander 2.5.2 - Video converter with ffmpeg to i-frames added [Updated 2022-04-11]

Step 2. Scripting Setup Peripherals
There are a few methods I like to use to script quickly.

Preferred Peripherals:
A. Standard Keyboard Method:
Using the keys 0 through 9 num row above the ‘QWERTYUIOP’ letters on your keyboard.
Bind the Minus (-) key to 100. Alternatively, you might want to bind the 0 key to 100 and Tilde (~) to 0, so that power moves linearly across your keyboard.
With the keyboard method, you can use the Arrow Keys to navigate points, or alternatively you can bind WASD to Up/Left/Down/Right.

B. A numpad - a dedicated one, or the one on your keyboard. This will work better with the WASD method or a scroll wheel due to where your hands are situated at. You’ll have to rebind the numpad a bit so that you have a key for 100%. I don’t use a numpad often in general, so I sometimes, and I find that you have to move your hands a bit too much, and I can never find a great spot for the 100% point.

C. Volume Wheel Method (Bit of setup, great results)
This is byfar one of my favorite methods as of late. It’s best used with a numpad or macro mouse, otherwise you’ll have to lift your left (or right) hand from the volume wheel to plot points using the num row on your keyboard.
My volume wheel of choice: https://www.aliexpress.us/item/3256808401441839.html?spm=a2g0o.order_list.order_list_main.35.44631802Hf98ra&gatewayAdapt=glo2usa

Volume Wheel Setup:
Step 1. Download Autohotkey: https://www.autohotkey.com/
Step 2. Use this script I made. Download it and double-click and it should activate, replacing your volume controls with arrow key movements left and right. Also changes Mute to letter H. Autohotkey Rebind Volume Controls to Arrow Keys for OpenFunScripter.ahk ~ pixeldrain
You can deactivate the script by finding the green icon in the taskbar and right-clicking to Suspend Hotkeys:

D. Macro Mouse as Numpad
This is a little bit of a WIP method, but it works for me a bit because I still have some control of my mouse, and I use macros for things like Delete Point or H (move point to current spot).
I use the Razer Naga V2 Hyperspeed.



You get additional binds by holding the 2 button here which I’ve bound to Hypershift.

E. Mouse Wheel Method
This one is actually pretty neat, I almost forgot about it.
If your mouse has an infinite scroll wheel, you might like this as an option to scroll through points.
Under Navigation in OpenFunscripter, you can add a bind to Previous frame and Next frame. Move your mouse wheel up for Previous frame, and down for Next frame, and it will bind. No need to check [ ] Repeat.

Step 3. Scripting Setup & Keybinds - PLUS ULTRA 100%

i. CheatEngine speedup
By hooking CheatEngine into OpenFunScripter, you can speed up the speed of the program, and quickly scroll Forward AND Backwards through video points.
I generally use 3.0x to 4.0x speed modifier when I’m using my keyboard to scroll through points, or at least 2.0x when the scroll wheel just for an added speed boost.
Get CheatEngine here:
https://www.cheatengine.org/downloads.php
Open CheatEngine 64bit. Click on the magnifying glass in the top-left.


Start typing the letters “OPENF…” so that you can quickly find OpenFunscripter, and hit Open.

Check [ x ] Enable Speedhack, set Speed to at least 2, and hit Apply:

ii. Hotkeys:
Some hotkeys that I setup in OpenFunScripter (some of these may be default)
H - Move to current location (H for “here”)
A - add point between two points
E - Equalize actions
T - select the top points, and then move them up/down with Shift+Up or Shift+Down.
R - repeat point - make sure to check [ x ] Repeatable for this, so that you can repeat points quickly. I like to fill “bottom out” on blowjob scenes with this.

Screenshots:
H -


A -

This comes from My Tools. You may have to go to Options>Keys and hit Validate for it to appear. Some people have removed the Hotkey in different versions of MyTools, so you can download the version I’m using: main.lua ~ pixeldrain

E -


T and R should be straightforward to find :slight_smile:

iii.Settings:
Framerate Override - you may want to go with 24fps, 25fps, or 30fps depending on your video. It definitely helps if you have a 60fps video and want to script a bit faster, like at 30fps.

Step 4. Patterns
For those that like to enhance things like tongue action or add vibrations, there are some add-ons like MyTools and others for things like this.
I’m actually not great at using them, though, so if someone has good links/resources to adding them, please share and I’ll write it up in this quick guide.

Step 5. Script like a God
Here’s a little preview of how I’ve been able to script with the volume wheel setup, scrolling through points.


This was one of my early attempts, and I’m showing that the video itself has some dynamic movement due to her head bobbing.

Step 6. Video clipping, processing etc.
There are a few tools out there for clipping videos, and for taking clips WITH their funscripts, and compiling them together.
One would be mkvtoolnix for video clipping, and another tool is one I worked on, FunscriptCompilationMaker:

I’ve tested my tool extensively and it will actually create Lossless video clips out of your funscript videos. Ex. If you’ve got a 1hr video and only want to keep 10 minutes of the video with the script, you can specify the timestamps and it’ll work in 1 go, and not affect the video quality.

Speed:
Depending on the scene, you can script videos in at least 1/4 to 1/2 speed with these methods. Meaning a 10 minute scene can be scripted in 20 to 40 minutes.
For very slow scenes (ex. ones that end up at 80 Speed like a slow blowjob or riding scene) you can get up to almost realtime scripting speed, meaning a 10 minute video may take 12 or 15 minutes.

General Tips on what method to use between Volume Wheel and CheatEngine + Keyboard:
For slower scenes, you will benefit from the CheatEngine + Keyboard method a lot, but with faster scenes, you’ll benefit more from the volume wheel method.
This is because you can do a quarter turn of the volume wheel, plot a point, quarter turn, plot a point, etc., all in fraction of a second through muscle memory.
For CheatEngine + Keyboard, there’s more overhead in between starting and stopping, but for scenes with lower speed, it can be a bit faster or easier to use this.

CheatEngine Tweaking:
For a 30fps vid, 4 to 5 frames between up-down BJ strokes - use 3x speed.
Slower scenes: 13 frames between BJ strokes - try 4x speed.

18 Likes

Thank you so much for your work!

Personally, I haven’t found anything as effective as my keyboard’s original numpad.
But be careful! Not just any keyboard. I have a Corsair K100 Air because otherwise I can’t do it with keys that are too big. I’ve always been a fan of low-profile keyboards.

For a short while, I tried to innovate, focusing on the Razer Tartarus. It was a disaster. I don’t recommend it at all; it feels like all my expertise has evaporated.

Practice, OFS is great. With practice, you gain skills and speed of application.

1 Like

Thanks for writing this up! Lots of incredibly good info here.

My only minor disagreement is around your recommendation around reducing framerate. I personally feel that working from the highest framerate possible (even using AI to convert to HFR for 2D videos) is the best way. My logic behind this is - with a HFR’ed video, if you place a point 1 frame off, you’re still 2x more accurate than if you were working from a lower framerate file. Yes, you do need to do more seeking, but you’re essentially doubling the accuracy of your output from a timing persepective.

100% agree that a dedicated numpad is super helpful. I have also found good success working with a jog wheel for advancing frame by frame. This one is SUPER configurable, with an outer ring that can serve for macro seeking, and the jog wheel for micro seeking. I also have the outer buttons mapped to other functions like advancing to the next set point, “nudging” points forwards and backwards, and a quick minimize function if someone decides to walk on me while I have OFS zoomed in on some dude’s wang.

2 Likes

This looks very cool. I had heard that you have some type of wheel strat after mentioning mine to someone. I’ll check this one out as well.

I figure you’re technically right on the accuracy, but honestly unless it’s animation, I don’t need it to be so frame perfect. Maybe it’s because I script with the Syncbot in mind. 1/25 to 1/30 of a second accuracy is pretty good. And with the Handy mine is resyncing the script in 25ms intervals anyway in Scriptplayer. I’ve always liked that the Syncbot doesn’t need any synchronization at all and been in sync with my high refresh monitors. (sorry to shill it but I still enjoy it)

@Morrigan
Haha, I did see this type of macro keyboard. I’ve been looking for a small numpad keyboard or something on the side that’s easier to use without moving my hand around.

I’ll add some more pics to the guide over time ~

1 Like

Thanks for this topic. I’m already using some of recommandations (like recoding the videos), but some need to be explored.
Generally I’m using the keyboard when at my desk, but 80% of time my Steam Deck remoting my PC, in front of TV, is sufficient (with a Bluetooth mouse just in case). Maybe I’m the only one to do this :saluting_face:
I’ve put rear buttons to up/down by 10% strokes, and copy / paste. Some actions are with a virtual wheel of actions, used via right trackpad (save, deselect, undo)

photo

Man, this looks so comfy. I was thinking of some type of method with a controller, and something with a +10% or -10% button where you could just plot an initial point and then move it up or down. You could probably plot at 50% and then press the triggers accordingly at each point, huh?

Also thought about some type of touchpad input-based way to just press on the screen roughly where the point is, from 0 to 100. That way you could just scroll → tap → scroll → tap. They should make that blue accordion lookin thing clickable!!

My config, in addition to rear buttons:
A button : 0% action
Y button : 100%
X button. : 50%
B button: Delete action
Left touchpad : up down actions, or move left right actions
Right touchpad : wheels,of,actio,
L1 : strokes at 90%
Start : play video
D pad : navigate

Some buttons are not used yet, like select, the triggers, but are available if need to shortcut others functions.

But for most of the initial job of scripts (not detailing with tools like vibrations), this do te job.

1 Like

If I ever get really serious about scripting I’ll probably mess around with binding my midi keyboard to work as an all-encompassing OFS controller.

1 Like

Interested to start scripting with the Volume Wheel Controller, but not able to use the AliExpress link (not available to Europe)
I’ve ordered from here, seems to be almost same model. A little expensive than Ali, but easy for me to order (should be delivered tommorow…)

Yeah, this one is it, has the blue light and everything.
I tried other ones from Amazon before I specifically grabbed that model from Ali. The Ali one is well-built with a button press that works consistently.
Hope you enjoy the method.

Btw I’m upscaling those vids - working from the original from scratch to do it losslessly until the final encode :wink:

Received my USB Volume Control, and tested yout script: interesting way to navigate and do a first passage to put the endpoints, indeed.

Just from your script I need to delete first line about actions per interval, it gives error…

Another idea, do you know if possible to replace the Next / Previous Action (ie press and rotate) and assign to keyboard keys? Will be great to put Up & Down from keyboard to navigate bewteens actions

Edit :
found
Media_Next::Up
Media_Prev::Down

But is there something in script to indicate and hold? Otherwise it do the Mute action before navigate, oopsie

Edit:
For the interval, reading the documlentation, changed to :
A_HotkeyInterval := 2000 ; This is the default value (milliseconds)
A_MaxHotkeysPerInterval := 200

Ok, yeah the max actions per interval was what I was getting at. Maybe my version of AutoHotKey is older and uses a different syntax. If you don’t increase it from the default value (I think it was 50) it will give you an error if you scroll too quickly.
Can you share the updated script and I can provide it as an alternative?

And I had no idea you could even do the Press and Hold thing, might have to try that out! That’s dope.

This is the script file i use with V2 of autohotkey

Autohotkey Rebind Volume Controls to Arrow Keys for OpenFunScripter_v2_move .ahk.txt (187 Bytes)
Remove the .txt extension before use it
Rotation: Right-Left keys - Move 1 frame left/right
Click: H (on my side triggered action at 100)
Maintain Click + Rotate : Up/Down keys. go to previous/next action. keep cliked seems to not trigger the only click action

If anyone have an idea on how to have similar effect as autohotkey for using the peripheral on Ubuntu, I’m intersested.

1 Like

A quick search and this turned up, but maybe you already tried it? It requires X11, which can be an issue depending on your installation I guess. I don’t run Linux often and when I do it’s usually Kali Linux.

No I hav’ent tried, I m a noob to linux :stuck_out_tongue: Did not saw there is a “simply conversion” ot the Widnows tool.
Thanks for the link I will try to understand and an try this this later