Skip to content

Instantly share code, notes, and snippets.

@Denneisk
Created September 25, 2023 20:34
Show Gist options
  • Save Denneisk/4e14d2872c8860b6b08d25ab1c29c29b to your computer and use it in GitHub Desktop.
Save Denneisk/4e14d2872c8860b6b08d25ab1c29c29b to your computer and use it in GitHub Desktop.
@name FileQueuedAndAll
@strict
if(fileClk())
{
print("fileClk")
}
elseif(fileListClk())
{
print("fileListClk")
}
elseif(first())
{
fileList(".")
fileWrite("1test.txt", "test")
fileWrite("2mucho.txt", "texto")
fileWrite("3third.txt", "third")
fileWrite("4fourth.txt", "night")
fileWrite("e2.txt", "https://www.youtube.com/watch?v=T3ElIvNBYj0")
try{
fileWrite("dies.txt", "Won't be written :(")
}catch(E){print("Failed to write dies.txt: " + E)}
}
event fileLoaded(FilePath:string, Data:string)
{
print(FilePath + ": " + Data:sub(1, 64))
}
event fileList(Path:string, Contents:array)
{
print("Path: " + Path)
printTable(Contents)
foreach(_, V:string = Contents)
{
try{ fileLoad(V) }
catch(E){print("Failed to load " + V + ": " + E)}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment