Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This will be the BIOS file. It will be run by
- --the /startup file and provide basic information
- --about the computer. it will also allow the
- --user to make configuration changes about
- --how their PC start up.
- os.loadAPI("apis")--load API
- --Custom API to return cursor to 1,1 and clear screen
- apis.cursorReturn()
- term.clear()
- --Computer ID
- print("Computer ID: ".. os.computerID())
- --Get terminal name
- if os.getComputerLabel() ~= nil then
- print("Computer Name: ".. os.getComputerLabel())
- else
- --Set name if not already set
- print("Please enter a label for your computer:")
- NAME = read()
- os.setComputerLabel(NAME)
- print("Computer Name: ".. os.getComputerLabel())
- end
- --Get ontime
- print("Computer started: ".. math.floor(os.clock()/60).. " minutes ago")
- --get world time
- print("World Time: ".. os.time())
- --Get and display Cursor Position
- x,y = term.getCursorPos()
- print("Cursor is in position: "..x..","..y)
- iscolor = term.isColor()
- --Get and display color status
- if iscolor == true then
- print("This is a color terminal")
- else
- print("This is not a color terminal")
- end
- --Get the size of the terminal
- x,y = term.getSize()
- print("The size of the terminal is "..x.." by "..y)
- --Get the color of the text
- textColor = apis.whatColor(term.getTextColor())
- print("The text color is "..textColor..".")
- --Get the color of the background
- bgColor = apis.whatColor(term.getBackgroundColor())
- print("The background color is "..bgColor..".")
- term.setTextColor(256)
- --Detect and record devices. List.
- term.setTextColor(colors.yellow)
- apis.detect()
- --set hide to false to see device facings
- hide = true
- if hide == false then
- dev = fs.open("devices.cfg","r")
- print("TOP: "..dev.readLine())
- print("BOTTOM: "..dev.readLine())
- print("LEFT: "..dev.readLine())
- print("RIGHT: "..dev.readLine())
- print("FRONT: "..dev.readLine())
- print("BACK: "..dev.readLine())
- print("MAIN MONITOR: "..dev.readLine())
- dev.close()
- end
- term.setTextColor(colors.white)
- --Declare that the terminal test is finished
- term.setTextColor(colors.gray)
- print("Term Test complete")
- term.setTextColor(1)
- --Ask to continue
- print("Please press enter to continue")
- --print("Enter x for setup")
- j=read()
- term.clear()
- apis.cursorReturn()
- if j ~= 'x' then
- return
- end
- term.setCursorPos(1,1)
- print("Please select an option to make changes.")
- print("1)Startup Cursor Position")
- print("2)Color")
- print("3)Terminal size")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement