Author Topic: iteration of files in directory?  (Read 5638 times)

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
iteration of files in directory?
« 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?

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: iteration of files in directory?
« Reply #1 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.