Advertisement
LazerAio

ANO

Mar 14th, 2022
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. args = {...}
  2. if #args == 0 then
  3. CodeName = "startup.lua"
  4. print("FILE?")
  5. FILE = read()
  6. else
  7. FILE = args[1]
  8. end
  9. if fs.exists(FILE) then
  10. else
  11. print("File does not exist, create new file?")
  12. print("Y/N")
  13. if string.upper(read()) == "Y" then
  14. fs.copy(CodeName,FILE)
  15. end
  16. end
  17. while true do
  18. sleep(1)
  19. term.setBackgroundColor(colors.gray)
  20. term.setTextColor(colors.black)
  21. term.clear()
  22. term.setBackgroundColor(colors.blue)
  23. term.setCursorPos(1,1)
  24. term.clearLine()
  25. term.write("ANO V1 "..FILE.." LOADING")
  26. term.setBackgroundColor(colors.gray)
  27. stream = fs.open(FILE,"r")
  28. sleep(1)
  29. i = 0
  30. j = 0
  31. while true do
  32. i = i + 1
  33. j = j + 1
  34. if j == 15 then
  35. j = 1
  36. read()
  37. term.clear()
  38. end
  39. term.setCursorPos(1,1)
  40. term.setBackgroundColor(colors.lime)
  41. term.clearLine()
  42. term.write("ANO V1 "..FILE.." LINE:"..i.." DEBUG:"..j)
  43. term.setBackgroundColor(colors.gray)
  44. term.setCursorPos(1,j+1)
  45. T = stream.readLine()
  46. if T == nil then
  47. break
  48. else
  49. print(T)
  50. sleep(0)
  51. end
  52. end
  53. term.setBackgroundColor(colors.red)
  54. print("END OF FILE")
  55. term.setBackgroundColor(colors.gray)
  56. print("EDIT? [Y/N]")
  57. if string.upper(read()) == "Y" then
  58. shell.run("edit", FILE)
  59. else
  60. term.setBackgroundColor(colors.black)
  61. term.clear()
  62. term.setTextColor(colors.yellow)
  63. term.setCursorPos(1,1)
  64. print("Goodbye!")
  65. break
  66. end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement