Accessing a random text file from within a folder?
I'm a minecraft modder, and I'm trying to make a mod that involves randomly selecting a text file from within a folder and using its contents.
Is there any way I can do this?
Notes: I can't know the names of the text files being randomly selected from.
Re: Accessing a random text file from within a folder?
If you know what directory you're looking in, you can use ListFiles to get all the files in that directory, then use the Random class to randomly pick a file from that list.