Advertisement
DOGGYWOOF

VA11 check

Jan 1st, 2024
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. local filename = shell.getRunningProgram() -- Get the name of this Lua script file
  2. local fileToMonitor = filename -- Set the file to monitor as this Lua script file
  3.  
  4. local interval = 5 -- Interval in seconds
  5.  
  6. while true do
  7. if fs.exists(fileToMonitor) then
  8. -- Your code to send a message or perform actions when the file is found
  9. -- For example: redstone.setOutput("back", true)
  10. print("File found!")
  11. else
  12. -- Your code to run when the file is not found
  13. -- For example: shell.run("program_to_execute")
  14. print("File not found!")
  15. end
  16.  
  17. os.startTimer(interval)
  18. os.pullEvent("timer")
  19. end
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement