Advertisement
DOGGYWOOF

test

Feb 1st, 2024 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. -- Open the file for reading
  2. local file = fs.open("specified.txt", "r")
  3.  
  4. -- Check if the file exists
  5. if file then
  6. -- Read the content of the file
  7. local content = file.readAll()
  8.  
  9. -- Close the file
  10. file.close()
  11.  
  12. -- Check if the content is "true" or "false"
  13. if content == "true" then
  14. shell.run("program")
  15. elseif content == "false" then
  16. shell.run("other_program")
  17. else
  18. print("Invalid content in specified.txt")
  19. end
  20. else
  21. print("specified.txt not found")
  22. end
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement