Advertisement
DOGGYWOOF

multi shell background run

Jan 3rd, 2024 (edited)
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local function checkForFile()
  2. local fileName = "your_file_name_here" -- Replace with the name of your file
  3.  
  4. while true do
  5. if fs.exists("scripts/" .. fileName) then
  6. print("File found: " .. fileName)
  7. -- Add your logic here when the file is found
  8. break -- Break the loop when the file is found (optional)
  9. end
  10.  
  11. sleep(5) -- Check every 5 seconds (you can modify this)
  12. end
  13. end
  14.  
  15. local shellID = multishell.launch({}, checkForFile)
  16. multishell.setTitle(shellID, "File Checker")
  17.  
  18. -- Keep the program running to allow the background check to continue
  19. while true do
  20. sleep(1)
  21. end
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement