Choosing Randomly

So i have at the time about hundreds Videos and Funscripts from my collection. Sometimes when i want to play, i just confuse about which videos should i play, even there’s still some videos that i have never watch because my pickiness (idk if it’s a word lol).
that’s why i would like to ask, do you guys have any idea or ways how to choose randomly a file out from a folder, especially in windows 10 os. I used to write in google random number, but i found it so complicated and waste time.

Any Idea?? xDDD

2 Likes

You can save the following as random.bat (or anything you want, as long as the extension is .bat):

@echo off
setlocal EnableDelayedExpansion
cd C:/path/to/your/funscripts
set n=0
for %%f in (*.*) do (
   set /A n+=1
   set "file[!n!]=%%f"
)
set /A "rand=(n*%random%)/32768+1"
echo "!file[%rand%]!"
pause

On line 3 replace C:/path/to/your/funscripts with your actual path. The code is from here, just slightly modified to print the file name instead of copying it somewhere.
Once it’s saved, just double click the file and it will give you the name of a random file in your scripts folder.

5 Likes

Are you using Script Player to play your scripts? Very easy way to use for the randomness. You can simply add a whole folder and then just let them play randomly. Chapter mode is also great and puts even more randomness in.

2 Likes

Props to @makeme that works well.

But @SirNathanael it will need adjustment if you have your files on a drive other than windows C:\

E.G. files on the X: drive, in X:\path\to\your\funscripts

@echo off
setlocal EnableDelayedExpansion

X:
set myfolder=X:\path\to\your\funscripts

cd !myfolder!
set n=0
for %%f in (*.*) do (
set /A n+=1
set “file[!n!]=%%f”
)
set /A “rand=(n*%random%)/32768+1”
echo “!file[%rand%]!”
@echo “!myfolder!!file[%rand%]!”| clip
pause

This will also copy the full file address and name into your clipboard. for quick playing.
:white_check_mark:

Also you can replace the line

for %%f in (*.*) do (

with

for %%f in (*.*m*) do (

to have it only select video files, As most video file extensions include “m”.

This way is really helpful, i dont really know there’s such things in the app lol
Thx btw

1 Like

Thank you, i might gonna use the code it for another things :wink:

A Randomizer is a great idea, I will add it to my collection :+1:

Tangentially related to this I’ve not been able to figure out how to play videos in the script player. I tried following the manual instructions but there still does not appear to be an option to play video.

Your welcome! I also can’t really decide, which video to choose most of the time ^^ So that random + chapter mode is very handy.

Really? What is the problem? The setup is very easy. Video and script has to have the same name and in the same folder. Connect your device with the script player, load the video (scripts loads automatically), press play and that should be it.

I drag the video file in and it doesn’t do anything. It plays the script. Not the video. Maybe I’m trying to load the video the wrong way…?

EDIT: I think I figured it out. I need to point the script player to MPC via the settings but I can’t find where the application is to point it at.

EDIT 2: NVM, I’m a dumb

It works now?

I was using handy control, not funscript.

Hey.

I just came across this and it’s pretty cool. One issue i’m having though is that I keep getting the same funscript file. I tried deleting the random.bat file and creating another one and I got the same funscript again.

Any idea on how I can get it to choose new values each time I double click the file?