Advertisement
DOGGYWOOF

y/n

Jan 28th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function main()
  2. print("Do you want to run the program? (y/n)")
  3. local user_input = read()
  4.  
  5. if user_input:lower() == 'y' then
  6. runProgram()
  7. elseif user_input:lower() == 'n' then
  8. print("Program not executed.")
  9. else
  10. print("Invalid input. Please enter 'y' or 'n'.")
  11. main()
  12. end
  13. end
  14.  
  15. function runProgram()
  16. -- Replace the following line with the code to run your desired program
  17. shell.run("your_program") -- Replace with your actual program name
  18. end
  19.  
  20. main()
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement