Advertisement
Guest User

startup

a guest
Oct 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.41 KB | None | 0 0
  1. --This will be the BIOS file. It will be run by
  2. --the /startup file and provide basic information
  3. --about the computer. it will also allow the
  4. --user to make configuration changes about
  5. --how their PC start up.
  6.  
  7.  
  8.  
  9. os.loadAPI("apis")--load API
  10.  
  11. --Custom API to return cursor to 1,1 and clear screen
  12. apis.cursorReturn()
  13. term.clear()
  14.  
  15. --Computer ID
  16. print("Computer ID: ".. os.computerID())
  17.  
  18. --Get terminal name
  19. if os.getComputerLabel() ~= nil then
  20. print("Computer Name: ".. os.getComputerLabel())
  21. else
  22.   --Set name if not already set
  23. print("Please enter a label for your computer:")
  24. NAME = read()
  25. os.setComputerLabel(NAME)
  26. print("Computer Name: ".. os.getComputerLabel())
  27. end
  28.  
  29. --Get ontime
  30. print("Computer started: ".. math.floor(os.clock()/60).. " minutes ago")
  31.  
  32. --get world time
  33. print("World Time: ".. os.time())
  34.  
  35.  
  36. --Get and display Cursor Position
  37. x,y = term.getCursorPos()
  38. print("Cursor is in position: "..x..","..y)
  39. iscolor = term.isColor()
  40.  
  41. --Get and display color status
  42. if iscolor == true then
  43. print("This is a color terminal")
  44. else
  45. print("This is not a color terminal")
  46. end
  47.  
  48. --Get the size of the terminal
  49. x,y = term.getSize()
  50. print("The size of the terminal is "..x.." by "..y)
  51.  
  52. --Get the color of the text
  53. textColor = apis.whatColor(term.getTextColor())
  54. print("The text color is "..textColor..".")
  55.  
  56. --Get the color of the background
  57. bgColor = apis.whatColor(term.getBackgroundColor())
  58. print("The background color is "..bgColor..".")
  59. term.setTextColor(256)
  60.  
  61. --Detect and record devices. List.
  62. term.setTextColor(colors.yellow)
  63. apis.detect()
  64. --set hide to false to see device facings
  65. hide = true
  66. if hide == false then
  67. dev = fs.open("devices.cfg","r")
  68. print("TOP: "..dev.readLine())
  69. print("BOTTOM: "..dev.readLine())
  70. print("LEFT: "..dev.readLine())
  71. print("RIGHT: "..dev.readLine())
  72. print("FRONT: "..dev.readLine())
  73. print("BACK: "..dev.readLine())
  74. print("MAIN MONITOR: "..dev.readLine())
  75. dev.close()
  76. end
  77. term.setTextColor(colors.white)
  78.  
  79. --Declare that the terminal test is finished
  80. term.setTextColor(colors.gray)
  81. print("Term Test complete")
  82. term.setTextColor(1)
  83.  
  84. --Ask to continue
  85. print("Please press enter to continue")
  86. --print("Enter x for setup")
  87. j=read()
  88. term.clear()
  89. apis.cursorReturn()
  90. if j ~= 'x' then
  91. return
  92. end
  93.  
  94.  
  95. term.setCursorPos(1,1)
  96. print("Please select an option to make changes.")
  97. print("1)Startup Cursor Position")
  98. print("2)Color")
  99. print("3)Terminal size")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement