Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- local uicul = colors.red
- local bootPath = false
- local gameName = ""
- function cPrint(str)
- _, ypos = term.getCursorPos()
- term.setCursorPos(x/2-#str/2, ypos)
- write(str.. "\n")
- end
- function clearScreen( colua )
- term.setBackgroundColour( colua )
- term.clear()
- end
- clearScreen( colors.black )
- term.setCursorPos(1, 3)
- cPrint("WARINING-HEALTH AND SAFETY")
- print()
- cPrint("BEFORE PLAYING, PLEASE NOT THAT THIS")
- cPrint("GAME MIGHT BE TOO EPIC FOR")
- cPrint("A NORMAL MINECRAFTIAN.")
- print()
- cPrint("Also online at")
- cPrint("www.computercraft.info/forums2/")
- sleep(1)
- print()
- cPrint("Press (A) to continue.")
- repeat
- local event, key = os.pullEvent("char")
- until key == "a" or key == "A"
- sleep(0.5)
- if fs.exists(".lii") then
- file = fs.open(".lii/settings", "r")
- uicul = textutils.unserialize(file.readLine())
- file.close()
- else
- fs.makeDir(".lii")
- file = fs.open(".lii/settings", "w")
- file.write( textutils.serialize( colors.red ) )
- file.close()
- end
- function updateTime()
- term.setBackgroundColour( colors.white )
- term.setTextColour( uicul )
- term.setCursorPos(1,y-4)
- cPrint( textutils.formatTime( os.time() ) )
- timer = os.startTimer(0.5)
- end
- function drawSquare( posX, posY, colah )
- term.setBackgroundColour( colah )
- for i=1,7 do
- term.setCursorPos(posX,posY)
- write(" ")
- term.setCursorPos(posX,posY+i)
- write(" ")
- term.setCursorPos(posX+7,posY+i)
- write(" ")
- term.setCursorPos(posX+i,posY)
- write(" ")
- term.setCursorPos(posX+i, posY+7)
- write(" ")
- end
- end
- function drawUI()
- clearScreen( colors.white )
- term.setBackgroundColour( colors.lightBlue )
- for i=0,10 do
- term.setCursorPos(i,y-5)
- write(" ")
- term.setCursorPos(x-i,y-5)
- write(" ")
- end
- term.setCursorPos(x-11, y-4)
- write(" ")
- term.setCursorPos(x-12, y-3)
- write(" ")
- term.setCursorPos(11, y-4)
- write(" ")
- term.setCursorPos(12, y-3)
- write(" ")
- for i=13, x-13 do
- write(" ")
- end
- term.setBackgroundColour( uicul )
- for i=0,10 do
- term.setCursorPos(i, y-4)
- write(" ")
- term.setCursorPos(x-i, y-4)
- write(" ")
- end
- for i=0,11 do
- term.setCursorPos(i, y-3)
- write(" ")
- term.setCursorPos(x-i, y-3)
- write(" ")
- end
- for i=0,x do
- term.setCursorPos(i, y-2)
- write(" ")
- term.setCursorPos(i, y-1)
- write(" ")
- term.setCursorPos(i, y)
- write(" ")
- end
- term.setBackgroundColour( colors.lightGray )
- term.setCursorPos(3,y-1)
- write(" ")
- term.setCursorPos(2,y-2)
- write(" Lii ")
- term.setCursorPos(3,y-3)
- write(" ")
- term.setCursorPos(x-4,y-1)
- write(" ")
- term.setCursorPos(x-5,y-2)
- write(" LRM ")
- term.setCursorPos(x-4,y-3)
- write(" ")
- drawSquare( 2,2,uicul )
- term.setCursorPos(2,2)
- write("1) ...")
- drawSquare( 11,2,colors.lightGray )
- term.setCursorPos(11,2)
- write("2) None")
- drawSquare( x-8,2,colors.lightGray )
- term.setCursorPos(x-8,2)
- write("3) None")
- drawSquare( x-17,2,colors.lightGray )
- term.setCursorPos(x-17,2)
- write("4) None")
- term.setCursorPos(3,4)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("Insert")
- term.setCursorPos(3,5)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("Floppy")
- term.setCursorPos(3,6)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("<!--!>")
- end
- drawUI()
- updateTime()
- while true do
- local event, key = os.pullEvent()
- if event == "timer" and key == timer then
- updateTime()
- for k,v in pairs( rs.getSides() ) do
- if disk.isPresent(v) then
- local side = v
- local disks = disk.getMountPath( side )
- if fs.exists( disks.. "/gameInfo" ) then
- file = fs.open( disks.. "/gameInfo", "r" )
- bootPath = disks.. "/" ..file.readLine()
- gameName = file.readLine()
- file.close()
- break
- elseif fs.exists( disks.. "/startup" ) then
- bootPath = disks.. "/startup"
- gameName = "Error!"
- break
- end
- end
- bootPath = false
- gameName = ""
- end
- if bootPath then
- term.setCursorPos(3,4)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write( gameName )
- term.setCursorPos(3,5)
- write( " " )
- term.setCursorPos(3,6)
- write( " " )
- else
- term.setCursorPos(3,4)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("Insert")
- term.setCursorPos(3,5)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("Floppy")
- term.setCursorPos(3,6)
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.black )
- write("<!--!>")
- end
- elseif event == "key" and key > 1 and key < 6 then
- local keyNum = key -1
- if keyNum == 1 and bootPath then
- shell.run( bootPath )
- drawUI()
- updateTime()
- end
- end
- end
- sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement