It needs to be used like this:
code:
var list = ListFiles("C:\\",1);
Debug.Trace("First File in C:\\ is "+list[0]);
That would get a list of all files in C:\ and Debug.Trace the first file in the list.
So in your example you'd need to do this
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
if(Message.match("^!list"))
{
var folder = Message.substr;
var stuff = ListFolders(folder,1);
ChatWnd.SendMessage(stuff.join("\r\n"));
}
}
That would send a list of your files to your contact with each file on its own line.