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 }}
Repository navigation
Play funscripts on a stroker through Intiface - #84
A video's .funscript moves a stroker in time with the video, through Intiface Central or Engine. The script can sit beside a local or network file, or come from Stash for a scene. It's off by default, and while off none of it runs.
How it works
flowchart LR
V[Video position] --> W[Script worker thread]
S[.funscript] --> W
W -- "Buttplug v3 over WebSocket" --> I[Intiface] --> D[Stroker]
Loading
A worker thread schedules each move to end when the video reaches the script's next action.
When the video stops moving, the device holds its place: paused, seeking, loading, stalled or at its end. It holds too while the headset is taken off.
After a start, resume or jump into a stretch where the script holds still, the device goes straight to that position.
A command that can't be sent starts a reconnect at once. A device that appears during playback joins in at once. Where it starts from isn't known, so if the video stops during its first move it finishes that move rather than being rushed to a guessed position.
Settings and strip
Settings › Funscripts:
on/off;
Intiface's address, edited with the menu's keyboard;
a status lamp;
a timing offset (±1000 ms);
the part of the stroke used (from / to).
The sliders apply live while held.
The strip: a chip while the playing video has a script, in the accent colour while a device plays it and red otherwise. Tapping it opens the Funscripts settings.
Offline downloads: they take the script with the video while the setting is on.
Medium — A rejected move is treated as a successful one (src/intiface.cpp:341–346, src/script_player.cpp:249–258). A successful socket write only means the command reached the transport. If Intiface returns a Buttplug Error because the device write failed, the worker keeps the rejected move as its position estimate and the strip still reports that the device is playing. Pausing during that move can then send a 100 ms “hold” to a position the device never reached. Treat a rejected LinearCmd as a failed move: discard the estimate and use the existing reconnect path so the next move starts from an unknown position.
Medium — A cache pause allows up to 300 ms of additional scripted movement (src/main.cpp:2353–2356, src/script_player.cpp:382). When a network video underruns, mpv can report paused-for-cache while the user’s pause property remains false. The sync gate misses that signal, so the worker extrapolates from the last video position and can send several more actions before the stall timeout expires. Observe paused-for-cache as playback state, rather than only as a timing diagnostic, and include it in the sync gate. Keep the timeout for stalls mpv does not report.
Medium — Two offline videos can play the same script by mistake (src/offline.cpp:606–610). Downloading clip.mp4 and clip.mkv from different folders gives them distinct video paths but the same clip.funscript destination. keep() skips the second script because the first already exists; playing the second video then drives the device with the first video’s actions. Removing the first download also removes the script the second was using. Reserve the stem when choosing the offline filename, so the existing clip (2) naming scheme separates videos that would share a sidecar.
Low — Intiface error text can expose device details in diagnostics (src/intiface.cpp:344–346). ErrorMessage is free-form server text. For example, a device backend can include its connection URL in a failed-write error. Printing the first 200 bytes still puts that address in the run log and any exported diagnostics; redacting script_address from settings does not redact this message. Log the numeric Buttplug ErrorCode and a fixed description instead.
User verification needed
On a desktop runtime without XR_EXT_user_presence, userPresence() stays -1, which passes the check at src/main.cpp:2356. With a script playing, remove the headset and check whether device commands stop before putting it back on. If playback continues advancing on that runtime, the current gate has no removal signal; the headset-off hold should then be described as dependent on presence support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A video's
.funscriptmoves a stroker in time with the video, through Intiface Central or Engine. The script can sit beside a local or network file, or come from Stash for a scene. It's off by default, and while off none of it runs.How it works
Settings and strip
Settings › Funscripts:
The sliders apply live while held.
The strip: a chip while the playing video has a script, in the accent colour while a device plays it and red otherwise. Tapping it opens the Funscripts settings.
Offline downloads: they take the script with the video while the setting is on.
Closes #70
Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.0