Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- log(" ")
- log(" ")
- log("Terminal Started")
- log(" ")
- log(" ")
- function s(...) return sleep(...) end
- function w(...) return write(...) end
- function p(...) return print(...) end
- function tw(...) return term.write(...) end
- function scp(...) return term.setCursorPos(...) end
- function sbc(...) return term.setBackgroundColor(...) end
- function stc(...) return term.setTextColor(...) end
- function tc(...) return term.clear(...) end
- function tcl(...) return term.clearLine() end
- function scb(...) return term.setCursorBlink(...) end
- function ts(...) return term.scroll(...) end
- function r(...) return shell.run(...) end
- function para(...) return parallel.waitForAny(...) end
- function sw(...) return textutils.slowWrite(...) end
- function sp(...) return textutils.slowPrint(...) end
- log("==> Adding taskbar")
- taskbar.setVisible(true)
- log("==> Creating app window")
- terminalwindow = window.create(term.current(),1,2,51,18)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- logo = paintutils.loadImage("OS/Programs/Terminal/Terminal.png")
- paintutils.drawImage(logo, 1, 1 )
- terminalwindow.setCursorPos(20,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- if admin == "true" then
- else
- adminpopup = window.create(term.current(),12,7,25,10)
- adminpopup.setBackgroundColor(colors.white)
- adminpopup.clear()
- adminpopup.setCursorPos(1,1)
- adminpopup.setBackgroundColor(colors.red)
- adminpopup.write(" Admin Login ")
- adminpopup.setTextColor(colors.black)
- adminpopup.setCursorPos(2,2)
- adminpopup.setBackgroundColor(colors.white)
- adminpopup.write("Please login as a admin.")
- adminpopup.setCursorPos(2,3)
- adminpopup.write("To access \"Terminal\"")
- adminpopup.setCursorPos(2,5)
- adminpopup.write("Username:")
- adminpopup.setCursorPos(2,6)
- adminpopup.setBackgroundColor(colors.lightGray)
- adminpopup.write(" ")
- adminpopup.setCursorPos(2,8)
- adminpopup.setBackgroundColor(colors.white)
- adminpopup.write("Password:")
- adminpopup.setCursorPos(2,9)
- adminpopup.setBackgroundColor(colors.lightGray)
- adminpopup.write(" ")
- while true do
- scp(13,12)
- sbc(colors.lightGray)
- username = read()
- scp(13,15)
- sbc(colors.lightGray)
- password = read("*")
- logincheck = fs.open("OS/Users/1/info.data", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- admin = logincheck.readLine()
- logincheck.close()
- end
- checkUser()
- if username == UserInfo[1][1] and password == UserInfo[1][2] and admin1 == "true" or username == UserInfo[2][1] and password == UserInfo[2][2] and admin2 == "true" or username == UserInfo[3][1] and password == UserInfo[3][2] and admin3 == "true" or username == UserInfo[4][1] and password == UserInfo[4][2] and admin4 == "true" then
- logincheck = fs.open("OS/Users/1/info.data", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- admin = logincheck.readLine()
- logincheck.close()
- end
- terminalwindow.clear()
- paintutils.drawImage(logo, 1, 1 )
- terminalwindow.setCursorPos(20,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- break
- else
- shell.run('OS/desktop.lua')
- end
- end
- end
- sleep(4)
- log("==> Prossecing animation")
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 5, 1 )
- terminalwindow.setCursorPos(25,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 10, 1 )
- terminalwindow.setCursorPos(30,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 15, 1 )
- terminalwindow.setCursorPos(35,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 20, 1 )
- terminalwindow.setCursorPos(40,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 25, 1 )
- terminalwindow.setCursorPos(45,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 30, 1 )
- terminalwindow.setCursorPos(50,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 32, 1 )
- terminalwindow.setCursorPos(51,15)
- terminalwindow.setTextColor(colors.white)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.write("Terminal")
- sleep(0.1)
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- paintutils.drawImage(logo, 35, 1 )
- sleep(2)
- taskbar.setCursorPos(1,1)
- log("==> Terminal Started!")
- taskbar.write(" Terminal - To Exit Type \"Exit\"")
- while true do
- i = 1
- taskbar.redraw()
- scp(1,3)
- repeat
- sbc(colors.black)
- i = i + 1
- cmd = read()
- if cmd == "exit" or cmd == "Exit" then
- log("==> User typed Exit... Exiting terminal.lua")
- shell.run('OS/desktop.lua')
- else
- log("==> Running command \""..cmd.."\"")
- shell.run(cmd)
- end
- until i == 5
- log("==> User typed over 5 commands... Clearing terminal")
- terminalwindow.setBackgroundColor(colors.black)
- terminalwindow.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement