Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Open the file for reading
- local file = fs.open("specified.txt", "r")
- -- Check if the file exists
- if file then
- -- Read the content of the file
- local content = file.readAll()
- -- Close the file
- file.close()
- -- Check if the content is "true" or "false"
- if content == "true" then
- shell.run("program")
- elseif content == "false" then
- shell.run("other_program")
- else
- print("Invalid content in specified.txt")
- end
- else
- print("specified.txt not found")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement