Jump to content
UBot Underground

Pick A Random File..


Recommended Posts

Can we pick a random file that contains random items?

 

I know we can add a list of items that can be picked randomly, but taking a step forward, is it possible to add a list of files and each file would contain their own list of different items?

 

Say...

 

Pick random:  A, B, C

 

Then go automatically to A 1, 2, 3, or B 1, 2, 3, or C 1, 2, 3.

 

 

I am trying to keep the program short.

 

 

 

 

Link to post
Share on other sites

If you load the filenames into a list, then pick random list item. Then you have your random filename - open the file using the filename and your location and load it into a new list... 

  • Like 1
Link to post
Share on other sites

I know this is wrong as it can be...

 

I am trying to navigate to a random site picked from a random file..

 

ui open file("Files"#Files)
add list to list(%files,$list of files("1.txt
2.txt
3.txt",$new line),"Delete","Global")
add  list to list($random list items($list of files), "delete, "Global
navigate($random list item(%links),"Wait")

 

UI commands seem to open files only, but no open folders to load.

 

from there I am looking to open a random to file to work..

 

... and then continue with the program..

Link to post
Share on other sites

as in,a,b and C are not files but actually folders?

or a,b,c are files,and in those files you want to randomly pick attributes from those files?

 

both are possible,use the $get files parameter of the root folder if they are folders,followed by another $get files and randomise it

use find regular expression if they are files

Link to post
Share on other sites

Yes... I should of have said ui open folder ("Folder"#Files)

 

A, B, C, would be files in a folder... 

 

You would open a folder that contains different files..

 

Then, randomly open A, B, C... which would contain a random item to go to..

Link to post
Share on other sites

If you want to select a folder using the UI commands I would suggest using Aymen's File Management Plugin here. The function you will want to use is the $folder browser dialog.

 

If you then want the script to select a random file from the selected folder you can use the $get files function and add the filenames to a list.

 

Example: (requires the file management plugin)

ui button("Select a Folder") {
    set(#c_folder, $plugin function("File Management.dll", "$folder browser dialog"), "Global")
    clear list(%files)
    add list to list(%files, $get files(#c_folder, "Yes"), "Delete", "Global")
    alert("Random File:

{$random list item(%files)}")
}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...