Advertisement
PrinceOfCookies

.command

Jul 22nd, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. os.loadAPI("apis/cosUtils.lua")
  2.  
  3. local monitor = cosUtils.isMonitorHere()
  4.  
  5. if monitor then
  6. monitor.setTextColor(colors.white)
  7. monitor.clear()
  8. monitor.setCursorPos(1, 1)
  9. monitor.setTextScale(0.5)
  10. monitor.write("Welcome to COS CMD Prompt!")
  11. monitor.setCursorPos(1, 2)
  12. monitor.write("To return to the main menu, type `back`")
  13. monitor.setCursorPos(1, 3)
  14. monitor.write("===================================================")
  15. monitor.setCursorPos(1, 4)
  16.  
  17. while true do
  18. monitor.write("\n> ")
  19. local input = read()
  20. if input == "back" then
  21. shell.run("/2/.menu")
  22. break
  23. else
  24. shell.run(input)
  25. end
  26. end
  27.  
  28. cosUtils.onScreenKeyboard()
  29.  
  30. else
  31. term.setTextColor(colors.white)
  32. term.clear()
  33. term.setCursorPos(1, 1)
  34. term.write("Welcome to COS CMD Prompt!")
  35. term.setCursorPos(1, 2)
  36. term.write("To return to the main menu, type `back`")
  37. term.setCursorPos(1, 3)
  38. term.write("===================================================")
  39. term.setCursorPos(1, 4)
  40.  
  41. while true do
  42. term.write("\n> ")
  43. local input = read()
  44. if input == "back" then
  45. shell.run("/2/.menu")
  46. break
  47. else
  48. shell.run(input)
  49. end
  50. end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement