Script Safety Manager: check untested funscripts before your device plays them

Script Safety Manager: check untested funscripts before your device plays them

GitHub: GitHub - wilmgard/script-safety-manager · GitHub
Free, open source, runs locally and offline (no uploads, no account).

Why I’m making this

Lately we’ve seen more scripts released by new authors that clearly haven’t been tested on real hardware. A funscript is just a list of positions and times. Nothing in the file stops it from asking for a full stroke in 5 ms, or actions 1 ms apart.

On the Handy I’m not too worried. Its firmware caps speed at around 500 units/s and rewrites anything faster. That behaviour has been tested thoroughly by people here, so I trust it.

Some homebrew devices are untested, so they carry some degree of risk. Not every device has a firmware limit the community has checked, and some play every command as fast as their motor can go. I wanted a safety layer for those: something that checks a script before it’s played and saves a capped copy.

Tools that already exist

This isn’t the first safety tool, and it’s not meant to replace them:

Script Safety Manager is aimed at the other side: people playing scripts they downloaded. You don’t need a script editor. Open the file, pick your device, and it tells you in plain words what’s wrong for that device, shows where on a graph, and saves a fixed copy.

What’s been tested before (and what this builds on)

This is built on community testing and discussion about how devices play scripts, not my own guesses:

What I’ve tested so far:

  • Every check and fix against the community stress-test script, for every device profile. With all fixes on, every profile goes from a score of 0 to 100.
    Stroker_Stress_Test.funscript (138.4 KB) built by @Falafel
  • 54 automated tests, including deliberately broken and hostile files.
  • The desktop app on Windows.

What it does

Open a script, choose your device, and it shows a score for the original and for the fixed copy, plus a list of problems in plain words. Click a problem to jump to it on the graph.

It checks for:

  • Too fast for this device. The stress test has moves up to 17,000 units/s.
  • Actions too close together. It has actions 1 ms apart.
  • Starts or restarts at full speed after a pause.
  • Would play off the beat on the Handy. It simulates the firmware’s limiter.
  • Too slow for the Handy. The firmware re-times strokes under about 33 units/s.
  • Long, very intense sections.
  • Broken files: out-of-range positions, unsorted or duplicate timestamps.

And it can fix them:

  • Cap the speed at a limit you choose. For homebrew devices the default is 500 units/s, matched to the Handy, because that’s the limit the community has tested. Set it lower if you want it gentler.
  • Choose how too-fast strokes are shortened. Keep bottoms (or tops) on the beat keeps beat-synced thrusts exactly where the scripter put them, unlike the Handy firmware’s method.
  • Merge actions that are too close together, ease in after pauses, fix slow strokes for the Handy, and optionally tone down long intense sections.
  • Save safe copy writes NAME.safe.funscript next to the original. The original is never changed.

What it doesn’t do

  • It’s not a guarantee. The speed cap is a choice, not a measured safe limit for your device. Still start with your device’s stroke length and speed turned down, and keep the stop control in reach.
  • Single-axis (stroke) scripts only. Multi-axis files (roll/twist/pitch) aren’t supported. I don’t own a multi-axis device to test with, but PRs are very welcome.
  • It’s not a script editor. For capping speeds while you script, use StrokeLimit in OFS.
  • No video or device preview. It works on the script file only.
  • It doesn’t judge script quality, only whether a device can play it safely and as written.
  • No installer yet. You need Python for now (instructions are in the README).

What’s next

  1. Repair broken scripts on open: remove invalid actions (with your OK) instead of refusing the file.
  2. Windows installer: a single .exe, no Python needed.
  3. Batch mode: check a whole folder and see which scripts are unsafe, worst first.
  4. Profile editor in the app: save and share your own caps and settings.
  5. Track Handy firmware changes using the official firmware change logs, since the homebrew default is matched to the Handy.

Feedback very welcome, especially:

  • scripts it gets wrong (false alarms, or problems it misses);
  • how the fixed scripts feel on your device;
  • whether the 500 units/s default feels right as a safety cap.

Issues and PRs: GitHub - wilmgard/script-safety-manager · GitHub

6 Likes

is it possible to just… NOT use a child as a splash “art” for such tool ???

3 Likes

Aw shit, my intention was to use an angel, but I guess he looked too innocent.
Thanks for bringing this up.
Updated to a more appropriate splash art.

2 Likes

Thanks, I love it! :joy::joy::joy::joy::joy::joy::joy:

1 Like

Thank you for making this! Just ran it over my scripts and found a pretty nasty bug that caused spike in stroke axis in some scripts (no published scripts affected, fortunately).
Will be checking my scripts with this before release from now on.

Thank you bro! :rofl::rofl::rofl:
Sometimes I get hard looking at my own art too.
No homo.

Glad it works for you!
I actually released this just to justify myself posting a meme photo,
but I’m super glad at least someone finds it useful

Update: Windows app, batch mode, and broken-script repair

Thanks for all the feedback so far! Here’s what’s new today:

:window: Windows app, no Python needed
Download ScriptSafetyManager.exe from the latest release and double-click it. One file, nothing to install. Windows may say “Windows protected your PC” because the app isn’t code-signed: click More info › Run anyway.

:file_folder: Check a whole folder
Click Check a folder… to check every script in a folder for your device. They’re listed worst first, with score, main problem and what’s left after fixing. Double-click any script to inspect it, and save safe copies for all of them in one click. Originals are never changed.

:adhesive_bandage: Broken scripts can now be opened
Instead of refusing scripts with unplayable actions (missing values, NaN, negative times…), the app lists them and asks before removing them. The safe copy records what was removed. Files that are cut off or damaged are still refused, because guessing could invent moves.

:locked: Safer with hostile files
Oversized files and absurd timestamps are now rejected instead of freezing the app, and text from a script can no longer change how warnings look.

:gear: Device profiles
Homebrew devices now have their own profiles in the device list, all with a 500 units/s cap matched to the Handy. You can still set your own cap.

As always, feedback, problem scripts and PRs welcome: GitHub - wilmgard/script-safety-manager · GitHub

1 Like