Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: liquid8d on December 05, 2014, 11:15:17 AM

Title: iteration of files in directory?
Post by: liquid8d on December 05, 2014, 11:15:17 AM
Is there a way to iterate through files in a directory?

I know you can use FeConfigDirectory to access specific files in there, but is there a way to get a list of files dynamically and load them with do_nut/load_module?
Title: Re: iteration of files in directory?
Post by: raygun on December 06, 2014, 03:52:47 PM
there is... the audiomode plugin reads a directory to find the audio files to play... you could do something similar to dynamically find a bunch of script files.

https://github.com/mickelson/attract/blob/master/config/plugins/AudioMode.nut

see the load_playlist function.